Cross-domain tracking in GA4 lets you measure a single user session as they move between two or more unrelated domains, such as your main site and a separate checkout or booking domain. Without it, Google Analytics starts a new session and mislabels the handoff as a referral, breaking attribution.

Key Takeaways

  • Cross-domain tracking is only required when users move between two distinct root domains, not between subdomains of the same domain.
  • GA4 passes identity through a short-lived _gl linker parameter appended to destination URLs; any redirect that drops query strings breaks it.
  • Self-referrals appear when a destination domain is missing from your configured list, when _gl is stripped, or when payment gateways are not excluded.
  • Verify with DebugView, the realtime report, and a manual click that checks for _gl in the destination URL.
  • Google Tag Manager uses the same linker but deploys it through a Cross-Domain Linker tag rather than the GA4 interface.

What Is Cross-Domain Tracking in GA4?

Cross-domain tracking is the configuration that tells GA4 to treat visits across two or more separate domains as one continuous session for the same user. GA4 identifies users with a client ID stored in the first-party _ga cookie. Cookies are scoped to a single domain by default, so when a visitor clicks from store.com to checkout.com the browser cannot read the original cookie. GA4 solves this by encoding the client ID and session ID into a _gl parameter in the destination URL, then writing a matching cookie on the second domain. The result is one user, one session, and accurate source and medium data across the boundary. This matters most for funnels that span an owned site and a separate application, booking engine, or payment domain where conversions actually happen.

When Do You Need Cross-Domain Tracking and When Do You Not?

The most common mistake is configuring cross-domain tracking where it is unnecessary, which can itself create duplicate sessions. Use the table below to decide. The rule of thumb: if the two pages share the same root domain, the browser already shares the cookie and no cross-domain config is needed. If the root domains differ, you need the linker. Referral exclusion is a separate setting that prevents a domain from being credited as a source; it is required for third-party checkouts that redirect back to you.

ScenarioExampleCross-domain config required?Referral exclusion required?
Same site/home to /pricing on one domainNoNo
Subdomainwww.store.com to shop.store.comNoNo
Separate domainstore.com to checkout.comYesYes, list the destination
Third-party checkoutstore.com to paypal.com back to store.comNo (you do not own it)Yes, exclude the gateway

How Does the GA4 Linker Parameter Work?

The linker is the engine behind cross-domain tracking. When GA4 is loaded on the source domain, it generates a _gl query parameter and decorates every eligible outbound link with it. The parameter is URL-encoded and contains the GA4 measurement ID, the client ID, and the session ID. When the visitor lands on the destination domain, GA4 reads _gl from the URL, extracts the client and session IDs, and writes them into a fresh _ga cookie on that domain. From that point the two domains share one identity.

The _gl parameter is deliberately short-lived. GA4 removes it from the URL after it is consumed, and the data inside it is only valid for the immediate handoff, not for reusing later. The fragility is the key production lesson: because the identity travels in the URL query string, anything that rewrites or strips query strings destroys the link. Server-side 301 or 302 redirects that do not preserve the query string, link shorteners, some content security proxies, and JavaScript that rebuilds hrefs can all drop _gl. If the parameter never reaches the second domain, that domain starts a brand-new session and your source becomes a self-referral.

How Do You Set Up Cross-Domain Tracking in GA4 Step by Step?

The native GA4 interface handles the linker without any code. Follow this sequence exactly, then verify before trusting the data.

  1. Open Admin and select the relevant GA4 property.
  2. Under Data Streams, choose the web data stream for your source domain.
  3. Click "Configure tag settings" at the bottom of the stream details.
  4. Select "Configure your domains" under the cross-domain tracking section.
  5. Add each destination domain, choosing a match type: "Exact match" for a single host, or "Starts with" / "Contains" if you manage many subdomains or international domains.
  6. Save the setting and repeat the same configuration on the destination domain's stream if it is also a GA4 web stream you control.
  7. Wait a few minutes, then test by clicking a cross-domain link and confirming _gl appears in the destination URL.
  8. Confirm in DebugView that the page_view on the second domain carries the same client ID as the first.

Match-type rules deserve care. "Exact match" only covers the precise host you type, so www.store.com and store.com are treated as different entries. "Contains" is convenient but can over-match unintended domains, so prefer "Starts with" with a clear prefix when you span many properties. After setup, revisit the distinction between cross-domain config and event tracking in GA4 so you do not conflate identity linking with conversion measurement.

How Do You Configure It in Google Tag Manager?

If you deploy GA4 through Google Tag Manager, you do not use the interface toggle above. Instead, GTM manages the linker. Create a new tag of type "Google Tag" or use your existing GA4 Configuration tag and enable the built-in cross-domain linker setting, listing the destination domains. Then add a "Cross-Domain Linker" tag configured with the same domain list and fire it on all pages. GTM automatically decorates links and form posts to those domains with _gl. The destination domain still needs its own GA4 tag firing and, if it is also in GTM, the same linker list so the return trip is covered. A frequent failure is deploying the linker on the source only; the second domain must be able to read _gl, which it does automatically as long as its GA4 tag loads. When you report on the combined funnel, pair this setup with GA4 marketing reporting to see the stitched journey.

Why Are You Still Seeing Self-Referrals After Setup?

Self-referrals - your own domain showing up as the session source - are the classic symptom that the linker failed. Work through these causes in order:

  • An unlisted domain: the destination is not in your configured list, so GA4 treats the landing as a fresh referral. Add it.
  • A stripped _gl: a redirect, shortener, or proxy removed the query string before it reached the second domain. Preserve query strings end to end.
  • POST-based redirects: the linker decorates GET links and forms, but a server-side POST that bounces the user without the parameter loses identity. Use a GET redirect or pass the value through.
  • Iframes: traffic inside a cross-origin iframe cannot read or write the parent cookie, so the linker cannot bridge it. Handle iframes with server-side identity passing.
  • Mismatched match type: "Exact match" missing the www or non-www variant means some links are never decorated.
  • Consent banner blocking the tag: if the second domain's GA4 tag is suppressed by consent until interaction, the first page_view after the handoff may fire without reading _gl. Load the tag early enough or grant measurement consent by default.

Each of these breaks the same link, and the fix is always to ensure _gl is generated, preserved, and read on the destination. For paid traffic specifically, also review gclid tracking so ad clicks are not double-counted alongside your referral fixes.

How Do You Verify Cross-Domain Tracking Is Working?

Do not assume the interface toggle means data is correct. Verify with four checks. First, click a cross-domain link in a real browser with the GA4 DebugView open and watch for _gl in the destination URL the instant you land. Second, open DebugView and compare the client ID on the source page_view to the one on the destination page_view; they must match. Third, use the realtime report and walk the funnel yourself, confirming a single active user moves across both domains rather than two. Fourth, run a session-count sanity check: pick a day, compare users to sessions; a healthy cross-domain setup keeps sessions close to users for users who cross the boundary, whereas broken setups show sessions far exceeding users because every handoff spawns a new session.

How Does Cross-Domain Tracking Affect Attribution and Conversions?

When the linker works, the original acquisition source and medium survive the domain change, so the conversion that completes on the checkout domain is credited to the campaign that started it. When it fails, the second domain reports a self-referral, the true source is overwritten, and attribution models undervalue top-of-funnel channels. Conversions measured only on the destination domain are still recorded, but the path that produced them is lost, which corrupts data-driven attribution and any report that depends on session source. Fixing cross-domain tracking is therefore less about counting hits and more about preserving the story of how the user arrived, which is the input every attribution model relies on.

Frequently Asked Questions

Do Subdomains Need Cross-Domain Tracking in GA4?

No. Subdomains such as www.store.com and shop.store.com share the same root domain, so the browser reuses the same first-party _ga cookie automatically. GA4 already stitches these sessions without any cross-domain configuration. Adding the linker between subdomains can create duplicate cookies and false sessions, so leave subdomains out of your domain list and reserve cross-domain tracking for truly separate root domains only.

What Is the _Gl Parameter?

The _gl parameter is the short-lived query string GA4 appends to cross-domain links. It carries the measurement ID, the client ID, and the session ID in encoded form. The destination domain reads it, writes a matching cookie, and continues the same session. Because it lives in the URL, any redirect or tool that strips query strings removes it and breaks the handoff, which is why preserving the full URL is essential for reliable cross-domain tracking.

Why Does GA4 Show My Own Domain as a Referral?

GA4 labels a domain as a referral when a session starts with no campaign or source data and the entry came from another domain. If your own checkout or application domain is not in the cross-domain list, or its _gl parameter was stripped, the landing looks like a new visit from your own site. Add the domain to your configured list and referral exclusion list, and confirm the linker parameter reaches the destination intact.

Does Cross-Domain Tracking Work with Server-Side Tagging?

Yes, but the linker still runs in the browser. Server-side tagging changes where the GA4 request is sent, not how identity crosses domains. The source page must still decorate links with _gl, and the destination must still read it to set the cookie before sending to your server-side endpoint. As long as the client-side linker fires, server-side containers process the stitched session exactly like a standard GA4 setup would.