Cross-domain tracking and the linker
Cross-domain tracking keeps a single session intact when a user moves between two domains you own — for example a marketing site and a separate checkout domain. GA4 does this with a linker that appends the client id to outbound links as a URL parameter (_gl), so the destination domain recognises the same user. Without it, the second domain starts a fresh session and attribution breaks.
What this means
Because analytics identity is stored per-domain in first-party storage, a user crossing from domain-a.com to domain-b.com would normally look like two different users in two sessions. Cross-domain tracking solves this: GA4's linker appends the client id (and related fields) to qualifying outbound links as a _gl URL parameter, which the destination domain reads to continue the same session and user.
Configuration and its limits
You configure cross-domain linking by listing the domains involved so the tag knows which links to decorate. Done right, a journey across your domains stays one session and attribution is preserved; done wrong, the destination domain logs a self-referral and restarts the session. It only applies to domains you control and configure — it is not, and must not be used as, a way to follow users across sites you do not own.
- Linker appends client id to links as _gl
- Keeps one session across your own domains
- Misconfiguration causes self-referrals and split sessions
How it appears in analytics and logs
A self-referral from your own second domain, or a sudden session restart at a domain boundary, usually means cross-domain linking is not configured for that domain.
Diagnostic use case
Keep one session across two of your own domains by configuring cross-domain linking, so a journey that spans domains is not split into two sessions.
What WebmasterID can help detect
WebmasterID's multi-site model keeps each site's first-party data distinct; cross-domain linking is a GA-specific mechanism for stitching your own domains.
Common mistakes
- Forgetting to list a domain, causing self-referrals.
- Expecting cross-domain linking to work on domains you don't own.
- Stripping the _gl parameter before the destination reads it.
Privacy and accuracy notes
The linker passes a first-party client id between your own domains, not across third parties. It is session continuity for sites you control, not cross-site tracking of strangers. This is educational, not legal advice.
Related pages
- The session_start event
The session_start event marks the beginning of a visit. In GA4 it is fired automatically the first time a user is active in a new session, and it underpins every session-scoped metric. Understanding when a session begins — and the timeout that ends it — explains why session counts behave the way they do across midnight, campaigns, and idle periods.
- gtag.js vs Google Tag Manager events
There are two common ways to send events to GA4: gtag.js, where you call the gtag() function directly in code, and Google Tag Manager (GTM), where tags fire based on triggers reading a data layer. They reach the same destination but differ in who controls firing and how events are defined. Choosing between them is about workflow and governance — not about privacy, which applies equally to both.
- Self-referral and internal referrers
A self-referral happens when your own domain shows up as the referrer for a visit, which usually means a session broke and restarted mid-journey. Common causes include cross-subdomain navigation, redirect chains, and third-party payment or auth hops that return to your site. The fix is to exclude your own domains so internal navigation is not counted as a new source.
- Attribution analytics
Preserve journeys across your own domains.
Sources and verification notes
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.