It's common for businesses to operate websites across multiple domains—such as an e-commerce site with an external payment page, or a service site with landing pages on a separate domain. In GA4 (Google Analytics 4), if cross-domain tracking is not configured correctly, sessions will be fragmented whenever users move between domains, making it impossible to accurately understand user behavior. This article explains the mechanism behind cross-domain tracking, how to set it up, and common pitfalls to avoid.
Cross-domain tracking is a mechanism that allows you to seamlessly track user behavior across different domains as a single session. Normally, GA4 cookies (_ga and cookies starting with _ga_) are issued per domain, so when a user moves from Domain A to Domain B, they are treated as a separate user in a separate session.
When cross-domain tracking is configured, a client ID parameter is appended to cross-domain links, allowing the destination domain to identify the visitor as the same user. This enables accurate analysis of conversion paths and user behavior across domains.
Typical scenarios requiring cross-domain tracking include: an e-commerce site where the cart or payment service runs on a separate domain (e.g., your site is example.com but checkout is on cart.example.net); a corporate site and service site on different domains; landing pages hosted on a separate domain that redirect users to the main site; and sub-brands such as recruitment sites or brand-specific sites with their own domains.
Conversely, cross-domain setup is not needed for subdomain tracking (e.g., www.example.com and blog.example.com). GA4 treats subdomains as the same domain by default.
Follow these steps to configure directly from the GA4 admin panel. Open the GA4 admin panel and select the target web stream under Data Streams. Click "Configure tag settings" and open "Configure your domains." Set the Match Type to "Contains" and add the domains you want to track across—for example, register both example.com and cart.example.net. Save the settings and you're done.
With this configuration, links between registered domains will automatically have a parameter (_gl) containing the client ID appended to them.
If you're using GTM, cross-domain tracking is still configured on the GA4 admin side. The GTM GA4 configuration tag itself doesn't have cross-domain settings—the domain information registered in GA4's "Configure your domains" is automatically applied through the Google tag. However, all domains being tracked must have a GTM container (or Google tag) with the same GA4 measurement ID installed.
There are several ways to verify that cross-domain tracking is working correctly. First, click a link from Domain A to Domain B and check the browser address bar for a "_gl=" parameter in the destination URL. Next, use GA4's real-time report to confirm that cross-domain navigation is being recorded as a single session. Additionally, GA4's DebugView lets you inspect event parameter details in real time, allowing you to verify that the client ID matches across both domains.
Here are common issues and important notes for cross-domain tracking setup.
First, register domains in the "List unwanted referrals" setting. After configuring cross-domain tracking, go to Data Streams > Configure tag settings > List unwanted referrals and add all domains being tracked. Forgetting this step will cause cross-domain transitions to be recorded as referrals, resulting in session fragmentation.
Second, watch for _gl parameter loss. On pages with redirects or JavaScript-controlled navigation, the _gl parameter can be stripped during the transition. Verify that the parameter isn't being removed at any point in the redirect chain.
Third, be cautious with iframe embeds. When embedding content from an external domain via iframe, cross-domain tracking does not function automatically. You may need to install a GA4 tag with the same measurement ID inside the iframe and apply additional configuration.
Fourth, for form submissions that navigate to another domain, the Google tag may not automatically append the _gl parameter—unlike standard link clicks. Check that the decorateForms option is configured to ensure the parameter is appended to form action URLs as well.
Cross-domain tracking in GA4 is essential for accurately understanding user behavior across multi-domain websites. Register your domains under "Configure your domains" in the GA4 admin panel and also add them to the "List unwanted referrals" to prevent session fragmentation and referral misattribution. After setup, always verify _gl parameter appending and session continuity using DebugView and real-time reports. Properly implementing cross-domain tracking will significantly improve the accuracy of your cross-domain conversion path analysis and attribution evaluation.

A beginner-friendly guide to what "not provided" means in GA4 and Google Search Console, why it happens, and how to work...

A beginner-friendly guide to GA4 referral traffic: what it means, how to check it, and how to analyze it. Covers everyth...

Learn how to create GA4 reports with Looker Studio (formerly Google Data Studio). Step-by-step guide covering data sourc...