Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 WordPress for Ecommerce Templates
 Google Analytics ecommerce tracking for ECT
Author « Topic »  

Andy
ECT Moderator

95440 Posts

Posted - 05/26/2016 :  06:16:24  
To track your sales (and visits etc) through Google Analytics on your Wordpress ECT store add the following to vsadmin/includes.php

$GLOBALS['googleanalyticsinfo']=TRUE;
$GLOBALS['usegoogleuniversal']=TRUE;

and this code snippet to footer.php

<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','UA-XXXXXXXX-X','auto');
ga('send','pageview');
ga('require','ecommerce','ecommerce.js');
<?php print @$GLOBALS['googleanalyticstrackorderinfo']?>
</script>

Replacing UA-XXXXXXXX-X with your own Google tracking ID.

Make sure that code is added to the HTML of footer.php and not added as a custom script function.

In your Google Analytics console make sure the site is set up as an ecommerce site ie. Conversions > Ecommerce

Andy

Please feel free to review / rate our software
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2021 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000