How To Set Up Cross Domain Tracking
Cross domain tracking makes it possible for Analytics to see sessions on two related sites as a single session. It also helps you to better track your goal conversions. In this guide, we’ll show you how to implement cross domain tracking using MonsterInsights.
Why You Need Cross Domain Tracking
You need cross domain tracking when your Google Analytics session spans across two or more domains and you want to track the sessions across different domains as a single session.
Let’s take a detailed look.
Imagine that a user lands on your site from a PPC campaign, and then goes to your third-party shopping cart’s site like Shopify to complete the checkout process.
If you’re not implementing cross domain tracking on your site, here is how Google Analytics tracks ecommerce transactions.
- It counts the same user as two different users and tracks this single session as two sessions.
- Instead of crediting the PPC campaign for conversion, it simply tells you that someone from your site made a purchase. That means you can’t determine the original source of your goal conversion.
Another benefit of implementing cross domain tracking is that you can collect data from different domains in a single report.
Let’s take a look at how to set up cross domain tracking in MonsterInsights.
Turning on allowLinker
To enable allowLinker on your site, navigate to Insights » Settings » Enhanced Link Attribution. Then, click the checkbox to turn on allowLinker. Then, click Save Changes.
Insert a Custom Code
After turning on allowLinker, you’ll need to insert custom code in the custom code snippet by navigating to Insights » Settings » Advanced » Custom Code.
Here is the custom code.
__gaTracker('linker:autoLink', ['example-2.com'] );
Make sure to replace example-2.com in the code with the second domain you’d like to cross track.
In other words, if the site MonsterInsights is installed on is yourdomain.com, you can include example-1.com in the cross domain tracking but don’t include yourdomain.com.
If you want to cross track three or more domains, you can separate the domain names with a comma
__gaTracker('linker:autoLink', ['example-2.com', 'example-3.com'] );
Then, click Save Changes.
Verify Your Source Code for Cross Domain Tracking
If you want to test whether cross tracking is implemented correctly, you just need to look at the source code of your site.
If you can find the custom tracking code in your Google Analytics source code, you’ve successfully implemented cross tracking on your site.
Common Mistakes with Cross Domain Tracking
For instance, if your site is example.com, and you include example.com as a site in the cross domain tracking area, this will cause tracking issues in Google Analytics.
If you’re having issues with your cross domain tracking, be sure to verify that this is not the case first.
That’s it! Now you know how to properly set up cross domain tracking. Are you interested in tracking your form conversions? Then please see our guide: How to View Your Form Conversion Stats in MonsterInsights.