When Cross-Domain Tracking Is Needed
Cross-domain tracking in GA4 is required when your users move between multiple domains during a single journey and you want to count this as one continuous session. Common scenarios:
- Main site on yourbrand.com, checkout on checkout.yourbrand.com (actually a subdomain — handled differently)
- Main site on yourbrand.com, checkout on yourbrand.checkoutplatform.com (third-party checkout)
- Corporate site on yourbrand.com, blog on yourbrand.blog.com
- UK and international sites on different ccTLDs (yourbrand.co.uk and yourbrand.de)
Without cross-domain tracking, a user who moves from yourbrand.com to checkout.platform.com will be counted as two separate users — and the checkout domain referral appears as the source of the conversion, hiding the actual acquisition channel.
How Cross-Domain Tracking Works
GA4 cross-domain tracking works by appending a URL parameter (_gl) to links between domains. This parameter carries the user's GA4 client ID and session information to the destination domain, where GA4 reads it and continues the session without creating a new user or session.
Setup: Google Tag Configuration
- In GTM: find your Google Tag (the GA4 configuration tag)
- Click the tag to edit
- Expand "Configuration settings"
- Add a configuration parameter:
- Parameter name:
linker - Value: Create a variable or enter the domains to link as a JSON object
- Parameter name:
Alternatively, configure cross-domain in GA4 directly:
- Admin then Data Streams then your web stream
- Configure tag settings
- Configure your domains
- Add each destination domain that your users cross to
Subdomain Handling (Different from Cross-Domain)
Subdomains (checkout.yourbrand.com, shop.yourbrand.com) on the same root domain do not need cross-domain tracking — they share cookies via the root domain cookie. What they DO need is referral exclusion: add checkout.yourbrand.com to your referral exclusion list so GA4 does not count the subdomain as a referral source and create a false session break.
Common Pitfalls
1. Setting up cross-domain but not referral exclusion: If yourbrand.com is configured for cross-domain linking with platform.com, you must also add platform.com to your referral exclusion list. Otherwise, GA4 still creates a new session when the user returns from platform.com back to your main site.
2. Using different GA4 Measurement IDs on the domains: Cross-domain tracking requires the same Measurement ID on all domains. If yourbrand.com uses G-AAAA and your checkout uses G-BBBB, the client_id cannot be shared between them. Both domains must use the same GA4 property.
3. Not testing the _gl parameter: After setup, click a link from yourbrand.com to your checkout domain in a browser. Inspect the URL — it should contain a _gl= parameter. If this parameter is missing, the cross-domain link is not passing correctly.
4. CSP (Content Security Policy) blocking: Some strict CSPs prevent GA4 from reading URL parameters or setting cookies. If cross-domain tracking is configured but not working, check your CSP headers.
Verifying Cross-Domain Tracking Works
- Enable GA4 DebugView on your main site
- Navigate to your cross-domain destination (clicking through from the main site)
- Enable DebugView on the destination domain
- Confirm the same
debug_idappears in both DebugViews — this confirms the session was carried across domains
Summary
Cross-domain tracking in GA4 ensures multi-domain user journeys are counted as continuous sessions. Configure domain linking in the Google Tag, add referral exclusions for all linked domains, use the same Measurement ID across all domains, and verify with the _gl parameter inspection. Without it, your checkout or third-party domain shows as the acquisition source for all conversions.
See our GA4 Setup & Audit service for cross-domain configuration.
Sessions breaking at domain boundaries? Contact Adslytics.
Need expert tracking setup?
Our Google Tag Manager experts have delivered 500+ tracking setups with a 98% success rate.
Get a Free Consultation →