Contents
- 1 Cross-Domain Tracking: Complete Setup Guide for GA4
- 1.1 What Is Cross-Domain Tracking and Why It Matters
- 1.2 When You Need Cross-Domain Tracking
- 1.3 Prerequisites
- 1.4 Step 1 — Configure Cross-Domain in GA4 Admin
- 1.5 Step 2 — Set Up via Google Tag Manager
- 1.6 Step 3 — Verify It’s Working
- 1.7 Common Issues and Fixes
- 1.8 Cross-Domain Tracking with Subdomains
- 1.9 Common Mistakes to Avoid
- 1.10 FAQ
- 1.10.1 Does GA4 cross-domain tracking work with Google Ads auto-tagging?
- 1.10.2 How many domains can I link together?
- 1.10.3 Will the _gl parameter affect my SEO?
- 1.10.4 Does cross-domain tracking work with cookie consent banners?
- 1.10.5 Can I use cross-domain tracking between GA4 and Universal Analytics?
- 1.11 Next Steps
Cross-Domain Tracking: Complete Setup Guide for GA4
A visitor lands on your marketing site, clicks “Buy Now,” and gets redirected to your checkout on a separate domain. GA4 sees that as two different users. Your conversion data is broken, your attribution is wrong, and you’re making decisions based on incomplete information.
This is one of the most common analytics problems I see — and one of the easiest to fix once you know how. In this guide, I’ll walk you through exactly how to set up cross-domain tracking in GA4, step by step. Whether you’re using the GA4 admin interface or Google Tag Manager, you’ll have accurate cross-domain data flowing within 30 minutes.
What Is Cross-Domain Tracking and Why It Matters
Cross-domain tracking is a configuration that tells GA4 to treat visits across multiple domains as a single user session. Without it, every time a user moves from one domain to another, GA4 assigns a new client ID — creating a brand new session and losing all context about where that visitor came from.
Here’s what breaks without cross-domain tracking:
- Inflated user counts — one person looks like two (or more) separate visitors
- Self-referrals — your own domains show up as traffic sources in reports
- Broken attribution — you can’t see which campaigns actually drove conversions
- Inaccurate funnel data — user journeys that span domains appear as disconnected fragments
GA4 handles cross-domain tracking by appending a _gl parameter to URLs when users navigate between your configured domains. This parameter carries the client ID and session information, so GA4 can stitch the journey together seamlessly.
If you’re building out your analytics foundation, I recommend reading my tracking plan guide first — it’ll help you identify all the domains and touchpoints you need to account for.

When You Need Cross-Domain Tracking
Not every multi-domain setup requires cross-domain tracking. Here are the scenarios where you absolutely need it:
| Scenario | Example | Cross-Domain Needed? |
|---|---|---|
| Separate checkout domain | shop.example.com → checkout.stripe.com | Yes |
| Marketing site + app | www.example.com → app.example.com | Depends (see subdomain section) |
| Third-party booking system | hotel.com → booking-engine.com | Yes |
| Multiple brand domains | brand-a.com → brand-b.com | Yes (if same GA4 property) |
| Landing pages on separate platform | example.com → example.unbounce.com | Yes |
| Subdomains of the same root domain | www.example.com → blog.example.com | Usually no (GA4 handles this) |
In my experience setting up cross-domain for e-commerce clients, the most common scenario is a main website with a separate checkout or payment domain. I’ve also seen it frequently with SaaS companies that have a marketing site on one domain and the actual product on another.
Prerequisites
Before you start, make sure you have:
- A GA4 property with data streams for each domain you want to track
- Admin access to GA4 (Editor role or above)
- GA4 tag installed on all domains — either through Google Tag Manager (GTM) or the gtag.js snippet
- The same Measurement ID (G-XXXXXXX) used across all domains
- Access to modify links between domains if they use JavaScript-based navigation
The critical point: all domains must share the same GA4 property and Measurement ID. If you’re using separate properties for each domain, cross-domain tracking won’t help — you’d need to consolidate into one property first.
Step 1 — Configure Cross-Domain in GA4 Admin
This is the primary method and works regardless of whether you use GTM or gtag.js. Google has made this significantly easier than it was in Universal Analytics.
- Go to GA4 Admin → Data Streams → select your web stream
- Click Configure tag settings (at the bottom of the stream details)
- Click Configure your domains
- Click Add condition
- Set the match type to “Contains” and enter your domain (e.g.,
example.com) - Add another condition for each additional domain
- Click Save
Important: Add ALL domains involved, including your primary domain. A common mistake is only adding the secondary domain and forgetting the main one. Both (or all) domains must be listed.

Step 2 — Set Up via Google Tag Manager
If you manage your GA4 implementation through Google Tag Manager, the GA4 admin configuration from Step 1 is usually sufficient. GTM inherits the cross-domain settings from the GA4 property automatically.
However, if you prefer to manage everything within GTM, you can configure it directly in your Google tag:
- Open your GTM container and navigate to your Google tag
- Click on Configuration settings
- Under Domains to configure, add each domain
- Save and Publish the container
Make sure the same GTM container is installed on all domains. For a deeper dive into tag configuration, check out my GA4 event tracking setup guide.
Step 3 — Verify It’s Working
Configuration without verification is just hoping. Here are three ways to confirm cross-domain tracking is functioning correctly.
Check the _gl Parameter
Navigate from your primary domain to your secondary domain. Look at the URL in the browser’s address bar. You should see a _gl parameter appended:
https://checkout.example.com/cart?_gl=1*1abc2de*_ga*MTIzNDU2Nzg5MC4xNjk...
Use GA4 DebugView
Install the Google Analytics Debugger Chrome extension and enable it. Go to GA4 Admin → DebugView. Navigate across your domains and confirm that events from both domains appear under the same client ID.
Check for Self-Referrals
After a few days, check Reports → Acquisition → Traffic acquisition. If your own domains show up as referral sources, cross-domain tracking isn’t working properly.

Common Issues and Fixes
Even with correct configuration, cross-domain tracking can break. Here are the issues I encounter most often.
Self-Referrals Still Appearing
Go to Admin → Data Streams → Configure tag settings → List unwanted referrals and add your domains there. This tells GA4 to ignore referral information from those domains.
Payment Gateway Referrals
Payment gateways like PayPal, Stripe, or bank 3D Secure pages will show up as referral sources. You can’t implement cross-domain tracking on these third-party domains. Instead, add them to the unwanted referrals list so GA4 preserves the original session source.
The _gl Parameter Gets Stripped
Some systems strip query parameters during redirects — server-side redirects, URL shorteners, some CMS platforms, and firewall rules. Work with your development team to ensure the _gl parameter is preserved through all redirects.
Cross-Domain in Iframes
GA4’s automatic link decoration doesn’t work for iframes. You’ll need a custom solution — typically passing the client ID via postMessage between the parent page and the iframe.

Cross-Domain Tracking with Subdomains
Good news: GA4 handles subdomains automatically. If you have www.example.com and blog.example.com, they share the same first-party cookie by default.
However, watch out for these gotchas:
- Cookie domain mismatch — previous implementations may have set cookies on the full subdomain instead of the root domain
- Separate GA4 properties — consolidate into one property first
- Third-party subdomain services — Shopify or HubSpot on your subdomain may not share cookies with your main domain
When in doubt, add the subdomains to your cross-domain configuration anyway. If GA4 detects they share cookies, it won’t append the _gl parameter — no harm done.
Common Mistakes to Avoid
- Forgetting to add the primary domain — you must list ALL domains, including your main one
- Using different Measurement IDs — every domain must use the exact same GA4 Measurement ID
- Not testing after setup — always verify with DebugView
- Ignoring JavaScript-based navigation — GA4 only decorates standard HTML links automatically
- Setting up cross-domain when it’s not needed — subdomains usually don’t need this
- Not excluding payment gateways — always add them to the unwanted referrals list
- Conflicting configurations — pick one place (GA4 admin or GTM) and stick with it
If you’re tracking e-commerce transactions across domains, these mistakes become especially costly. My e-commerce tracking guide covers how to ensure purchase data flows correctly.

FAQ
Does GA4 cross-domain tracking work with Google Ads auto-tagging?
Yes. The _gl parameter carries the GA4 client ID, while gclid carries the click ID. Both coexist in the URL without conflict. Your Google Ads conversion tracking will function normally alongside cross-domain tracking.
How many domains can I link together?
There’s no hard limit, and I’ve seen implementations with 10+ domains working correctly. If you’re linking more than 5 domains, document each one in your tracking plan.
Will the _gl parameter affect my SEO?
No. Google’s crawler understands the _gl parameter and ignores it for indexing. It won’t create duplicate content issues or affect rankings.
It depends on your consent implementation. If a user declines analytics cookies, GA4 won’t set a client ID and cross-domain stitching won’t function for that user. Consent Mode can model some data, but full cross-domain tracking requires cookie consent on both domains.
Can I use cross-domain tracking between GA4 and Universal Analytics?
No. Universal Analytics was sunset by Google in July 2023. Cross-domain tracking only works within the same analytics system. GA4 uses _gl, while UA used _ga.
Next Steps
Once cross-domain tracking is verified and running, your user counts will be more accurate, your attribution will reflect reality, and your funnel analysis will show complete journeys. From here, set up proper event tracking on all domains and document your setup in a tracking plan. Monitor for self-referrals weekly for the first month — they’re the earliest sign that something has broken.
