AI & automation
GA4 cross-domain tracking: follow a visit across your sites
Cross-domain measurement passes browser measurement identifiers between related domains. It needs compatible tags, a working linker and consent-aware collection on both sides. Linking the visit goes further than hiding a checkout referral.

The short answer
To set up GA4 cross-domain tracking, use the same Google tag and intended GA4 web stream across the related sites, configure the domains in Google Analytics, and test the real navigation path. A valid _gl linker parameter must reach the destination and be accepted. Verify client and session continuity during a short consented test. Identifiers transfer through the linker rather than referral exclusions, and a checkout provider without tag support stays a documented measurement boundary.
- Cross-domain measurement links one browser's activity across related domains.
- The _gl parameter is added during navigation and must survive redirects until the destination tag can read it.
- Excluding an unwanted referral changes attribution handling; browser identity comes from the linker.
- Respect consent choices and measurement eligibility on both domains.
Start by drawing the actual journey
List each hostname a visitor reaches, from the campaign landing page through booking or checkout and back to confirmation. Mark who controls the code, which Google tag is installed and whether the domain can accept incoming linker parameters. Include redirect hosts as well as the first and last pages.
Cross-domain measurement is useful when one journey spans related root domains, such as an organization's main website and its separately hosted store. Sharing browser identifiers is a separate step from putting two websites in one reporting property. A third-party checkout may support the required integration; a payment-provider domain needs that support before you can tag it.
For subdomains, first inspect the existing cookie and identifier behavior. They may already share the relevant first-party cookie scope. Add a cross-domain workaround once the test shows what needs fixing.
| Boundary | Likely action | Evidence required |
|---|---|---|
| Two related root domains with tagging access | Configure cross-domain measurement | Same intended destination and successful linker acceptance |
| Subdomains of the same root domain | Inspect existing cookie scope first | Client and session continuity on the real path |
| Hosted checkout with supported Analytics integration | Follow the platform's supported integration | Tag support, query preservation and an end-to-end test |
| Payment provider without your tagging access | Document the measurement gap and evaluate referral handling | Return-path test, without claiming visibility inside the provider |
| Unrelated website | Link for a measurement need beyond removing a referral | A valid business and privacy reason before any configuration |
What the linker changes, and what it does not
First-party measurement cookies belong to one root domain. Google's linker decorates a destination URL with a _gl parameter containing encoded measurement information. The destination tag checks the incoming parameter and, when valid and permitted, uses the transferred information for its first-party measurement cookies.
Google documents a two-minute linker expiration and adds the parameter at click time. Test by clicking the original link rather than copying a decorated address from yesterday's debug session. The parameter's presence proves decoration; acceptance is a separate check. A redirect can remove it before the receiving tag runs.
The client identifier represents a browser measurement context. The session identifier represents a session within that context. Both are separate from the order's transaction_id, and neither identifies a known individual. Cross-domain linking works alongside a separately designed authenticated User-ID implementation and stays within one browser, so a phone and a laptop remain separate. A long delay or a new browser can legitimately change the expected result.
Configure the related domains in one place
Confirm the participating pages use the same Google tag and intended GA4 web stream. Different GTM containers can still deploy the relevant Google tag; the shared Google tag is what matters, rather than a shared container ID. Likewise, using one container still calls for checking that its tags send to the right destination on every page.
In the intended web stream's Google tag settings, use the domain-configuration controls to add the related domains. Google recommends the Analytics Admin interface for most GA4 cross-domain setups. Use conditions narrow enough to match the actual destinations, then test them against the real hostnames. List only the related domains rather than every external link on the website.
Check whether an existing in-page linker configuration or Google tag parameter overrides the administrative setting. The developer guide explicitly warns that setting a linker object for URL-position customization overrides the configured domains unless the object includes them. Keep one documented configuration owner rather than competing settings in a plugin and a container.
Follow the GA4 instructions specifically. The same developer page also covers Google Ads Conversion Linker and labels each product's instructions separately.
Run a short, consented identity test
Use an approved test browser profile, grant the relevant analytics consent and begin a new controlled journey on the source domain. Open Tag Assistant and preserve the browser's navigation log. Record the source and destination hostnames, tag destination, client identifier and session identifier. Keep these identifiers out of support screenshots.
Where the site exposes gtag.js, Google's documented get API can retrieve the values: gtag('get', 'G-XXXXXXXXXX', 'client_id', console.log) and the equivalent call with 'session_id'. Replace the example measurement ID with the intended stream. Run after the tag has initialized. For a GTM-only implementation without a global gtag function, use Tag Assistant and the collection-request details rather than installing another tag to make the console example work.
Click the real booking or checkout link promptly. Follow each redirect and verify _gl reaches the receiving page before the tag reads it. Compare the destination's values. For this same-browser, consented journey completed before session timeout, expect the same client_id and session_id, the intended destination, and one page_view per page. Matching identifiers, rather than a tag present on both domains, are the acceptance result.
- Repeat in the reverse direction if customers actually return that way.
- Repeat separately for a form submission, scripted checkout button and ordinary anchor link.
- Check the processed journey and source context later; the identifier test above, rather than a report total, proves continuity.
Debug the first broken handoff
If _gl is never added, check domain matching, tag initialization and how the navigation happens. A script that changes location or a form submission can behave differently from a normal link click. Google documents decorate_forms for gtag.js and notes that GA4 tags in GTM do not expose that control, so test the supported implementation for forms; the Ads Conversion Linker checkbox is a separate product setting.
If _gl disappears, inspect the redirect that removed it. Have the website or checkout owner preserve required parameters until the receiving tag can process them. If it arrives but identifiers change, inspect tag destination, incoming-linker settings, expiration and consent before changing attribution settings.
Let Google's linker build the linker URLs and read its own cookie format, and keep campaign parameters off internal checkout links. That keeps your test on the same measurement path real visitors use and shows the original problem clearly.
Keep consent and referral handling separate
A linker carries measurement information; consent comes from the visitor. The destination applies the visitor's valid choices through the site's consent solution, separately from _gl. Test rejection and later withdrawal on both domains, including different consent-banner configurations.
With analytics_storage denied, supported tags leave analytics cookies unread and unwritten. Basic consent mode blocks Google tags without consent; advanced mode can send cookieless measurements. These pings and modeled reporting are separate from persistent browser identity continuity, so let a denied-state test show denied-state behavior.
An unwanted-referral rule tells Analytics to handle a matching referrer differently from a normal referral. Google's documentation describes adding ignore_referrer=true to matching events. That can be relevant when someone returns from a payment provider. Passing a client ID, tagging the provider's pages and recovering missing checkout steps are separate tasks, so test source continuity and identity separately.
Worked example: fixing identity after a referral rule
Illustrative scenario: one tester moves from a service site to a separately hosted booking site in the same browser within one minute. Both sites are intended to use the same GA4 stream. Before repair, the booking site has a different client identifier. Adding an unwanted-referral rule removes an unwanted label while the identifiers stay different.
Inspection finds a redirect discarding _gl. After that redirect preserves the parameter and the destination accepts it, a new consented test keeps the same client and session identifiers. This is evidence for the tested path; historical visitors keep their original identifiers.
The signed-off record contains both hostnames, the redirect sequence, consent state, expected identifiers and the date of the successful test, and describes the measurement repair on its own terms rather than as a marketing improvement.
Questions before you start
Can this work when I cannot install a tag on checkout?
Yes, when the checkout provider offers a supported integration that supplies the necessary measurement behavior; that integration, rather than adding its domain in GA4, provides the capability. Otherwise, document the measurement gap, verify the return path and reconcile completed orders using the store's records. Server-side events can supplement collection with their own identity and consent design, while the browser journey inside the provider stays outside your view.
Does cross-domain tracking repair historical sessions?
It applies to future eligible journeys from the release date onward, and old browser identifiers stay as they were. Annotate the release date in your reporting notes and account for the instrumentation change before reading a change in user or session counts as a business result. GLCO can help map the website, booking and checkout handoffs when several owners need to coordinate the repair.
Sources and further reading
- Google: cross-domain measurement developer guide
- Google tag API reference
- Google: consent mode overview
- Google: identify unwanted referrals
- Google: Measurement Protocol overview
- Google: linker behavior and expiration
- Google: retrieving client_id and session_id
- Google: GA4 configuration recommendation and linker options
- Google: incoming links and form decoration
Make this useful for my team.
Bring the question you want your reports to answer. We can look at the data, website or sales workflow and scope a practical next step. We reply within one business day.

