Free SEO audit for new clients — claim yours
Home/Blog/Analytics/Cross-Domain Tracking in GA4: Follow Users Acros…
Analytics

Cross-Domain Tracking in GA4: Follow Users Across Sites

Cross-Domain Tracking in GA4: Follow Users Across Sites
Table of contents
  1. Which domain setups actually need cross-domain measurement
  2. What happens to the _ga cookie when someone crosses domains
  3. Configuring your domains in GA4, step by step
  4. Booking engines, payment gateways and checkout platforms
    1. Vendors that accept your tag
    2. Vendors that don't
    3. Iframes
  5. When the _gl parameter disappears
  6. Testing cross-domain tracking end to end
  7. Cleaning up self-referrals and broken attribution afterwards
  8. Worked example: a hotel with a separate booking engine
  9. Questions about GA4 cross-domain tracking
    1. Do I need cross-domain tracking for subdomains?
    2. Can I use cross-domain tracking with two different GA4 properties?
    3. Why does my payment provider still show as a referral?
    4. Will cross-domain tracking fix my past data?
    5. Does cross-domain tracking work inside iframes?
  10. Checking your own cross-domain journeys this week
  11. Further reading on GA4 cross-domain tracking
  12. Sources for this GA4 cross-domain tracking guide

A visitor clicks your Google ad, reads three pages on yourbrand.com, then clicks "Book now" and lands on yourbrand-bookings.com, where they pay. In GA4, the booking is credited to Referral from your own main site. The Google Ads campaign that paid for the click gets nothing, and the session count doubles because one visit became two.

That is what happens whenever a customer journey crosses from one domain to another without cross-domain measurement. It is common for hotels and clinics with separate booking engines, ecommerce brands with a checkout on another domain, SaaS companies with a marketing site and an app on different domains, and any business that runs several brand sites with a shared basket.

This guide explains when you actually need cross-domain tracking (and when you don't), how GA4 stitches sessions together, the exact admin settings, what to do with third-party booking and payment tools you can't tag, how to test the setup properly and how to clean up the self-referrals it leaves behind.

Which domain setups actually need cross-domain measurement

Cross-domain measurement solves one specific problem: the same person moving between different registrable domains that you control and can tag with the same GA4 property. It is not the right fix for every referral problem, and setting it up where it isn't needed adds noise.

Your setupCross-domain needed?What to do instead or as well
www.brand.com and shop.brand.comUsually noUse the same tag ID on both; GA4's default cookie settings share the cookie across subdomains
brand.com and brand-booking.com, both editableYesConfigure both domains in the web stream's tag settings
brand.co.uk and brand.com regional sites with a shared checkoutYes, if users move between themConfigure all regional domains; decide whether one property or several suits your reporting
Hosted payment page (card processor, PayPal-style redirect)No, you can't tag itList the processor as an unwanted referral
Third-party booking engine that lets you add a GA4 tagYesAdd your tag ID in the vendor's settings and add their domain to your configuration
Booking or form widget embedded in an iframeNot by the standard linkerUse the vendor's GA4 integration or a postMessage-based setup
Separate brands with no shared journeysNoSeparate properties are often cleaner

A simple test before you start: open your Traffic acquisition report, set the primary dimension to Session source, and look for your own domains or your vendors' domains in the list. If they appear with meaningful sessions and key events, you have a cross-domain or referral-exclusion problem worth fixing.

GA4 identifies a browser using a first-party cookie, _ga, which stores a client ID. A second cookie, named after your property's tag ID, stores session information. Because these are first-party cookies, they belong to the domain that set them. A browser will not send brand.com's cookies to brand-booking.com, so the booking site's tag sees a stranger and creates new IDs.

“Without cross-domain measurement, new cookies with new IDs are created for each domain a user visits.”

— Google Analytics Help, Set up cross-domain measurement

Cross-domain measurement works around this by passing the identifiers in the URL. When a user clicks a link (or submits a form) pointing to one of your configured domains, the Google tag appends a _gl linker parameter to the destination URL. The tag on the destination reads that parameter and writes the same client and session IDs into its own cookies. GA4 then records one user and one session, and the original traffic source carries through to the booking or purchase.

A few consequences follow from how this works:

  • The linker only decorates links and forms the user interacts with. A server-side redirect or JavaScript-driven navigation can bypass it.
  • The _gl value is time-stamped and meant to be used immediately. A decorated URL that someone bookmarks or shares will not reliably link sessions later.
  • Both domains must send data to the same web data stream using the same tag ID. Two different properties cannot share a session.
  • Consent still applies. If a visitor has refused analytics cookies on one domain, there is nothing to pass across, and consent mode behaviour on each domain determines what is collected. Our Consent Mode v2 guide covers how that works.

Configuring your domains in GA4, step by step

For most sites using the Google tag (gtag.js) or a Google tag inside Google Tag Manager, the whole configuration lives in the GA4 admin. You do not need to edit code on each page.

  1. Confirm that every domain in the journey loads the same G- tag ID from the same web data stream. Check the page source or use Tag Assistant on each domain.
  2. In GA4, go to Admin → Data collection and modification → Data streams and select your web stream. You need Editor access or above.
  3. Click Configure tag settings, then Configure your domains.
  4. Review any domains GA4 has already detected and accept the ones that belong to you.
  5. Add any missing domains manually. Each condition has a match type (such as contains, exactly matches or ends with) and a domain. Conditions use OR logic, so a link to any listed domain is decorated.
  6. Save. The change takes effect on the next page load; no new tag publication is needed for gtag.js or the Google tag in GTM.
  7. Repeat nothing on the other domain: the same setting applies wherever the same tag ID loads, which is why step one matters.

Use match types carefully. "Contains brand" would also decorate links to brandwatch.com or any other domain containing that string. "Exactly matches" or "ends with" plus the full registrable domain is safer.

If your site uses an old hard-coded tag that predates the Google tag, or a third-party script that builds its own GA4 configuration, the admin setting may not apply. In that case the gtag linker configuration or a developer-built manual approach is needed. Google's article describes a manual method: read the client ID and session ID with the gtag get command on the source domain, pass them in the destination URL, and apply them with the config command on the destination. Treat that as a last resort, because it is easy to get wrong.

For teams managing many tags, this is a good time to check your container structure as a whole; our Google Tag Manager guide for beginners explains how the Google tag and GA4 event tags relate.

Booking engines, payment gateways and checkout platforms

Most cross-domain headaches involve software you don't control. The deciding question is whether the vendor lets you put your own GA4 tag on their pages.

Vendors that accept your tag

Many booking engines, ticketing platforms and hosted checkouts have a setting for a GA4 measurement ID or a GTM container. Add your tag there, add their domain (or your branded subdomain on their platform) to your configured domains, and test. Ask the vendor three questions before relying on it:

  • Does your integration use the standard Google tag, so that the _gl parameter is read automatically?
  • Do you redirect between pages in a way that drops query parameters?
  • Which events do you send (for example begin_checkout and purchase), and with what parameters?

Vendors that don't

Hosted payment pages, bank authentication screens and some marketplace checkouts can't be tagged. When a user returns from them to your thank-you page, GA4 sees the vendor as a new referrer. The fix is the unwanted referrals list, which tells GA4 to ignore that referrer instead of starting a new attributed session.

“You can configure a maximum of 50 unwanted referrals per data stream.”

— Google Analytics Help, Identify unwanted referrals

Iframes

A booking widget inside an iframe is effectively another website running inside your page. The linker decorates navigation, not iframes, so the standard admin setting won't stitch them. Options are the vendor's native GA4 integration (often the simplest), having the vendor send events to the parent page via postMessage so your tag records them, or opening the booking flow in a full page instead of a widget. Whichever you choose, make sure the purchase or lead is recorded once, not twice.

Tool typeTypical behaviourRecommended approach
Hosted card payment pageUser leaves and returns to your thank-you pageUnwanted referral for the processor's domains; record purchase on your own confirmation page
Hotel or restaurant booking engine on vendor domainFull-page journey on another domainVendor GA4 integration plus configured domains
Appointment scheduler embedded in an iframeJourney happens inside your pageVendor's native integration or postMessage events to your page
Separate SaaS app domainSign-up on marketing site, activation in appConfigured domains, same data stream, plus user ID once logged in
Multi-brand shared basketUsers browse several brand domains, pay on oneConfigured domains across all brands, one property for the journey

When the _gl parameter disappears

If everything is configured and sessions still split, the linker parameter is probably being lost between the click and the destination tag. Google's troubleshooting section names the two main culprits: redirects that drop query parameters, and scripts that interfere with click handling. In practice these are the ones to check:

  • Redirect chains. A link to brand-booking.com that redirects to www.brand-booking.com/en/ may drop the query string. Test each hop and ask developers to preserve parameters.
  • JavaScript navigation. Buttons that call window.location in code, rather than real <a href> links, aren't decorated by the linker's click listener.
  • Event propagation. Some sliders, menus and pop-up libraries stop click events from bubbling up to the document, so the linker never sees the click.
  • Link shorteners and tracking redirects. These can strip parameters in the same way they strip referral details. Google's help on direct traffic notes the same risk for referrers:

“Using URL shorteners like bit.ly can also strip away referral details.”

— Google Analytics Help, Understand (direct) / (none) traffic
  • Single-page apps and consent banners. If the tag hasn't loaded yet (for example because the consent banner is still open) when the user clicks, there is nothing to decorate.

Use this symptom table to narrow it down quickly:

SymptomLikely causeWhere to look
No _gl in the destination URL at allDomain not configured, or the click isn't a real linkTag settings in GA4; the button's HTML
_gl present on the first hop, gone afterRedirect dropping the query stringNetwork tab, following each redirect
_gl arrives but client ID still differsDestination tag uses a different tag ID or loads too lateTag Assistant on the destination domain
Works on desktop, fails on mobileDifferent mobile menu or button script stopping propagationRepeat the test with the mobile navigation
Works for some visitors onlyConsent banner blocking the tag until a choice is madeConsent settings and tag firing order

Testing cross-domain tracking end to end

Don't trust the setting until you have watched a real journey. This test takes about ten minutes.

  1. Open a private browser window and land on your main site with a test campaign URL, for example ?utm_source=test&utm_medium=crossdomain&utm_campaign=xd-check.
  2. Open DevTools → Application → Cookies and note the value of the _ga cookie. The client ID is the last two number groups.
  3. Click through to the second domain using the real button customers use, not a typed URL.
  4. Check the address bar: the destination URL should contain _gl= on arrival (some sites remove it from the visible URL after reading it, so watch closely or use the Network tab).
  5. On the second domain, check the _ga cookie again. The client ID should match the one from step two.
  6. Complete a test conversion if you can, then open GA4's DebugView or Realtime report and confirm the events arrive in a single session with your test source and medium.
  7. Repeat in a second browser and on mobile, and repeat for every distinct entry point to the second domain (header button, pricing page, emails).
  8. Confirm downloads and other links to non-HTML resources on the configured domains still work, as Google's verification steps suggest.

Then wait a few days and check reports: sessions with Session source equal to your own domain should fall sharply, and conversions on the second domain should now be credited to marketing channels.

Cleaning up self-referrals and broken attribution afterwards

Even after a correct setup, some self-referrals usually remain. Work through them in order:

  1. Find pages on any of your domains that are missing the tag (a common cause of a user "arriving" from your own site mid-journey).
  2. Check for a custom cookie_domain or old tag settings that stop subdomains sharing the cookie.
  3. Add payment processors and identity providers to the unwanted referrals list.
  4. Only after those steps, consider listing your own domains as unwanted referrals as a safety net. GA4 already treats traffic from your configured domains and linker-stitched sessions as self-referrals by default, so this is rarely needed.

Be careful with the list, though. Google's documentation advises against blanket use of the ignore_referrer mechanism, noting that most site owners won't need to set it manually, because you can lose genuinely useful source data.

Two limits are worth explaining to stakeholders. These fixes apply to data collected after you make them; they don't re-stitch historical sessions. And returning users may still be attributed to an earlier source because of attribution lookback windows. If you need to report before-and-after, annotate the change date and compare periods rather than rewriting history. Remaining misattributed traffic can then be grouped properly with a custom channel group, as described in our guide to fixing (Unassigned) traffic in GA4, and checked as part of a wider GA4 audit.

Worked example: a hotel with a separate booking engine

This example is hypothetical. A boutique hotel runs its website on hotel.com and uses a booking engine on book.enginevendor.com. Over a month, GA4 reports 9,000 sessions and 120 bookings. The hotel's Traffic acquisition report says 104 of those bookings came from Referral, with hotel.com as the source. Paid Search, on which the hotel spent several thousand on ads, shows only 4 bookings.

The team adds the hotel's GA4 tag ID in the booking engine's analytics settings, adds enginevendor.com to the configured domains, and lists the card processor as an unwanted referral. Testing shows the _gl parameter surviving and the client ID matching on both sides.

The following month, with similar traffic, referral bookings from hotel.com fall to a handful, session counts drop by roughly the number of booking-engine visits that used to be counted twice, and bookings now spread across Organic Search, Paid Search, Email and Direct. Paid Search shows 31 bookings. Nothing about the campaigns changed; the measurement did. That difference can decide whether a profitable campaign gets cut, which is why cross-domain checks belong in every PPC audit.

The same principle applies to lead generation: if a scheduling tool or form lives on another domain, the lead loses its source. If you then pass those leads to a CRM, the stitched GA4 session is also what makes UTM data in your CRM trustworthy, and what enhanced conversions build upon in Google Ads.

Questions about GA4 cross-domain tracking

Do I need cross-domain tracking for subdomains?

Usually not. With the same tag ID and default cookie settings, GA4 shares its cookies across subdomains of the same domain. If you see self-referrals between subdomains, look for untagged pages or a custom cookie domain setting first.

Can I use cross-domain tracking with two different GA4 properties?

No. Cross-domain measurement links sessions within one web data stream. Both domains must load the same tag ID. If you need separate reporting for each site, use filters or comparisons within one property, or send data to a second property in addition.

Why does my payment provider still show as a referral?

Because you can't tag the provider's pages, the user returns from their domain as a new referrer. Add the provider's domains to the unwanted referrals list in your web stream's tag settings.

Will cross-domain tracking fix my past data?

No. It only affects sessions collected after you set it up. Annotate the change date and compare periods instead of expecting historical reports to change.

Does cross-domain tracking work inside iframes?

Not with the standard admin setting, which decorates links and forms. For embedded widgets use the vendor's GA4 integration or a postMessage approach that sends events to the parent page.

Checking your own cross-domain journeys this week

List every domain a customer might touch between landing and converting, then check Session source in GA4 for any of them. Configure the domains you own, add processors you can't tag to unwanted referrals, and run the ten-minute cookie test on each entry point. Re-check the source report a week later.

If your booking engine, checkout or app is quietly swallowing attribution and you'd like it fixed properly, our PPC management and conversion optimization teams handle tracking set-up as part of their work. Get a quote for a tracking review.

Further reading on GA4 cross-domain tracking

Sources for this GA4 cross-domain tracking guide

  1. Google Analytics Help: Set up cross-domain measurement
  2. Google Analytics Help: Identify unwanted referrals
  3. Google Analytics Help: Understand (direct) / (none) traffic
  4. Google Analytics Help: Default channel group
  5. Google Analytics Help: Traffic-source dimensions, manual tagging, and auto-tagging
  6. Google Analytics Help: URL builders – Collect campaign data with custom URLs
Rohit Choudhary
Written byRohit ChoudharyCo-Founder, My SEO Experts

Rohit Choudhary is the co-founder of My SEO Experts and has more than 14 years of hands-on experience in SEO, paid advertising and digital marketing. Since starting out in 2011 he has helped hundreds of businesses grow through practical, data-driven search strategies, and he also serves as a consulting Digital Marketing Director for several US-based companies.

Keep reading

Related articles

How to Choose the Primary Keyword for an Existing Page
Analytics

How to Choose the Primary Keyword for an Existing Page

Old pages drift into ranking for searches nobody planned. Here is how to use Search Console data to pick one clear primary keyword and re-center the page without losing what already works.

Ready to grow your business online?

Get a free, no-obligation proposal tailored to your goals and budget.

CallFree Quote