Skip to Content
LLM Decode learn.llmdecode.com
Back to all resources
SOP-036

Setting up cross-domain tracking with GTM

Correctly collect all the traffic data that comes to the domains that are under your control and analyze how users interact across them in Google Analytics

Type SOPs · PDF
Execution time 15-30 minutes
Last updated 25 March 2024
Who does this The person responsible for website management or analytics
Length 13 pages

Goal

To correctly implement and test cross-domain tracking in Google Analytics 4

Ideal outcome

You will be able to correctly collect all the traffic data that comes to the domains that are under your control and analyze how users interact across them

Why it matters

Cross domain tracking makes it possible to unify what would otherwise be considered as two (or more) separate sessions that occur under two (or more) of your domains. The specific steps on this SOP apply only to Universal Google Analytics (not Google Analytics 4). If you followed other SOPs to create your Google Analytics account or if you set up Google Analytics before October 2020 you most likely have a Universal Analytics property

Before you start

• To follow this SOP you will need to have installed Google Tag Manager on all your domains. If you haven’t done so already and you are using WordPress you can follow SOP 004 (web version). • You will also need to have Google Analytics running on all your domains. if you don’t have it yet, you can follow the steps described in SOP 009 (web version)

Key steps 27 steps

What is inside 30 headings

1 Setting up Cross-domain tracking 8

  1. Go to your GA4 account and sign in with your account details.
  2. On the left navigation menu, click ‘Admin’ on your bottom left.
  3. Next, click ‘Data Streams’.
  4. Click ‘Add Stream’, select ‘Website’ and enter your domain after.
  5. Once you have added a stream, click on it, scroll down to ‘Google Tag,’ and click ‘Google tag settings.’
  6. Next, click ‘Configure your domains’.
  7. Click ‘Add condition’ and enter your domain. You can add multiple match types based on the drop-down menu. Add each domain you want to include in the cross-domain measurement:
  8. Remember to hit ‘Save’ on your top right corner and that’s it!

2 Adding your new domain to the referral exclusion list: 7

  1. Open your Google Analytics 4 account settings by clicking here or clicking 'Admin' in the sidebar.
  2. Select the correct Google Analytics 4 Account and Property
  3. Click 'Tracking Info' → 'Referral Exclusion List'
  4. You should see your root domain on the list:
  5. Click '+Add Referral Exclusion'
  6. Type your new domain:
  7. Click 'Create', and that’s it! You should now see your other domain in the Referral Exclusion List:

3 Check if cross-domain tracking is working as intended 12

  1. Go to your GA4 account and sign in with your account details.
  2. On the left navigation menu, click ‘Admin’ on your bottom left.
  3. Under ‘Property’, click on ‘Tracking Info’ followed by ‘Tracking Code’.
  4. Add Google Tag Assistant Chrome Extension to your browser.
  5. Follow the same steps for the destination domain and check if the property ID is the same.
  6. Alternatively, once the page loads click again on the Google Tag Assistant Chrome extension and click 'Stop Recording' and then click 'Show Full Report':
  7. Select 'Google Analytics 4 Report':
  8. Select the view that you want to test and click 'Ok':
  9. Check the 'Alerts' section and make sure you’re not seeing an alert regarding the Cross Domain implementation.
  10. Scroll down in the report until you find the 'Flow' section. You should see at least 2 Page loads there:
  11. You can also validate the same using the 'Inspector' tool. Simply right click on the page and select 'inspector'. In the network console, filter for collect in the header you would see the property ID shown as below.
  12. That’s it, if everything looks good your property will start collecting data correctly from both domains.

The document 13 pages

The file is locked

It comes with 2 DAY GEN AI ENGINEERING MASTERMIND, or with the full library.

Bought from LLM Decode before? Sign in to pay ₹ 1,999.00.

Up next · SOP-037 Getting started with team password management Set up a reliable tool for managing and sharing secure passwords among your entire team and be able to create different passwords for each account effortlessly Unlock to read