Last updated: 2 January 2025

Cross-domain tracking in GA4

Nick van Maaren
Freelance Ads & Analytics expert

Cross-domain tracking enables you to measure visitor behavior across different domains. Activities on various domains are linked back to a single user, allowing you to gain better insight into the actual number of visitors and track their journey more effectively. This provides a clearer view of the customer journey.

When is cross-domain tracking useful?

When cross-domain tracking is NOT needed:

  • For subdomains (you don’t need cross-domain tracking for these). Learn more about subdomain tracking in my previous article.
  • For domains that don’t link to each other. If you have different domains that are unrelated, cross-domain tracking is not relevant.

When cross-domain tracking is useful:

  • For domains you own and manage that link to each other.

Setting up cross-domain tracking

To enable cross-domain tracking, you need to use the same Google Analytics tracking ID across all domains. However, that alone isn’t sufficient. Without proper configuration, the unique visitor ID won’t be passed between domains. Follow these steps to set up cross-domain tracking:

  • Go to Google Analytics: Navigate to Admin > Data Streams.
  • Select the stream for which you want to configure cross-domain tracking.
  • Click Configure Tag Settings.
  • In the Settings block, click Show All.
  • Select Configure Your Domains.
  • Click Add Condition.
  • Choose the desired match type (e.g., Contains).
  • Enter the domain name under Domain (e.g., example.nl).
  • Repeat for all other domains.

You don’t need to make any additional changes in the settings, including referral exclusions.

Identifying / segmenting traffic per domain

You can identify or segment traffic across different domains using the hostname dimension. You can create reports in Google Analytics 4 to visualize the data or utilize these insights in Looker Studio. If redirects are in place, they can overwrite parameters. Verify that the _gl parameter remains intact on the new domain and isn’t removed by the redirect.

Testing your new cross-domain setup

Test the configuration using the preview function in Google Tag Manager and the Debug View in Google Analytics 4. Once everything is correctly configured, don’t forget to publish the changes. When set up correctly, a _gl parameter will automatically be added to the URL when navigating between domains.

Join the community

Level up your analytics skills in our free Discord community.

Join MeasureBase
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.