all insights/

How to Set Up GA4 Cross-Domain Measurement: A Step-by-Step Guide

Cover image for Product Management 101 for Media Publishers

Introduction

Cross-domain measurement in GA4 allows you to track users across multiple websites (domains) as a single journey. This ensures your Google Analytics 4 data reflects real user behavior even if visitors navigate between a main site and other domains (for example, from your marketing site to a separate shop or landing page). This guide is tailored for marketers and business owners with beginner to intermediate technical knowledge. We explain what GA4 cross-domain tracking is, why it’s important, and provide a step-by-step tutorial on setting it up. Along the way, you’ll learn how to configure cross-domain tracking through the GA4 interface, with practical examples using Google Tag Manager (GTM) and code snippets.

What is Google Analytics 4 Cross-Domain Measurement?

Definition: GA4 cross-domain measurement (also known as cross-domain tracking) is a feature that lets Google Analytics treat a single user’s sessions across different domains as one continuous session. In simple terms, it links user identifiers between your domains so the same person isn’t counted twice. 

How it works: GA4 uses first-party cookies and a special URL parameter (_gl) to carry over the user’s Google Analytics identifiers from one domain to another. When a user clicks a link from Domain A to Domain B, GA4 appends this parameter to the URL, allowing Domain B to recognize the user as the same visitor from Domain A. 

Without cross-domain tracking, each domain would assign a new client ID and session to the user, inflating your user counts and causing “self-referrals” (your own site showing up as referral traffic in reports). 

With cross-domain tracking, the user maintains the same client ID and session across your domains. This provides accurate data – one user, one session – across the entire user journey, no matter how many domains they visit.

Why Cross-Domain Tracking Matters for Your Business

Unified Customer Journey
If your marketing website and e-commerce store are on different domains, cross-domain tracking lets you see a single funnel. You can track a visitor from the first touch on your main site through to a conversion on your shop domain as one continuous journey. 

Accurate User and Session Data
It prevents double-counting of users and sessions. Without it, one person visiting two of your sites would appear as two separate users. Cross-domain measurement ensures your Google Analytics 4 reports show the real number of unique visitors and sessions. 

Proper Attribution & No Self-Referrals
Marketing campaigns get proper credit. For example, if a user clicks a Google Ads ad to your landing-page.com and then goes to your main-site.com to purchase, GA4 will attribute the conversion to the ad (not as direct or referral traffic). It also stops your own domains from appearing as referrals, which keeps your traffic sources clean. 

Better Decision Making
When you have accurate, unified data, you can make better marketing and UX decisions. You’ll understand how users move through your ecosystem of sites, which touchpoints drive conversions, and where to optimize – all critical insights for marketers and business owners. 

Use Case Example
Imagine a software company with a marketing site on productsite.com and a help center on supportsite.com. Cross-domain tracking will let you see if users who read certain support articles end up back on the main site to request a demo, all in one GA4 view. 

For businesses operating multiple domains, achieving this unified view of the customer journey can be transformative. However, setting up cross-domain tracking correctly can be complex. If you want to ensure everything is implemented flawlessly or need guidance integrating it into your overall digital strategy, consider reaching out to Refact. Our analytics optimization experts can help you configure GA4 cross-domain tracking as part of a comprehensive strategy, so you get accurate, unified data without the headache.

a woman using a laptop on Website A, an arrow labeled ‘Single session’ pointing to Website B, and the GA4 logo—visualizing how Google Analytics 4 tracks one continuous session across two domains.

Prerequisites and Setup Requirements

Before diving into the setup steps, make sure you have the following in place: 

Use the same GA4 property (same Measurement ID, e.g., G-XXXXXXXX) on every domain you want to track – cross-domain tracking only works when all domains send data to the same GA4 property. Also, ensure GA4 tracking is installed on each site. If you haven’t set up GA4 on a particular site yet, do that first (either by adding the GA4 gtag.js snippet or via GTM) before configuring cross-domain tracking. Additionally, identify all the domains you plan to link (for example, yourmaindomain.com and yourothersite.com) because you’ll need to input each one in GA4’s settings. 

You’ll also need the proper access level. Make sure you have Editor (or higher) access to the GA4 property, since configuring cross-domain settings requires that permission. If you’re not the GA admin, obtain the necessary rights or ask a developer/agency for help. Note that if you are tracking subdomains of the same root domain (for example, blog.yourdomain.com and www.yourdomain.com), you do not need special cross-domain configuration — GA4 will track those subdomains under one property automatically. Just ensure your cookie settings in GA4 (or GTM) use Auto for the cookie domain so subdomain tracking works seamlessly. Cross-domain configuration is only needed for separate root domains.

Step-by-Step Guide: Setting Up GA4 Cross-Domain Tracking

Follow these steps to configure cross-domain measurement in Google Analytics 4. We’ll use GA4’s built-in interface for linking domains, which is the recommended and easiest method. 

If you’d prefer to have an expert handle the setup for you, Refact’s analytics specialists are ready to assist. We can manage the cross-domain tracking configuration on your behalf, ensuring everything is implemented correctly and aligned with best practices.

Step 1: Navigate to GA4 Admin and Select Your Data Stream

Open Google Analytics 4 and navigate to the Admin section (click the gear icon in the lower-left corner of the GA4 interface). In the Property column, select the GA4 property that collects data for all your sites (make sure you’ve chosen the correct property that spans your domains). Next, click Data Streams under the Property settings, and then select your Web data stream for the main website (the primary domain). (Tip: The data stream name usually looks like your website URL, such as “https://yourmaindomain.com”. If you have multiple data streams, choose the one corresponding to the site where user journeys often start.)

Step 2: Open the Configure Tag Settings Menu

After selecting the web data stream, the Web Stream Details page will appear for that stream. This page shows your Measurement ID and various toggles (e.g. settings for Enhanced Measurement). Scroll down to find the “Google tag” section (formerly labeled “Tagging Settings” in the GA4 interface). Under this section, click Configure tag settings. This will open a panel with additional tagging options. In the Tag Settings panel, look for “Configure your domains.” (It might be under a sub-section labeled Settings or More Tagging Settings, depending on the GA4 UI updates.) This is where you will set up the rules for cross-domain linking.

Step 3: Add Your Domains in GA4 Cross-Domain Configuration

In the Configure Your Domains settings, you’ll find a section to include domains for cross-domain measurement. GA4 may automatically suggest domains if it detects the same GA4 tag active on them (these appear under a “Recommended domains” list). If suggestions are provided, simply click Add next to each recommended domain to include it. For example, GA4 might detect “yourothersite.com” if that site is already sending data to your GA4 property. 

If no suggestions appear, or if you want to add additional domains manually, you can specify your own conditions. Click Add condition under the “Include domains that match the following conditions” section. For Match Type, select an appropriate option (commonly “contains” works for most cases, or use “ends with” for more precise control). In the Domain field, enter the domain name you want to track across. For example, to include https://www.yourothersite.com, enter “yourothersite.com” (omit the https:// and www so that any subdomain or path will match). Click Add condition again to add another domain, and repeat these steps for each additional domain you want to track (for instance, add yourmaindomain.com if it isn’t listed by default, along with any other domains involved in your user journey). Each condition acts like an OR rule – as long as a link’s URL contains one of the domain strings you’ve added, GA4 will automatically decorate that link for cross-domain tracking. 

After entering all your domain names, double-check your list for typos or anything missing. It’s a good practice to use broad match patterns (for example, using “contains” with just the core domain name) so that subdomains or variations are all covered. Once everything looks correct, click the Save button to save your cross-domain configuration. GA4 will now treat the specified domains as connected, and the GA4 tag will start adding the special _gl query parameter to links between them.

GA4 screen configuring cross-domain linking with two domains.

Step 4: Test and Verify Your Cross-Domain Tracking

Now that you’ve set up the domain linking, it’s time to make sure cross-domain tracking is working correctly. Start by performing a test visit: on your website, navigate as a typical user and click a link that goes from one of your tracked domains to another (for example, from yourmaindomain.com to yourothersite.com). When you land on the second domain, check the browser’s address bar. You should see a long query parameter starting with ?_gl= appended to the URL. This _gl parameter carries the Google Analytics client and session identifiers over to the new domain. If you see the _gl parameter, that’s a good sign – GA4 is transferring the data properly. If the parameter is missing, double-check that the link you clicked is a normal HTML link (not a script-based redirect) and that the link’s URL exactly matches one of the domains you configured in GA4. 

Next, use GA4’s DebugView or Realtime report to observe the tracking in action. (You can enable the GA Debugger browser extension or use Google Tag Manager’s Preview mode to flag your session for debugging.) As you click through from Domain A to Domain B, watch the events in GA4. You should see page_view events for both Domain A and Domain B appearing as part of the same session timeline for your user. Check the event parameters for these page views: the page_location for the first page_view should show Domain A, and for the second page_view should show Domain B. They ought to share a consistent session_id — indicating that the session continued across domains — or at least appear linked in sequence when viewed in DebugView. 

Also verify that GA4 did not start a new session when the user moved to Domain B. If everything is set up correctly, it will treat the cross-domain transition as one continuous session. That means the user count remains one (the person isn’t counted twice) and the session count doesn’t double when the user navigates to the second domain. 

If you do encounter issues (for example, the _gl parameter is missing on the second domain’s URL or GA4 starts a new session when crossing to Domain B), you’ll need to troubleshoot a bit. First, double-check that both domains have the GA4 tracking code (or the same GTM container) installed and that they share the identical Measurement ID. Next, ensure the domain names are entered correctly in your GA4 configuration (no typos or extra spaces, and no subdirectory paths — just the base domain names). 

Additionally, consider if any site configurations might be stripping away URL parameters. Some third-party redirects or form handlers, for instance, could drop query parameters like _gl. If you suspect this is happening, consult with a developer to make sure the _gl parameter isn’t being removed during the navigation. (One quick test: manually add ?test=1 to the end of a URL on your site and see if it remains in the address bar after you navigate or after any redirect. If that test parameter disappears, it indicates a redirect (or script) is likely wiping out query parameters.) 

Once your testing looks good — you can see the _gl parameter on the URLs and GA4 continues the same session across domains — you have successfully implemented GA4 cross-domain tracking! All user journeys across the specified domains will now be unified in your analytics reports.

Using Google Tag Manager to Implement Cross-Domain Tracking (Optional)

If you’re using Google Tag Manager (GTM) to deploy GA4, note that in most cases the GA4 Admin method above is all you need — even if your GA4 tags are delivered via GTM. GTM will automatically respect the cross-domain settings you configured in GA4. However, there are a few GTM-specific tips and optional settings that can help ensure everything runs smoothly: 

Ensure GA4 Config Tag on All Sites: Make sure that each domain has the same GTM container installed and that your GA4 Configuration tag (with the correct G-ID for your property) fires on all pages of every site. Consistency is key: one GA4 property and one configuration should span across all your domains. 

No Extra Tag for Linking Required: Unlike with Universal Analytics in the past, GA4 doesn’t require a separate “linker” tag or plugin in GTM to enable cross-domain tracking. The cross-domain link decoration (adding the _gl parameter to URLs) happens automatically when you configure your domains in GA4, as we did above. You typically do not need to add any new GTM tags or custom code for basic cross-domain tracking in GA4. 

Optional – Manual Fields in GTM: GTM does allow manual configuration of cross-domain settings if needed for advanced cases. For example, you can edit your GA4 Configuration tag in GTM and under More Settings > Fields to Set, add a field named allowLinker with value true, and another field named cookie_domain with value auto. Setting allowLinker to true explicitly ensures the linker functionality is enabled (GA4’s gtag.js sets this to true by default, but it can be reassuring to confirm it). Setting cookie_domain to auto ensures the GA4 cookie is set at the top-level domain automatically (also the default behavior, which helps share cookies across subdomains). These manual field settings mirror GA4’s default out-of-the-box behavior, so you’d only configure them in edge cases. In most situations, relying on GA4’s standard interface settings is sufficient. 

Testing via GTM Preview: Use GTM’s Preview mode to test your cross-domain setup. This lets you simulate user navigation and see GA4 events firing on each domain, confirming that the same user (Client ID) is maintained across domains. You can also look at the GA4 debug output or use Google’s Tag Assistant to verify that the linker is working and that the user’s session remains unified when moving between your sites. 

Bottom line: For most marketers, simply configuring cross-domain tracking in GA4 (as shown above) and ensuring your GA4 tag is present on both (or all) sites via GTM is enough. GTM will handle the rest of the linking behind the scenes using your GA4 settings, so you’ll get unified data without additional custom setup. This approach leverages GA4’s ease of use along with GTM’s powerful deployment capabilities to give you reliable cross-domain analytics.

Ready to Transform Your Analytics?

Accurate, seamless analytics are the foundation for successful digital strategies. Setting up GA4 cross-domain tracking ensures you gain clear, unified insights into user journeys, conversion paths, and marketing effectiveness across multiple domains. 

At Refact, we specialize in digital strategy, analytics optimization, and user-centric web development. Our team ensures your GA4 setup is precise, comprehensive, and perfectly aligned with your business goals. We handle the complexity, so you can focus on driving growth. 

Take the next step toward smarter analytics. 

Contact our analytics experts today. Let’s elevate your data insights and unlock your website’s full potential together.

Looking to grow your media business?

Get in touch and tell us about your project!

Get in Touch
LET’S WORK TOGETHER

Sound smarter in meetings.

Weekly media tech news in easy-to-read chunks.