top of page

Visionary Ads

How to set up cross-domain tracking in Google Analytics (using GTM)?

  • Writer: Alex Denshik
    Alex Denshik
  • Mar 17, 2021
  • 4 min read

Updated: Apr 5, 2021

People are also looking for:


How to track Google Analytics conversions from a domain and subdomain?

How to track conversions on the website and cart page (with another domain)/ third-party page?

How to set up one tracking on different domains?

How to set up cross-domain tracking?

Conversions from AdWords go to referral traffic, how to fix it (one of the possible reasons)?


What you need:


  • Google Analytics account and tracking ID (see where to find Analytics tracking ID)

  • Google Tag Manager (GTM) account

  • Added same GTM code on both pages/domains (same container).

  • It is advisable to install the browser extension - Google Tag Assistant (to check if everything works);



Step 1: Go to the GTM page (https://tagmanager.google.com/) and log into your account. Then select the "Variables" menu item and click on "New" button in the User-Defined Variable field (if you already have the Analytics setting variable you can edit it)


Step 2: Choose variable type - Google Analytics Settings


Step 3: Enter your tracking ID. Then, click on More Settings >> Cross Domain Tracking.


Step 4: In the Auto Link Domains field, enter a comma-separated list of domains (like https://example.org/,https://sale.example.org/)


Step 5: Next, navigate to More Settings >>Fields to Set and add a field with a Field Name of allowLinker and a Value of true. Give a name to your variable and click save.


Step 6: Go to the "Tags" section and click the "New" button.


Step 7: Create a new tag for Analytics (if you already have a Google Analytics tag and it uses the variable you changed, you don't need to create a new one). Name - choose any; Tag Type - Google Analytics: Universal Analytics; Track Type - Pageview; Google Analytics setting - your new variable; Triggering - All Page; Save.


Step 8: Click the "Submit" button, fill in the information about the changes (it doesn't matter what you write) and click the "Publish" button


Step 9: Open your Google Analytics account and click on "Admin"


Step 10: On the Property Setting level click on "< > Tracking Info", and in the dropdown menu click on “Referral Exclusion List


Step 11: Create new exceptions for each domain by clicking on the red button “+ ADD REFERRAL EXCLUSION”


Done. Cross-domain tracking should work.


How to check?


Using the Google Tag Assistant (you already have one, right?). This is a browser extension, a must-have for anyone who works with GTM, Analytics, or AdWords

  1. Load your first page. Enable Google Tag Assistant and start the record. Refresh Page.

  2. Make an action to go to your second page (click on the button or link) and visit it.

  3. Return to the first page, click on the Tag Assistant, select the "View Recordings" function. You can already see how many pages and tags are tracked under "Your current recordings".

  4. To find out if the correct pages are being tracked click on "Show Full Report". A new report page will open. Find the "Recorded Pages" section and see which pages are being tracked.

That's all. If you have the right pages tracked - congratulations, you have configured cross-domain tracking correctly.

If not, then somewhere you missed something. Check again with the Tag Assistant to see if the same GTM code is installed on all the pages you need. Does the Analytics tag work? Have you entered the domains correctly in the variable settings (along with https: // and without spaces)?



See Screenshots:


Step 1: Go to the GTM page (https://tagmanager.google.com/) and log into your account. Then select the "Variables" menu item and click on "New" button in the User-Defined Variable field (if you already have the Analytics setting variable you can edit it)


Step 2: Choose variable type - Google Analytics Settings


Step 3: Enter your tracking ID. Then, click on More Settings >> Cross Domain Tracking.


Step 4: In the Auto Link Domains field, enter a comma-separated list of domains (like https://example.org/,https://sale.example.org/)


Step 5: Next, navigate to More Settings >>Fields to Set and add a field with a Field Name of allowLinker and a Value of true. Give a name to your variable and click save.


Step 6: Go to the "Tags" section and click the "New" button.


Step 7: Create a new tag for Analytics (if you already have a Google Analytics tag and it uses the variable you changed, you don't need to create a new one). Name - choose any; Tag Type - Google Analytics: Universal Analytics;


Track Type - Pageview; Google Analytics setting - your new variable; Triggering - All Page; Save


Step 8: Click the "Submit" button, fill in the information about the changes (it doesn't matter what you write) and click the "Publish" button


Step 9: Open your Google Analytics account and click on "Admin"


Step 10: On the Property Setting level click on "< > Tracking Info", and in the dropdown menu click on “Referral Exclusion List


Step 11: Create new exceptions for each domain by clicking on the red button “+ ADD REFERRAL EXCLUSION”


How to check? Using the Google Tag Assistant


Comments


bottom of page