We have the following structure of our website:Main site - mainsite.comContains blog, few products and pricing table etc...Single product sites - myproduct1.com, myproduct2.comProduct specific website which sits on its own domain and contains pricing tableStorefront provider - Fastspring.comPurchase is going through here for all sites and reports it to analytics.Currently I have using the same Analytics property code for mainsite.com and fast spring.com with the following code on the main site.com:<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-33288836-1', 'yourwebsite.com'); ga('send', 'pageview'); // Load the plugin. ga('require', 'linker'); // Define which domains to autoLink. ga('linker:autoLink', ['fastspring.com']);</script>Currently the single product sites are not added into this Analytics workflow, but we would like to track that sites too.We would like to see the following in Analytics at the end:Stats on site basis (Fastspring.com aggregated into main site.com as currently)If a visitor moves between our sites - mainsite.com, myproduct1.com, myproduct2.com - we would like to see proper referrers. It is enough to see the purchase stats on the maindomain.com, but would like to see the original referrer, not myproduct1.com and myproduct2.comIs it possible? What would be the proper implementation with Google Analytics?
Google Analytics tracking on multi domain environment
google analytics;multiple domains
Using a number of subdomains for individual product pages is not very scalable but if you want to track all the domains under one main property (and have the eCommerce data roll up into one view) there is a way to do this in Google Analytics. I will broadstroake it here but the detailed documentation can be found here.Reorder your tracking code. ga('send', 'pageview'); has to be at the end of the GA script.Add this code for all the external domains you want to link up. You already have most of it. ga('create', 'UA-XXXXX-Y', 'auto', {'allowLinker': true}));ga('require', 'linker');ga('linker:autoLink', ['example-2.com', 'example-3.com'] );ga('send', 'pageview');Make sure the array ['example-1.com', 'example-3.com'] includes all the product pages you want to track.Lastly, you have to add your main domain and all the external domains in the self-referral exclusion list. This can be found under the Admin section of GA -> Property -> JS Tracking Info -> Self-Referral Exclusion ListYou will also have to add this code on all the other domains, modified appropriately:  ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});ga('require', 'linker');ga('linker:autoLink', ['example-1.com'] );This will make sure the cookie you get from the main site will get shared accross the other domains. You will be able to test this by clearing your cookies and then navigating from your main site to the secondary domain and you should see ?_ga=1.34595........  appended to your URL in the address bar. You can also go to yourdomain.com?utm_source=cd_test&utm_medium=test and then look in the realtime view under traffic sources if you can see yourself.