What is Cross Domain Tracking and Why You Need It

A Comprehensive Guide to Cross Domain Tracking in Google Analytics 4 for a Comprehensive Website Understanding

If you have a website that spans across multiple domains, such as a main site and a separate shopping cart or booking site, you might want to track how users interact with your site as a whole, not just as separate parts. This is where Cross Domain Tracking comes in handy.


What is Cross Domain Tracking

Cross Domain Tracking is a technique that allows Google Analytics to recognize a single user as they navigate from one domain to another, and attribute their activity to a single session and source. This way, you can get a more accurate picture of your user behavior, conversion paths, and attribution models.

Without Cross Domain Tracking, Google Analytics would treat each domain as a separate entity, and create new cookies and sessions for each domain a user visits. This would result in inflated user and session counts, inaccurate bounce rates, and broken referral paths.

For example, let’s say a user lands on your main site (example.com) from a Google search, and then clicks on a link to your shopping cart site (cart.example.com) to make a purchase. Without Cross Domain Tracking, Google Analytics would count this as two separate users, two separate sessions, and two separate sources (organic and referral). With Cross Domain Tracking, Google Analytics would count this as one user, one session, and one source (organic).


How Cross Domain Tracking Works

Cross Domain Tracking works by passing a cookie value from one domain to another via a URL parameter. The cookie value contains a unique identifier for each user and session. Google Analytics uses this value to link the user’s activity across domains.

The URL parameter that carries the cookie value is called _gl. It is automatically added to the links and forms that lead to another domain, as long as you have configured Cross Domain Tracking correctly. You don’t need to manually add or modify this parameter.

For example, if a user clicks on a link from example.com to cart.example.com, the link would look something like this:


The _gl parameter contains the encoded cookie value, which includes the user ID (_ga) and the stream ID (_ga_1234567890). Google Analytics decodes this value and uses it to identify the user and the session on the second domain.


How to Set Up Cross Domain Tracking

For setting up cross domain tracking in GA4 you don’t need to modify any code or tags, you just need to configure it in the Admin page of your Google Analytics 4 property.

Here are the steps to set up Cross Domain Tracking in Google Analytics 4:

  1. 1. Make sure you have the same Google tag (with the same G- ID) on every domain that you want to include in Cross Domain Tracking. You can use Google Tag Manager or any other method to install the tag.
  2. 2. In Google Analytics, go to Admin, and under Data collection and modification, click Data streams.
  3. 3. Click Web, then click the web data stream that you want to configure.
  4. 4. In the web stream details, click Configure tag settings (at the bottom).
  5. 5. In the Settings section, click Configure your domains.
  6. 6. If you use the same Google tag across domains, they are automatically detected and show up in the Recommendations section. You can click Add to include them in Cross Domain Tracking. Alternatively, you can manually enter the domains in the Manual input section. You don’t need to include subdomains, as they are automatically included with the root domain.
  7. 7. Click Save.

That’s it! You have successfully set up Cross Domain Tracking for your Google Analytics 4 property. You can test it by using the Realtime report or the DebugView tool in Google Analytics, and see if the user and session IDs are consistent across domains.



Cross Domain Tracking is a powerful feature that allows you to track user behavior across multiple domains as a single entity. It helps you to get more accurate and meaningful data in Google Analytics, and optimize your website performance and marketing campaigns.

If you have a website that spans across multiple domains, you should definitely set up Cross Domain Tracking in Google Analytics 4. If instead you have a network of indipendent sites, consider trying Publytics. This tool allows you to monitor in real-time all of your websites activity in a unified dashboard.

Posted: 3 weeks ago
Author: Info Publytics