How do I fix GA4 cross-domain tracking not working?
The Short Answer
Cross-domain tracking fails when the `_gl` linker parameter is lost during a redirect, omitted by a button's JavaScript, or when domains aren't properly listed in the GA4 Data Stream settings.
The Context
If you run an e-commerce store on Shopify but use a separate landing page builder (like ClickFunnels or Unbounce) on a different domain, cross-domain tracking is mandatory. Without it, a user who clicks from your landing page over to your checkout is treated as a brand new session originating from a "Referral".
This completely breaks the user journey. The original ad source (Facebook, Google Ads) gets zero credit for the purchase, and your "Referral" traffic channel skyrockets artificially.
The 3 Most Common Root Causes
1. The Domains Aren't Linked in Admin Settings Unlike Universal Analytics where you had to configure dimensions in tag manager, GA4 handles cross-domain tracking directly from the Google Analytics interface. If both domains are not explicitly listed in the web stream settings, GA4 will not append the required linker ID.
2. Redirects Stripping the _gl Parameter
When a user clicks a cross-domain link, GA4 instantly appends a massive query string starting with ?_gl=1*... to the URL. If the receiving server enforces a strict redirect (e.g. forcing trailing slashes or redirecting HTTP to HTTPS) without explicitly preserving query parameters, the ID is destroyed in transit.
3. JavaScript and Custom Buttons
GA4's auto-linker only watches standard HTML <a> tags by default. If your "Buy Now" button uses a custom JavaScript window.location redirect or a framework like React Router rather than a standard href, GA4 will not fire the linker listener.
How to fix it:
- 1
Configure Settings: Go to your GA4 Admin > Data collection and modification > Data streams. Click your web stream. Click 'Configure tag settings', then 'Configure your domains'. Add every single domain your users pass through (e.g.
contains yoursite.com,contains checkout.com). - 2
Test the Click: Go to your staging site and physically click the link pointing to the second domain. Look at the URL bar immediately after the page loads. You must see the
_gl=parameter. If you do not, your server is stripping it or the link isn't a standard anchor tag. - 3
Check the GA4 Cookie: Open Chrome Developer tools (F12) > Application > Cookies. Look at the
_gacookie on Domain A, then jump to Domain B and check the_gacookie. The values must be perfectly identical. If they are different, cross-domain tracking has failed. - 4
Run an Automated Cross-Domain Audit: Put your URL into our GA4 Audit Tool. Our engine automatically detects cross-domain boundary events and verifies whether the linker parameters survive the hop.
Want to check this automatically?
Instead of clicking through settings yourself, let our engine audit your GA4 Property for this exact issue (and 30 others) in 60 seconds.
Scan your setup with our Google Analytics 4 Audit Tool