dbdave
ECT Moderator
USA
10444 Posts |
Posted - 03/16/2021 : 14:28:30
Hi Michelle, have you added any code for the tracking? On the PHP parameters page, there is these steps... quote: Add Google Analytics ecommerce code
If you want to track orders using Google Analytics add the following...
$googleanalyticsinfo=TRUE; $usegoogleasync=TRUE;
... then open your php pages and just above the closing </body> tag add the following...
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); <?php print @$googleanalyticstrackorderinfo?>(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})(); </script>
If you want use Google Analytics Universal Code you will need to be running Version 6.3 and add the following to vsadmin/includes.php
$usegoogleuniversal=TRUE;
You will also need this code on thanks.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-XXXX-Y','auto'); ga('send','pageview'); ga('require','ecommerce','ecommerce.js'); <?php print @$googleanalyticstrackorderinfo?> </script>
for Wordpress users you would need this in 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-XXXX-Y','auto'); ga('send','pageview'); ga('require','ecommerce','ecommerce.js'); <?php print @$GLOBALS['googleanalyticstrackorderinfo']?> </script>
|
copcars
Starting Member
USA
31 Posts |
Posted - 11/23/2022 : 19:27:39
Hi Dave...I know you answered a question for me earlier today, and I'm continuing my research on the new Google Analytics 4.
Question: In the code listed above, the UA tracking ID is used (UA-XXXXX-X). Can I replace this with my new G- tracking ID?
Thanks
Eric Payne
|