Setting Up Cross-Domain Tracking in GA4
If users travel between your domains and you see a spike in referral traffic from your own site, you need cross-domain tracking.
AttriModel Team
AttriModel Team
The Problem: Session Fragmentation
When a user moves from your marketing site (example.com) to your checkout domain (shop.example.com), GA4 starts a new session and attributes the visit to "referral" from example.com. This breaks your funnel data and inflates referral traffic from your own properties.
When You Need Cross-Domain Tracking
- Your checkout is on a different subdomain or domain
- You use a booking platform (Calendly, Acuity) that redirects back
- You have a separate app domain and a marketing site
- You use a payment processor that redirects through their domain
GA4 Configuration
In GA4, go to Admin → Data Streams → your web stream → Configure tag settings → Configure your domains.
Add all domains that should be treated as one property:
- example.com
- shop.example.com
- checkout.example.com
Click Save. GA4 will now share the _ga cookie parameter across these domains via URL decoration.
GTM Alternative
If you manage your tag via GTM, add cross-domain tracking in your Google Tag configuration:
- Find your Google Tag in GTM (the base GA4 tag)
- Add configuration setting: "linker domains"
- Value: shop.example.com, checkout.example.com
Testing Cross-Domain Tracking
- Enable GTM Preview or use Google's Tag Assistant
- Navigate from your main site to the cross-domain destination
- Check the URL — it should contain a ?_gl= parameter with a session identifier
- In GA4 DebugView, confirm the session continues without a new session start
Common Issues
Referral exclusion: Also add your domains to the referral exclusion list (Admin → Data Streams → Referral Exclusions) as a belt-and-suspenders approach.
iFrame embeds: Forms embedded in iFrames from another domain require additional JavaScript communication — contact the form provider for cross-domain support.
Link decoration blocked: Some browsers or security policies strip URL parameters. Server-side cross-domain tracking solves this but requires more setup.