You send a user from domain-a.com to domain-b.com. In GA4, this shows as a new session from direct traffic, breaking attribution and inflating your session count. Cross-domain tracking problems are among the most common GA4 configuration errors. Learn more in our guide on GA4 Event Count Discrepancy.

Cross-Domain Tracking GA4

Why Cross-Domain Breaks in GA4

GA4 stores user identity in a first-party cookie tied to the current domain. When a user moves to a new domain, GA4 starts a fresh session and the original traffic source is lost. Learn more in our guide on GTM Server-Side Latency.

GA4 Built-In Cross-Domain Solution

GA4 appends a _gl parameter to cross-domain links encoding user identity. Configure in Admin → Data Streams → Configure tag settings → Configure your domains. Add all domains that should share sessions.

Subdomains vs True Cross-Domain

Subdomains share the _ga cookie naturally set on .example.com. True cross-domain (example.com to checkout.otherdomain.com) requires explicit cross-domain configuration with the _gl parameter.

UTM Parameters and Cross-Domain Conflicts

Don’t add UTM parameters to cross-domain links — this creates a new session and loses original attribution. Use GA4’s _gl decoration for continuity. Only add UTMs when you intentionally want new attribution.

Guide Cross-Domain GA4

How the _gl Parameter Works

The _gl parameter encodes client ID and session data so the destination domain initializes GA4 with the same identity. It expires after 60 seconds by design.

Common Cross-Domain Failures

  • Form POST submissions: Strip _gl parameter. Use hidden fields or server-side session passing instead.
  • JavaScript redirects: window.location redirects don’t get _gl decoration. Add manually before redirecting.
  • iFrames: Pass client ID via postMessage and initialize GA4 inside the iFrame separately.
  • Domain not listed: Only links to configured domains get decorated. Check all domains are listed.

Verifying Cross-Domain Tracking Works

  • Click a cross-domain link and verify the destination URL contains _gl= parameter
  • In GA4 DebugView, confirm the session continues on the destination with the same client ID
  • Check that session source/medium on the destination matches the original traffic source
  • Verify user count doesn’t double when navigating between domains

Cross-domain tracking requires both domains to use the same GA4 measurement ID. If each domain uses a different property, you can only pass context via UTM parameters.

Leave a Comment