Getting Started

Cross-domain tracking in GA4 (finally made simple)

Learn how to configure cross-domain tracking in Google Analytics 4. Track users across multiple domains as single sessions with proper attribution.

A
Antoine
January 14, 20266 min read

If your users move between different domains (main site to checkout, blog subdomain to main site, or between regional domains), cross-domain tracking keeps them as one continuous session instead of separate visitors.

The good news: GA4 made this way easier than Universal Analytics.

When you need cross-domain tracking

ScenarioExampleNeed cross-domain?
Different root domainssite.com → checkout.comYes
Subdomainsblog.site.com → shop.site.comUsually no (automatic)
Third-party checkoutsite.com → shopify.com/checkoutYes
Regional domainssite.co.uk → site.deYes
Separate app domainssite.com → app.site.ioYes

Note: Same-domain subdomains (blog.site.com, shop.site.com) are tracked automatically in GA4. You don't need cross-domain setup unless cookies are blocked between subdomains.

How it works

When a user clicks from Domain A to Domain B, GA4:

  1. Adds a _gl parameter to the destination URL
  2. This parameter contains a linker value with session info
  3. Domain B reads the parameter and continues the same session

The URL looks like:

https://domainB.com/page?_gl=1*abc123*_ga*MTIzNDU...

Prerequisites

Before setting up:

  • Same GA4 property for all domains
  • Same Measurement ID on all domains
  • GA4 code installed on all domains (same implementation method)

If different domains use different GA4 properties, cross-domain tracking won't work. All domains must feed into one property.

Setup method 1: GA4 interface (easiest)

This is the recommended approach for most setups.

Step-by-step

  1. Go to Admin → Data Streams

  2. Select your web stream

  3. Click Configure tag settings

  4. Click Configure your domains

  5. Add all your domains:

    Match typeDomain
    ContainsdomainA.com
    ContainsdomainB.com
    ContainsdomainC.com
  6. Click Save

That's it. GA4 automatically:

  • Adds linker parameters when users navigate between these domains
  • Reads linker parameters on incoming traffic
  • Excludes these domains from referral attribution

Match types explained

TypeExampleMatches
Starts withexampleexample.com, example.co.uk
Containsexampleexample.com, my-example.org
Exactly matchesexample.comOnly example.com
Matches RegExexample.(com|net)example.com, example.net

For most cases, "Contains" works well.

Setup method 2: Google Tag Manager

If you need more control or are using GTM.

Step-by-step

  1. In GTM, open your Google Tag

  2. Expand Configuration Settings

  3. Add or modify the linker parameter:

    ParameterValue
    linker{"domains":["domainA.com","domainB.com"],"accept_incoming":true}
  4. Save and publish

Or add individual settings:

ParameterValue
linker.domains["domainA.com","domainB.com"]
linker.accept_incomingtrue

Testing your setup

Quick test

  1. Go to Domain A
  2. Click a link to Domain B
  3. Check the URL: does it include ?_gl= parameter?

If yes, the linker is working.

Detailed test in DebugView

  1. Enable debug mode
  2. Navigate from Domain A to Domain B
  3. Check DebugView in GA4
  4. Both page views should show the same Client ID

Check Realtime

  1. Open GA4 Realtime report
  2. Navigate between domains
  3. You should appear as one user (not multiple)

Common issues and fixes

_gl parameter not appearing

Possible causes:

  • Domain not in the list
  • Link is JavaScript-based (not standard <a> tag)
  • Redirect stripping parameters

Fix:

  • Verify domain is added correctly
  • For JS links, manually decorate URLs
  • Work with developers to preserve parameters in redirects

_gl parameter gets stripped

Server redirects often remove URL parameters.

Fix:

  • Configure redirects to preserve query parameters
  • Use the Chrome extension "Redirect Path" to debug
  • Check with your hosting provider or developers

Still seeing self-referrals

If Domain B shows as a referral source for Domain A:

  1. Check that cross-domain is configured correctly
  2. The _gl parameter must be present when crossing
  3. GA4 should auto-exclude configured domains from referrals

Form submissions break tracking

Standard forms often don't carry the linker parameter.

Fix via GTM:

// Add to form's submit action
var form = document.getElementById('myForm');
form.action = form.action + (form.action.includes('?') ? '&' : '?') +
  document.location.search.substring(1);

Or use GTM's form submit trigger with linker decoration.

JavaScript navigation

Single-page apps or JS-based navigation may not trigger automatic linking.

Fix:

// Manual linker decoration
gtag('get', 'G-XXXXXXX', 'linker_param', function(param) {
  var url = 'https://domainB.com/page?' + param;
  window.location.href = url;
});

Consent considerations

If users haven't consented on Domain A, they likely haven't on Domain B either. Cross-domain tracking can carry consent state if your CMP supports it.

Check if your Consent Management Platform can:

  • Share consent across domains
  • Preserve consent state in the linker parameter

Otherwise, users may need to consent again on each domain.

Verifying in reports

After a few hours of traffic:

  1. Go to Reports → Acquisition → Traffic acquisition
  2. Filter by source/medium
  3. Check if your other domains appear as referrals
  4. They should NOT appear if cross-domain is working

Check session counts:

  1. Compare sessions before and after enabling
  2. Sessions should decrease (fewer artificial "new" sessions)
  3. Average session duration may increase

Advanced: Multiple properties scenario

What if you want some domains in one property, others in another?

Short answer: You can't cross-domain track across different properties.

Workaround:

  • Use one property for all domains
  • Use segments or filters to separate analysis
  • Consider GA4 360 sub-properties if needed

Enterprise considerations

For large organizations with many domains:

ChallengeSolution
Many domainsUse regex matching in configuration
Different teamsStandardize on one GA4 property
Regional domainsInclude all in cross-domain config
Headless CMS/SPAsManual linker decoration

Next steps

Once cross-domain tracking works:

  1. Set up key events that span domains
  2. Build dashboards showing full journey
  3. Review attribution settings for multi-domain paths

Need a clearer view of your cross-domain analytics? Try Analayer. We help you understand complex user journeys across properties.

See your analytics clearly

Stop struggling with Google Analytics. Connect your account and get a cleaner, simpler view of your data in seconds.