Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Cross-domain _gl linker parameter not appended: how to fix it

TRK-314High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

When a visitor moves from www.example.com to another domain, such as checkout.example-shop.com or a hosted booking page, browser cookies do not travel with them. Cookies belong to one domain. Google Analytics 4 (GA4) solves this with a linker parameter called _gl. The Google tag adds it to the link URL, and the tag on the next domain reads it and reuses the same client ID.

Where the journey breaks
  1. Ad clickVisitor lands with gclid and UTMs
  2. Landing pageSession starts, source recorded
  3. Link to checkout domainNo _gl added to the URL
  4. Checkout / bookingNew client ID, new session
  5. Purchase or bookingCredited to direct or referral

The link to the second domain has no _gl, so everything after it is attributed to the wrong source.

Why it costs you leads or sales

It also affects ad platforms. If Google Ads imports GA4 conversions, the lost session means fewer conversions reach the bidding algorithm, which gets less data to learn from.

The source disappears at the domain jump

The visitor arrives with a source, crosses to another domain without _gl, and arrives as a stranger.

Purchases credited to paid searchExample numbers
Purchases credited to paid search (example)Without _gl: 18 purchases; With _gl: 92 purchases035711892Without _glWith _glpurchases

Example: the same 100 paid-search purchases reported before and after the linker is fixed. Numbers are illustrative.

How to check if your site has it

Test it by hand in two minutes
  1. Open your landing page in a clean window

    Use a private window and add a test tag such as ?utm_source=test&utm_medium=check to the URL. Accept cookies if a banner appears, because the linker usually waits for analytics consent.

  2. Click the link to the other domain

    Click your Buy, Book now or Apply button that leads to the checkout, booking or form domain.

  3. Read the address bar

    Look for _gl= followed by a long string. If it is missing, the linker did not run on that link.

  4. Check GA4 in Realtime or DebugView

    If the visit shows as a new user with no source on the second domain, the client ID was not carried over.

  5. Check the settings

    In GA4 go to Admin > Data streams > your web stream > Configure tag settings > Configure your domains. Every domain the visitor passes through must be listed.

How to fix it

The fix is the same in principle everywhere: tell the Google tag which domains belong together, and make sure the tag is on both domains. The place you do it depends on how your tags are installed.

Add the cross-domain setting
  1. Open your Google tag

    In Tags, open the Google tag (or the GA4 Configuration tag) that fires on all pages.

  2. Add the domains

    Under Configuration settings, add the parameter linker with the domains, or use Shared settings > Configure your domains. Add each domain, for example example.com and book.example-tool.com.

  3. Enable URL decoration if needed

    Turn on Decorate forms only if you have GET forms that go to another domain.

  4. Preview and publish

    Use Preview mode, click through to the other domain, confirm _gl is in the URL, then publish.

gtag.js with a cross-domain linkerhtml
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
  gtag('set', 'linker', {
    'domains': ['example.com', 'book.example-tool.com'],
    'accept_incoming': true
  });
</script>

How to confirm it's fixed

Confirmation checks
  • The link to the other domain now contains _gl= in the address bar.
  • GA4 DebugView shows the same client ID on both domains.
  • The conversion on the second domain is credited to the original source and medium, not direct or your own domain.
  • Your own domains do not appear in the Traffic acquisition report as referrals.
  • The test works for every entry point: header link, button, embedded widget and any form.

How to prevent it happening again

This breaks when someone adds a new booking tool, changes the checkout domain, switches tag manager or edits the consent setup. Keep a short list of all domains in the funnel and review it whenever one changes.

Prevention routine
  • Keep a list of every domain a customer can pass through, from ad click to thank-you page.
  • Update Configure your domains and referral exclusions whenever a new domain is added.
  • Re-test the journey after changes to GTM, the theme, the consent banner or the booking or checkout tool.
  • Check that the tag is installed on the destination domain too.
  • Run an automated check on a schedule instead of relying on spot checks.

How FunnelGuard handles this

FunnelGuard detects this issue today. A robot visitor runs your real journey on a schedule, follows the link to the second domain and checks whether the cross-domain _gl parameter is present on the outgoing URL. If it is missing, the check fails.

A failure is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. The check finds that the parameter is missing; you still make the settings change yourself. Test traffic is marked (utm_source=funnelguard, fg_test=1) and never clicks real ads. The Free plan covers 1 site and 2 journeys with daily checks, no card needed, and paid plans have a 3-day free trial.

Questions people ask

What is the _gl parameter in Google Analytics?

The _gl parameter is a linker parameter that Google's tags add to URLs when a visitor moves between domains. It carries the client ID so GA4 can treat both visits as one session. Without it, the second domain starts a new visitor.

Why is my _gl parameter not showing in the URL?

The usual reasons are that the destination domain is not listed under Configure your domains, the Google tag was not loaded when the link was clicked, or the visitor has not granted analytics consent. Forms that submit by POST also cannot carry it. Check the domain list first.

How do I set up cross-domain tracking in GA4?

In GA4, go to Admin > Data streams > your web stream > Configure tag settings > Configure your domains and add every domain. Make sure the same GA4 tag runs on all of them. Then click through and check that _gl appears in the URL.

Why does my checkout domain show as a referral in GA4?

This happens when the session restarts on the checkout domain because the client ID was not passed. GA4 then sees the visit coming from your main site. Fix the cross-domain setting and add the domains to the list of unwanted referrals.

Does the _gl parameter work if the visitor rejects cookies?

Not reliably. If analytics storage is denied, the Google tag does not set the identifiers it needs, so the linker may not add useful values. This is expected and depends on your consent setup.

Can I use _gl with a form that posts to another domain?

No, a POST form does not put parameters in the URL, so the linker cannot decorate it. You can switch the form to GET if that is safe, or pass the client ID in a hidden field.

How can I monitor whether _gl is still being added?

You can test by hand after every change, or use synthetic monitoring. FunnelGuard runs your journey on a schedule and checks whether _gl is present on the link to the other domain, then alerts you if it is not.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: cross_domain.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.