Google Analytics Cross-Domain Tracking For Infusionsoft

KB1028803

If you've installed our AnalyticsConnect.io software that automatically posts sales data from Infusionsoft into Google Analytics Ecommerce, you may have noticed a problem inside of Google Analytics where traffic reports are getting "broken" as traffic moves between your main website and Infusionsoft hosted pages. This happens when cross-domain tracking isn't setup properly inside Google Analytics.

As an example: when a user starts off on your main website of www.example.com and then adds a product to their shopping cart, they change domains as they are passed to your Infusionsoft shopping cart at aa001.infusionsoft.com. A default install of Google Analytics sees this user as visiting two separate websites, first www.example.com and then aa001.infusionsoft.com, and will actually list www.example.com as the referring site. Rather than seeing both domains as one web property, and sharing visitor session data between them, they are seen as being completely separate web properties.

Beyond the annoyance of seeing yourself in your traffic referrer reports, which will report more visits than actually happened, it strips the real referrer information. All of your SEO, link tagging, and AdWords campaign data disappears when all conversions and transactions get attributed to your own website as the referrer. Here's how to properly setup cross-domain tracking and fix the problem...

First you'll need to modify your tracking code as shown below, adding the sections highlighted in yellow while changing the sections in red to match your Google Analytics account number, primary domain name, and Infusionsoft application domain name. Use this code for both your main website and Infusionsoft hosted pages. If you're using our WordPress Plugin, simply check the box inside of the WordPress Plugin Admin that says, "Write Google Analytics Tracking Code" and this code will be automatically added to your website. Either way, you'll need to manualy add this code to your Infusionsoft hosted pages.

<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-XXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['example.com', 'aa100.infusionsoft.com'], false, true);
ga('send', 'pageview');
</script>

Part of this code enables auto-linking which decorates the links and forms between the sites with special cross-domain tracking data. Once enabled, if you click on the "Continue Shopping" link inside of your Infusionsoft shopping cart that you've configured with the following URL:

http://www.example.com

You'll be sent to a URL similar to:

http://www.example.com?_ga=5.232382533.1235655971.3979099621

Finally, you'll need to update your Referral Exclusion List inside Google Analytics. From the top menu click on "Admin" and then under the middle section named "PROPERTY" click on "Tracking Info" and then "Referral Exclusion List". Add exclusion for your main domain name without the sub-domain, and your Infusionsoft application domain including the sub-domain. Using the above example, this would be example.com and aa100.infusionsoft.com.

Related Resources

Tracking Page Views On Infusionsoft Hosted Pages

Enable Demographics for Sales Data

Article Feedback

If this article is incorrect or outdated, or omits critical information, please use our contact us form and let us know.