Cross-Domain Tracking in GA4: How It Works

Cross-domain tracking in GA4 stops a visitor's session from breaking apart when they move between two domains you own — say, a marketing site on example.com and a checkout on shop.example.com. Without it, GA4 sees the domain change as a new visitor arriving from a referral, splitting one continuous visit into two disconnected sessions. It's configured in the data stream settings under Configure tag settings > Domains, and relies on a _gl query parameter GA4 appends to outbound links between the configured domains.

Why sessions break across domains

GA4 (like every analytics tool relying on browser storage) ties a visitor's identity to the domain they're on. Move that same visitor from example.com to a second domain, like checkout.example-payments.com, and the browser treats it as a different site — GA4 has no built-in way to know it's the same person continuing the same visit.

Left unconfigured, that domain switch shows up two ways: a new session starts on the second domain, and the first domain often appears as the referral source for that new session — your own marketing site referring traffic to your own checkout, when really it was one uninterrupted visit.

How to configure it

In GA4, go to Admin > Data Streams > [your web stream] > Configure tag settings > Domains (sometimes listed as "Configure your domains"). Add every domain that's part of the same user journey — your main site, checkout, help center, app subdomain — anything a visitor might cross during one continuous visit.

Once configured, GA4 automatically appends a linking parameter to outbound links between the listed domains, and reads that parameter back in on the receiving domain to reconnect the session instead of starting a fresh one.

The _gl linker parameter

The mechanism behind cross-domain tracking is a URL parameter called _gl, which GA4's tag automatically attaches to links pointing at your other configured domains. It carries the identifiers GA4 needs to recognize the incoming visit on the second domain as a continuation of the session that started on the first.

This is why cross-domain links sometimes look messy with an extra query string tacked on — that's the _gl parameter doing its job. It's meant to be read and stripped by the destination page's GA4 tag, not something you need to manually construct, as long as both domains are correctly listed in the data stream's domain configuration.

Track multiple sites without linker config

FAQ

What is cross-domain tracking in GA4?
It's a configuration that keeps a visitor's session intact when they move between two or more domains you own, instead of GA4 treating the domain switch as a new visitor from a referral source.
How do you set up cross-domain tracking in GA4?
In Admin > Data Streams > [your stream] > Configure tag settings > Domains, add every domain that's part of the same visitor journey. GA4 handles the linking automatically once the domains are listed.
What is the _gl parameter in GA4?
It's a linker parameter GA4 automatically appends to outbound links between your configured domains, carrying the identifiers needed to reconnect a session on the destination domain instead of starting a new one.
What happens if cross-domain tracking isn't configured?
A visitor moving between your own domains gets counted as a new session, and the originating domain often shows up as a referral source for that new session, fragmenting what was really one continuous visit.

If you're here because GA4 is confusing — that's why we built Gizmo.

A dead-simple, cookieless Google Analytics alternative. Free forever, 10k events/mo.

Related terms