← All Guides

GA4 Cross-Domain Tracking: Keep One Session Across Your Site, Checkout, Booking and Payment Domains

How cross-domain measurement works in GA4 and Google Ads, when you need it, how to configure the domain list and the Conversion Linker, how to handle subdomains, iframes and redirects, and how to verify the linker parameter and attribution.

Atiqul Islam
Written by Atiqul Islam

Tracking & analytics specialist. 278+ GTM, GA4 and server-side tracking projects for clients in the US, UK and Australia.

Rather not do this yourself? I set this up for clients every week. Free 15-minute audit, no obligation.

Book a Free Audit

When a visitor crosses from your site to another domain and back, analytics sees two visitors unless you tell it otherwise. The classic case is a hosted checkout, booking page or payment provider on its own domain. This guide covers how GA4 and Google Ads stitch sessions across domains, exactly what to configure, the cases where it is not possible, and how to verify it.

When You Need It

You do not need it for subdomains of the same root domain.

How It Works

GA4 appends a _gl parameter to links pointing at configured domains. It contains the client ID and session information, plus Google Ads click data when the Conversion Linker is configured for cross-domain. The destination page's GA4 reads the parameter and continues the session instead of starting a new one.

Step 1: Configure GA4

In GA4 Admin, open the web data stream, then Configure tag settings, then Configure your domains. Add every domain the visitor can cross between, including your own. Use the match type contains with the root domain, for example example.com and checkout-provider.com. Save.

This setting is read by the Google tag on every page, so both domains must run the same measurement ID.

Step 2: Configure the Conversion Linker

In GTM, open the Conversion Linker tag, enable Enable linking across domains, and list the same domains. This passes the Google Ads click ID across so a conversion fired on the second domain still attributes to the ad.

If the second domain has its own GTM container rather than yours, its Conversion Linker needs the same configuration.

Step 3: Unwanted Referrals

In GA4, Configure tag settings, then List unwanted referrals, add the other domains. Otherwise a visitor returning from checkout can be attributed to checkout-provider.com as a referral, overriding the original campaign.

Step 4: Install Tags on the Other Domain

Cross-domain only works if GA4 with the same measurement ID runs on both sides. Options:

Step 5: Forms and JavaScript Navigation

The linker decorates standard links automatically. For forms that post to the other domain, enable Decorate forms in the Google tag's configuration. For navigation done in JavaScript, such as window.location.href = checkoutUrl, decorate the URL yourself:

// With the Google tag loaded, request a decorated URL
gtag('get', 'G-XXXXXXX', 'client_id', function () {});
// Simpler: use the linker API if available, otherwise let GTM decorate anchors and avoid JS redirects for cross-domain hops

In practice, the cleanest fix is to make cross-domain hops real anchor links or form posts, which the tag decorates reliably.

GA4 sets its cookie on the highest-level domain by default, so subdomains share sessions with no configuration. If a previous setup forced a cookie domain to a specific subdomain, remove that override.

Iframes

An iframe from another domain is not a navigation, so the linker does not apply. If you control the iframe page, install the same GA4 there and pass the client ID into the iframe URL as a parameter you read on load, or use postMessage from the parent to hand it over. For third-party iframes, see the Iframe Tracking guide.

Verification

  1. On your site, hover a link to the other domain. Click it and check the destination URL for _gl=. If it is missing, the destination domain is not in the list or the link is built with JavaScript.
  2. In GA4 DebugView, follow the session across domains: the same debug device should show page views from both hostnames in one session.
  3. In GA4 Realtime, after returning from the other domain, the session source should still be the original campaign, not the other domain as referral.
  4. For Google Ads, arrive with a test gclid, cross domains, fire a test conversion on the second domain, and after a day confirm it attributes to the campaign in Google Ads.
  5. Check for the _gl parameter on links to domains that should not have it, such as external partners; it should not be there.

Common Problems

Outcome

One session from landing to conversion across every domain in the journey, campaign attribution preserved in GA4 and in Google Ads, and checkout or booking domains no longer appearing as the source of your own sales.

Frequently Asked Questions

Do subdomains need cross-domain tracking?

No. The GA4 cookie is set on the root domain, so shop.example.com and www.example.com share it automatically. Cross-domain configuration is for different root domains, such as example.com to checkout-provider.com.

Why do my conversions show as referral from the checkout domain?

Without cross-domain linking, the visitor arriving back from checkout-provider.com starts a new session with that domain as the referrer. Configure cross-domain for both domains and add the checkout domain to unwanted referrals.

What is the _gl parameter?

It is the linker parameter GA4 appends to links between configured domains. It carries the client ID and the Google Ads click information so the destination domain can continue the same session and attribution. It should appear on the link only when the destination is in your domain list.

Does this work if the other domain is not mine?

Only if the same GA4 measurement ID and GTM container run on that domain, which is the case for some booking and checkout providers that let you add tracking. If you cannot install your tags there, cross-domain cannot stitch the session; use redirects or postMessage patterns instead.

Do I need both GA4 cross-domain and the Conversion Linker setting?

Yes if you run Google Ads. GA4 cross-domain handles the GA4 session; the Conversion Linker's cross-domain option passes the Google Ads click ID so conversions on the second domain attribute to the ad.

Want This Done Right the First Time?

Book a free 15-minute audit call. I'll review your setup, show you what is broken, and tell you exactly what it takes to fix it.

Chat Now