Launch Offer2 free audits with all 229 checks. No credit card required.Start free audit

GA4 Cross-Domain Tracking: The Complete Setup Guide (2026)

Intermediate

When do I need GA4 cross-domain tracking?

Cross-domain tracking is needed when a single user journey spans two or more different registered domains and you want GA4 to treat them as a continuous session rather than separate sessions. Common scenarios requiring it: (1) Separate checkout domain — main site at yourdomain.com and checkout at checkout.yourdomain.com (note: subdomains do NOT need cross-domain tracking — they share the GA4 cookie automatically; only different registered domains need it); (2) Third-party checkout — Shopify site at yourshop.com redirects to yourshop.myshopify.com for checkout; (3) Embedded booking tool — main site embeds a booking widget that opens in a new domain (e.g., book.example-hotel.com); (4) Multi-brand property — single GA4 property tracks brand1.com and brand2.com together. The symptom of missing cross-domain tracking: the second domain shows high Direct traffic and incorrectly inflated new user counts, because each arrival from the first domain looks like a new session.

The two configuration steps

Step 1 — Configure your domains in GA4 data stream settings

Where: Admin → Data Streams → select your web stream → Configure tag settings → More settings → Configure your domains

Add all domains that should be part of the same user journey:

  • yourdomain.com
  • checkoutdomain.com
  • Any other domain that users traverse

What this does: Tells GA4's tag to look for the _gl linker parameter when a user arrives from a listed domain, and to write it to the GA4 cookie rather than starting a new session.

Step 2 — Ensure GA4 tag is present on ALL domains

Every domain in the cross-domain configuration must have the GA4 tag (with the same G-XXXXXXXX Measurement ID) installed. If the second domain doesn't have GA4 installed, cross-domain tracking cannot work regardless of configuration.

Same Measurement ID: All domains must use the same GA4 Measurement ID (G-XXXXXXXX). Using different Measurement IDs on different domains means they're tracking separate properties — cross-domain linking doesn't apply.

How the linker parameter works

When a user clicks a link from yourdomain.com to checkoutdomain.com, GA4 automatically appends a _gl parameter to the URL:

The _gl parameter encodes the user's current GA4 client_id. When GA4 loads on checkoutdomain.com, it reads the _gl parameter and sets the _ga cookie to the same client_id that was active on the first domain. This makes GA4 treat the user as the same person continuing the same session.

Important: This only works for link clicks. If the user navigates via:

  • Redirect (302 redirect from domain A to domain B) — linker parameter may not be appended
  • JavaScript window.location redirect — linker may not be appended
  • Form POST to a different domain — linker is not appended to POST requests

For redirects and form POSTs, additional configuration is needed (see below).

Handling form POST cross-domain (checkout forms)

For e-commerce checkouts that POST to a different domain:

Want to see which hidden implementation gaps are affecting your GA4 data quality?

Method 1 — Decorate the form action URL GA4's tag can be configured to decorate both link clicks and form submissions:

In GTM → GA4 Configuration tag → Fields to set:

  • Field name: linker_param — this exposes the linker parameter as a JavaScript variable you can append to form action URLs

Or use GTM's "Cross-domain measurement" built-in in the GA4 Configuration tag:

  • Tag configuration → Advanced settings → Cross-domain measurement → select "Decorate forms"

Method 2 — Use a redirect approach that preserves the _gl parameter Configure your redirect to preserve query parameters: instead of redirecting to https://checkoutdomain.com/checkout, redirect to https://checkoutdomain.com/checkout?_gl={{gl_value}} with the linker value included.

Configuring referral exclusions for cross-domain

Without referral exclusions, when a user returns from checkoutdomain.com back to yourdomain.com, GA4 sees a referral from checkoutdomain.com and starts a new session (attributing the return visit to the checkout domain as a referrer).

Fix: Add the checkout domain to the referral exclusion list.

Admin → Data Streams → Web stream → More tagging settings → Configure your domains (the same place as step 1)

Adding a domain to "Configure your domains" automatically excludes it from referral tracking. You do not need to separately add it to a referral exclusion list — the domains list serves double duty.

Verifying cross-domain tracking is working

Method 1 — Check Direct traffic on checkout domain

Before cross-domain setup: checkout domain shows 40–60% Direct traffic (users arriving from the main site all appear as Direct).

After cross-domain setup: Direct traffic on checkout domain should drop significantly. Remaining Direct will be genuine direct navigation (bookmarked checkout URLs, returning customers).

Method 2 — Inspect the _gl parameter in URLs

Browse your main site, hover over a link to the checkout domain (or click it and check the URL in the browser). The URL should contain ?_gl= parameter.

If _gl is absent: cross-domain configuration isn't applied to that link. Check that both domains are listed in "Configure your domains."

Method 3 — GTM Preview Mode + Network requests

In GTM Preview Mode: navigate from main site to checkout domain. Check the GA4 hit on the checkout domain's page view — the cid (client_id) should match the cid from the main site's hits.

FAQ: GA4 Cross-Domain Tracking: The Complete Setup Guide

What should a team validate first when ga4 cross-domain tracking: the complete setup guide appears?

Reproduce the problem in the live implementation, isolate whether it is scoped to one report or flow, and compare it against at least one secondary source before changing the setup.

How do I know whether the fix actually worked?

You need before-and-after evidence in the browser and in the downstream report. A clean-looking dashboard without validation is not enough.

When should this become a full GA4 audit instead of a quick fix?

If the issue touches attribution, consent, revenue, campaign quality, or data trust for more than one workflow, it is usually safer to audit the surrounding implementation than patch only the visible symptom.

Run a GA4 audit before ga4 cross-domain tracking: the complete setup guide spreads into reporting decisions

Use GA4 Audits to surface implementation gaps, broken signals, and the next fixes to prioritize before the issue becomes harder to trust or explain.

These findings come from auditing thousands of GA4 properties. See how your property compares

GA4 Audits Team

GA4 Audits Team

Analytics Engineering

Specialising in GA4 architecture, consent mode implementation, and multi-layer audit frameworks.

Share