Recommendations before using Cross-domain tracking:
- Basic knowledge of HTML and JavaScript
- Alternatively, work with a developer to setup Cross-domain tracking
What is Cross-domain tracking?
Cross-domain tracking allows you to differentiate between users landing on your webpage through different domains. When a user accesses your page a cookie with a random identifier is generated for them and allows you to understand whether a visitor is unique or the same user who moved between your webpages.
How do I check if Cross-domain tracking is working?
To understand if Cross-domain tracking is working, we would want to see if traffic that goes into one domain to another domain matches the same source and medium.
This can be done by verifying the following:
- Are both of my domains validated under the same property?
- Does Google Analytics display the correct source domain in the referral exclusion list?
- Verify if allow linker in GTM is “true”
- Does your domain have a linker parameter in the URL?
More information on Google Analytics/Cross-Domain setup here: https://support.google.com/analytics/answer/1034342#GTM
Note
The examples in this article use the Universal Analytics tracking code snippet (analytics.js).
For cross-domain tracking, set up one property in your Analytics account. Use the same tracking code snippet and tracking ID from that property for all of your domains.
Getting Started
You will need to edit the tracking code snippet for cross-domain tracking to work. If you haven’t already included the snippet on all your webpages, you may want to copy and paste the tracking code snippet into a text editor before continuing with the instructions here so you only have to make the changes once before including the modified snippet on all of your webpages.
Edit the tracking code for the primary domain
Find the “create” line in the snippet, for example a website called example-1.com . It would look like this:
ga('create', 'UA-XXXXXXX-Y', 'example-1.com');
After locating the create line, we make the following changes to the snippet:
ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', ['example-2.com']);
Remember to replace the example tracking ID (UA-XXXXXX-Y) with your own tracking ID and replace the example secondary domain (example-2.com) with your own secondary domain name.
The tracking code snippet must contain these changes every place it appears on your primary domain.
What if I have 3+ Domains?
For three or more domains follow the example above, but add the other domains to the autoLink plugin. The additional commas here are important:
ga('linker:autoLink', ['example-2.com', 'example-3.com'] );
Your primary domain tracking code snippet should look similar to the following example, except with your information:
<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-XXXXXXX-Y', 'auto', {'allowLinker': true});ga('require', 'linker');ga('linker:autoLink', ['example-2.com'] );ga('send', 'pageview');</script>
Utm Tracking in Regpack System Fields
Regpack also tracks the URL that users began their registration journey, and can even pull out the UTM parameters in that URL if they exist. In order to view and report on this information, you'll need to create a report in Regpack and add those system fields to the report. You can set the report as "Info View" if you'd like to view this information in the user panel, or simply filter for the users you'd like this information on (like everyone who ordered a specific product) and then run the report.
As you can see above, you can view the UTM source, medium, campaign, as well as the full URL for every user.