How to Set Up Cross-Domain Tracking in Google Analytics

Cross-domain tracking in Google Analytics allows you to track multiple websites as a single entity. This is especially useful for businesses with multiple domains that need to be tracked as a single property. Here’s a step-by-step guide to help you set up cross-domain tracking in Google Analytics:

Step-by-Step Guide to Set Up Cross-Domain Tracking

1. Identify the Domains

First, identify the domains you want to track. For example, if you have a main site at and a blog at, you will need to set up tracking for both.

2. Update the Tracking Code

Update the Google Analytics tracking code on all the domains you want to track. Use the gtag.js or analytics.js code snippet and modify it to include the linker plugin.

For gtag.js:

gtag('config', 'UA-XXXXX-Y', {
  'linker': {
    'domains': ['', '']

For analytics.js:

ga('create', 'UA-XXXXX-Y', 'auto');
ga('require', 'linker');
ga('linker:autoLink', ['', '']);
ga('send', 'pageview');
3. Set Up Referral Exclusions

Navigate to your Google Analytics Admin panel. Under the Property column, click on Tracking Info and then on Referral Exclusion List. Add your domains to this list to prevent them from being counted as referral traffic.

4. Test Your Setup

Use Google Tag Assistant or the Real-Time reports in Google Analytics to test your setup. Navigate between your domains and ensure that the sessions are being tracked correctly as a single user journey.


Let’s say you own a primary website and a secondary website You want to track users who navigate between these two domains as a single session.

1. Identify the domains: and

2. Update the tracking code on both domains to include the linker plugin:

gtag('config', 'UA-XXXXX-Y', {
  'linker': {
    'domains': ['', '']

3. Add both domains to the Referral Exclusion List in Google Analytics.

4. Test the setup by navigating between and and check the Real-Time reports in Google Analytics to ensure proper tracking.

By following these steps, you can successfully set up cross-domain tracking in Google Analytics, allowing you to gain a comprehensive view of user interactions across multiple domains.

Did I miss anything? Add your comments below!