
Originally Posted by
DivaVocals
Got it guess we're both confused.. **lol**
Okay for posterity sake.. Here's how I am using this module.. (so anyone following our comedy act here will be clear..

)
- I have do not have any of the other Zen Cart modules or plugins installed on this site..
- I have installed your Ecommerce tracking module as per the readme..
- I manually add the regular GA code following the instructions from Google: Add the tracking code directly to your site
Everything works perfectly..
Well, it *shouldn't* be 'working perfectly' because with this setup, any page where you've manually added the Google tracking code will (in theory) be recording double page hits. Once from the ec_analytics module and another from your manually added tracking code.
Those instructions from Google can/should be ignored - The code snippet mentioned there is inserted into every page on the site via the ec_analytics javascript.
Yes, I know that the google page (correctly) states "Don’t mix up tracking code snippets from different properties, and don’t reuse the same tracking code snippet on multiple domains", which I guess could imply that the 'snippet' inserted by ec_analytics isn't going to contain the site specific information, BUT the only different thing from site to site is the GOOGLE_UA number which is the reason why ec_analytics module needs this to be set on a site to site basis.
The rest of the 'snippet' is identical across all sites.
I would suggest that you do a 'view source' on the site where you are using ec_analytics modules and the manually added tracking code, and you'll almost certainly find two instances of
Code:
<script> (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');
There will be additional code after this (up to the closing /script tag) that will vary between the two implementations.
The manually added code will have:
Code:
ga('send', 'pageview');
</script>
The ec_analytics added code will have
Code:
ga('require', 'ec');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
.... and there will be even more additions with the ec_analytics added code on the product info and checkout pages.
It is important that you don't have two instances of this:
Code:
<script> (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');
</script>
'cos in theory, Google will be recording a 'pageview' from each instance.
Cheers
RodG