How to Set Up Cross-Domain Tracking in GA4 (And Why It Matters)

If your website sends users between multiple domains and you’re not using cross-domain tracking in GA4, you’re flying blind. Learning how to set up cross-domain tracking in GA4 allows you to follow user data and behaviour across websites as in a single session. Without it, your data becomes fragmented and misleading.
Whether you run an ecommerce website where users use check out on another domain or a business with multiple subdomains, understanding how to set up cross-domain tracking in GA4 is essential to gain accurate insights.
In this post, we’ll walk you through what it is, why it matters, and how exactly you can implement it.
What is Cross-Domain Tracking in GA4?
Cross-domain tracking in GA4 ensures that when your website visitors move across different domains that they are recognised as the same user in the same session.
Without this, GA4 would essentially treat a visit to your second domain as a new session, drastically skewing your data.
It’s very useful for these particular scenarios:
- Ecommerce checkouts that are hostess externally to the main website
- Tracking users across booking platforms
- Measuring behaviour data across a blog subdomain
- B2B businesses that have lots of smaller micro sites.
I Understand, But Why Does This Matter?
GA4 is the most recent version of Google Analytics, its predecessor was called Universal Analytics. Previously, Universal Analytics needed something called a ‘linker parameter’ to enable cross-domain tracking.
Google Analytics 4 does not need a linker parameter, it has a built in cross-domain tracking configuration implemented either through Google Tag Manager or the gtag.js.
In order for this post to be as useful to you as possible, especially if you’re just starting out in the wide world of website analytics, I’d encourage you to check out our beginners guide to connecting Google Analytics 4 before you go any further.
If you already have your website tracking working properly, please continue!
How to Set Up Cross Domain Tracking Using Google Tag Manager
If you’re already using Google Tag Manager, this is the easiest and most efficient way to implement cross-domain tracking for your business.
Step by Step Instructions for Google Tag Manager
- Open your Google Tag Manager account
- Navigate to your GA4 Configuration tag
- In ‘Fields to Set’, add a new filed:
- Copy the following as the ‘Field Name’: linker:autolink
- Use your other domains or websites as the ‘Value’: For example, ‘blog.yourdomain.com’ or ‘yourdomain.shop’. (If you have multiple domains, you must add them as a comma-separated list)
- Stay in Google Tag Manager, find the ‘Tag Settings’ and ensure that ‘Cross-domain tracking’ is turned on.
- Publish the changes you have made to the container and test them using the preview mode and tag assistant.
How to Set It Up Using gtag.js Instead
To be honest and frank, if you have little to no experience with tracking and analytics then we would not recommend that you use the gtag.js method at all.
This requires you to manually change code on your website and this can have unforeseen complications that might hinder your website performance if done incorrectly.
In this instance, we’d highly recommend engaging an agency that is more proficient and has the knowledge and technical experience to carry this out for you.
Our Final Thoughts
Learning how to set up cross-domain tracking in GA4 isn’t just a technical task or exercise, it’s a necessary step for every business that wants to understand the full user journey across multiple websites and domains.
Whether you’re using Google Tag Manager or the manual gtag.js method they key here for you, is to make sure you’re tracking users properly and accurately. Your reports need to reflect real data and behaviour, not broken sessions.
- Cross-domain tracking in GA4 ensures accurate user data by recognising the same user across multiple domains or subdomains – without this session data is not accurate.
- The easiest way to set up cross-domain tracking is using Google Tag Manager
- Manually setting it up is possible but not recommended for beginners, as it involves editing your website code and carrying more risk – working with an agency or specialist is advised.
Do you want more tips on how to get the most out of your GA4? Explore our blog for more guides on tracking, tagging and analytics.