How to Solve Cross-Domain Tracking Problems (GA4 + GTM)

Cross-domain tracking issues can break attribution, inflate Direct traffic, create self-referrals, and fragment user journeys. If users move between multiple domains (e.g., site → store → checkout → booking system), GA4 must pass identifiers between them—or every hop becomes a “new session.”

This guide covers why cross-domain tracking breaks, the most common symptoms, and step-by-step fixes for GA4 and GTM.

1. How Cross-Domain Tracking Works (Quick Overview)

GA4 uses a URL parameter called _gl to share user identifiers between domains.

Example: https://yourstore.com/?_gl=1*abcdef*…

When this parameter doesn’t pass properly, GA4:

  • Starts a new session
  • Attributes incorrectly
  • Shows self-referrals
  • Mislabels conversions as “Direct”

2. Symptoms of Cross-Domain Tracking Problems

  • ❌ Self-referrals (your own domain appears as a traffic source)
  • ❌ Spikes in “Direct” traffic
  • ❌ Session resets during checkout
  • ❌ Attribution credited to the wrong channel
  • ❌ Users appear as two separate sessions
  • ❌ _gl parameter missing from URL after clicking between domains

If you see these issues, cross-domain tracking is likely broken.

3. Common Causes of Cross-Domain Tracking Problems

  • Domains not listed in GA4 cross-domain settings
  • GTM using the wrong GA4 configuration tag
  • Links between domains don’t preserve URL parameters
  • Third-party checkout pages not supporting query strings
  • Redirects strip query parameters
  • Missing referral exclusions
  • Multiple GTM containers or GA4 tags across domains
  • Iframe or embedded checkout flows

4. How to Fix Cross-Domain Tracking in GA4

Fix 1: Add All Domains to GA4 Cross-Domain Settings

Go to: Admin → Data Streams → Web Stream → Configure Tag Settings → Configure Your Domains

Add each domain you want to track across:

  • yoursite.com
  • shop.yoursite.com
  • checkout.thirdparty.com

Format:

  • Domain contains → yoursite.com
  • Domain exactly matches → checkout.example.com

This tells GA4 which domains can share identity data.

Fix 2: Ensure the GA4 Base Tag Is Identical Across All Domains

Whether using GTM or hard-coded GA4:

  • Same Measurement ID
  • Same Configuration Tag
  • Same settings in GTM

If each domain uses a different GA4 base tag, users won’t be unified.

Fix 3: Verify _gl Parameter Passes Correctly

Navigate from domain A → domain B. Check the URL on B:

  • ❌ If _gl is missing → tracking is broken
  • ✔ If _gl appears → tracking is working

If missing:

  • Buttons may use JS that strips query parameters
  • Links may use target=”_blank” without preserving params
  • Redirects may drop parameters

Fix: Update link code to append existing URL params. Ensure server-side redirects pass query strings.

Fix 4: Add Referral Exclusions

Go to: Admin → Data Stream → Configure Tag Settings → List Unwanted Referrals

Add:

  • Your own domain
  • Any third-party checkout domain
  • Payment processors (PayPal, Stripe, Klarna, Afterpay)

This prevents your own domains or gateways from crediting themselves as traffic sources.

Fix 5: Fix Redirects That Strip UTMs or GL Parameters

Common offenders:

  • HTTPS → HTTP redirects
  • www → non-www
  • Language or geo redirects
  • Third-party booking platforms

All redirects must preserve query parameters. Example Nginx rule: rewrite ^(.*)$ $1?%{QUERY_STRING} permanent;

Fix 6: Resolve iFrame and Embedded Checkout Issues

Cross-domain tracking does NOT work inside iframes by default. Solutions:

  • Avoid iframe checkouts
  • Use postMessage + server-side tagging
  • Ask platform provider for native GA4 support
  • Use server-side tagging to unify identity
  • Ecommerce platforms like Shopify, Wix, Squarespace may require specific setups

5. Fixing Cross-Domain Tracking in GTM

Step 1: Update GA4 Configuration Tag

In your GA4 Config tag: Open Fields to Set

Add: Field name: linker

Do not manually configure it (GA4 auto-handles linker logic)

Step 2: Enable Cross-Domain Auto-Linking

In the same GA4 Config tag: Scroll to Cross Domain Tracking. Add all domains. Enable Decorate Forms if needed.

6. Testing Cross-Domain Tracking

Use these tools:

  • ✔ GA4 DebugView — Check if the same session_id persists when switching domains.
  • ✔ Tag Assistant (Chrome Extension) — Watch for same user ID, same session continuity, _gl parameter present.
  • ✔ Real-Time Report — Navigate across domains and ensure the session doesn’t restart, source/medium stays consistent, no self-referral shows up.

7. Special Cases & Advanced Fixes

  • 🛍 Ecommerce Checkouts (Shopify, WooCommerce, BigCommerce) — Some platforms require modifying checkout templates or enabling built-in GA4 → GA4 linking tools.
  • 🌐 Multi-Language / Multi-Region Sites — Make sure all subdomains share the same cookie domain.
  • 👇 Single-Page Apps + Multi-Domain — Ensure router links preserve URL parameters.
  • 💳 Payment Gateways (PayPal, Stripe) — Enable GA4 cross-domain settings AND add them to unwanted referrals.

8. Cross-Domain Tracking Checklist

🔧 Setup:

  • Same GA4 tag on all domains
  • Domains added in GA4 cross-domain settings
  • Linker active in GA4 Config tag

🔍 Testing:

  • _gl parameter passes
  • No session resets
  • No self-referrals
  • Source/medium remains consistent

🚀 Advanced:

  • Redirects preserve parameters
  • iFrames avoided or replaced
  • Payment gateways excluded
Previous Article

Why Your Bounce Rate Is Misleading & How to Interpret It Correctly?

Next Article

Fixing Wrong Attribution Models in GA4

Write a Comment

Leave a Comment

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨