Link Code Generator Logo
Link Code Generator
Link Tools
5 min read

GA4 Cross-Domain Tracking Setup Guide (2026)

Step-by-step guide to setting up cross-domain tracking in GA4. How the _gl linker parameter works, when you need it, and how to debug it.

What Is Cross-Domain Tracking?

Cross-domain tracking lets Google Analytics follow a user across multiple domains (e.g., shop.example.comcheckout.example.com) as a single session instead of counting them as two separate visitors. Without it, every domain switch starts a new session and makes your funnel data useless.

When You Need It

  • Your website and checkout are on different domains (e.g., Shopify checkout on checkout.shopify.com)
  • You have multiple brand sites that share users
  • You use a third-party booking/payment system on a separate domain

When you DON'T need it: Subdomains of the same root domain (e.g., blog.example.com and shop.example.com) are tracked as one domain automatically in GA4. No setup needed.

How to Set It Up in GA4

  1. Go to Admin → Data Streams and click your web stream
  2. Click Configure tag settings
  3. Click Configure your domains
  4. Add each domain you want to track across (e.g., example.com, checkout.example.com)
  5. Click Save

That's it. In most cases, you do NOT need to add any code snippet. GA4's built-in linker handles everything through the tag configuration UI.

How the _gl Parameter Works

When a user clicks a link from Domain A to Domain B, GA4 appends a _gl parameter to the URL. This parameter contains an encoded version of the user's client ID and session data. Domain B's GA4 tag reads this parameter and continues the same session.

The _gl parameter is temporary and doesn't affect SEO or user experience. It's automatically stripped from the URL after being read.

Debugging Cross-Domain Tracking

  1. Use GA4 DebugView: Admin → DebugView. Enable debug mode with the GA Debugger Chrome extension.
  2. Check for _gl parameter: Click a cross-domain link and verify ?_gl= appears in the destination URL.
  3. Verify in Realtime: Open GA4 Realtime report and confirm the same user appears across both domains.
  4. Check session count: If cross-domain is working, a user visiting Domain A → Domain B should show as 1 session, not 2.

Common Problems

  • _gl parameter not appearing: Check that both domains are listed in "Configure your domains" and that GA4 tags are installed on both.
  • Consent mode blocking: If you use a cookie consent banner, ensure it doesn't block GA4 before the linker can fire.
  • Redirects stripping parameters: Some redirect services strip query parameters. Test the full flow.

Related Tools

Track your cross-domain campaigns with properly tagged URLs using our UTM Builder. For cross-domain redirect links, try the Cross-Domain Redirect tool.