Cross-domain tracking for Universal Analytics

If your website visitors go from one website domain to another in the same visit, such as to, you will want to ensure that Google Analytics is setup to track those visitors across website domains. If you do not set this up, the visitor session will break when they go from one domain to another and your data will show two seperate visitors (one on and one on You can read more about cross domain tracking in the help center article.

If you are implementing the Universal Analytics (analytics.js) tag via Google Tag Manager, setting up cross-domain tracking is a fairly simple process. But before you begin, make sure you’ve set up the gaDomain and gaCrossDomains constant string variables mentioned earlier in this guide. They will make this process even easier.

For each step below, you will be editing your Universal Analytics Pageviews tag in Google Tag Manager.

Step 1

Under “More Settings > Fields to Set”. Here you will add 2 fields:

  1. Field Name of ‘allowLinker’ with a Value of ‘true’.

  2. Field Name of ‘cookieDomain’ with a Value of ‘auto’ (no quotes), but if you have already setup the gaDomain variable, then simply choose that from the variables list.

Fields to Set fields with allowLinker = true and cookieDomain = {{gaDomain}}

Editing the Universal Analytics Pageview tag: Add allowLinker field with a value of true, Set up Cross Domain Tracking in the Auto Link Domains field

Step 2

Under “More Settings > Cross Domain Tracking” you’ll want to set up each of your owned domains that you want to configure for cross-domain tracking. You’ll set this up as a comma separated list (e.g.,, If you’ve already set up the gaCrossDomains variable (highly recommended), simply select that from the variables list.

Cross domain tracking fields


Step 3

Save, preview, debug, then publish the tag changes.

Previous: Data Layer or Google Tag Manager UI? | Next: Event tracking with Google Tag Manager

Was this article helpful?
How can we improve it?