On this page
What this issue is
When a visitor clicks from your main site to another domain you own or use (a booking tool, a checkout, a separate shop), Google tags can add a _gl parameter to the link. It carries the visitor's GA4 client ID and session details. The page on the other side reads it and carries on with the same visitor instead of starting a new one.
- Ad clickVisitor lands on your main site with gclid and UTMs
- Link to booking domainGoogle tag adds ?_gl=... to the link
- Destination redirect301 or 302 drops the query string
- Tag reads _glNothing to read, so a new client ID is created
- ConversionCredited to direct or the booking tool, not the ad
The link is built correctly, but the redirect on the destination removes the parameter.
Why it costs you leads or sales
The booking or purchase still happens, so you may not notice anything wrong. But GA4 sees two visitors: one who clicked the ad and left, and one who arrived from nowhere and converted. The conversion is credited to direct traffic or to a referral from your own site.
Example: illustrative numbers for 100 real conversions from paid search, before and after the redirect is fixed.
How to check if your site has it
Open your main site in a private window
Use a URL with test UTMs, for example ?utm_source=test&utm_medium=cpc. Accept cookies so the tags run.
Click the link to the other domain
Before the page finishes loading, look at the address bar. A working link contains _gl=... in the URL.
Check the final address
If the page loads but the address no longer contains _gl, a redirect removed it.
Trace the redirect chain
Open DevTools, go to the Network tab, tick Preserve log and reload. Look at each 301 or 302 and its Location header. Does it include the query string?
Compare the client ID
In GA4 DebugView, or in the Network tab on a request to google-analytics.com, check that the cid value is the same on both domains.
curl -sIL "http://book.example.com/?_gl=1*test*&utm_source=test" | grep -iE '^(HTTP|location)'If a location: line in the output lacks _gl=, that hop is the one stripping it.
How to fix it
There are two routes. The best one is to remove the redirect from the link, so the visitor lands on the final URL straight away. If the redirect must stay, change it so it passes the query string on.
Link to the final URL
Use the exact https, correct host (www or not) and trailing-slash version that loads without redirecting. Update the links on your site that point to the other domain.
Find every redirect on the destination
Check the host or CDN, the server config, a redirect plugin or app, and any language or login rule.
Make each redirect keep the query string
Use the platform settings below.
Check the cross-domain setup
In GA4 go to Admin > Data streams > your stream > Configure tag settings > Configure your domains, and make sure the destination domain is listed.
Retest
Repeat the manual check and confirm _gl is still in the final address.
Nginx
Use $request_uri (or $is_args$args) in the return: return 301 https://www.example.com$request_uri;
Apache .htaccess
Add RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L,QSA]. Without the target containing a ?, Apache keeps the original query string by default. Do not add a trailing ? to the target, because that clears it.
Redirect plugin
In your redirect plugin, look for an option such as pass-through or ignore query parameters and set it to pass them to the target. Plugins differ, so check the setting name in yours.
Site address
Under Settings > General, make sure WordPress Address and Site Address use the final https and www form, so core does not add a redirect.
URL redirects
Under Online Store > Navigation > URL Redirects, a redirect target that is a fixed path will not carry extra parameters in every case. Avoid adding redirects for pages that receive _gl links, and link to the live URL.
Primary domain
Under Settings > Domains, set the primary domain you link to, so visitors are not bounced between domains.
301 redirects
Under Site settings > Publishing > 301 redirects, avoid rules on pages that receive _gl links. Link to the final published URL.
Default domain
Under Hosting, pick the default domain (www or root) and link to that one.
Link to the primary domain
Under Domains, set the primary domain and link to it, so no connected-domain redirect runs.
URL redirect manager
Under SEO > URL redirect manager, avoid rules for pages that receive _gl links.
Primary domain
Under Settings > Domains, set the primary domain and link to that exact version.
URL mappings
Under Settings > Developer tools > URL mappings, avoid mappings on pages that receive _gl links.
Funnel and domain
Link to the funnel step's live custom-domain URL, not to an older domain or a path that forwards.
Step path
Avoid renaming step paths after links are published, since old paths may redirect.
Configure domains
In your Google tag, add the destination domain under Configure your domains (or the cross-domain settings in the tag), so _gl is added to the link.
Tag on both sides
Make sure the destination also runs the same GA4 Measurement ID so it can read _gl.
Before
- Link goes to http://book.example.com/?_gl=...
- Server redirects to https://www.book.example.com/ with no query string
- GA4 starts a new session
After
- Link goes straight to https://www.book.example.com/?_gl=...
- No redirect, or a redirect that keeps the query string
- GA4 continues the same session
How to confirm it's fixed
- The final address after the click still contains _gl=
- The curl command shows every location: header keeping the query string
- GA4 DebugView shows the same client ID on both domains
- A test conversion on the destination is credited to the original source and medium
- The destination domain no longer shows up as a referral in your reports
How to prevent it happening again
- Link to final URLs, not to versions that redirect
- Re-test the cross-domain click whenever you change domains, hosting, a CDN rule, a redirect plugin or a booking tool
- Keep a list of every domain in the journey and the redirects on each
- Ask developers to use query-string-preserving redirect rules by default
- Run the full journey on a schedule so a new redirect is caught within a day, not after a month of bad data
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real journey on a schedule, follows the click to the other domain and checks whether the linker parameter is still on the page you land on. It also checks the tracking hits sent to GA4 and other platforms at each step. If a check fails, it is re-checked from a second region before one alert goes out with a screenshot and a likely cause.
Test traffic is marked with utm_source=funnelguard and fg_test=1, never clicks real ads and stops before payment. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
Why is my _gl parameter missing after a redirect?
A redirect on the destination domain is probably sending visitors to a new address without the query string. This often happens with http to https, www to non-www, trailing-slash, language or login redirects. The tag on the page then finds no _gl value and starts a new session.
What is the _gl parameter in Google Analytics?
It is a cross-domain linker parameter that Google tags add to links between your domains. It carries the visitor's client ID and session data so GA4 can treat both sites as one visit.
How do I stop a redirect removing query parameters?
Change the redirect rule so it passes the query string on, for example using $request_uri in Nginx or the QSA flag in Apache rewrite rules. Better still, link directly to the final URL so no redirect runs.
How can I tell if a redirect is stripping _gl?
Click the cross-domain link and watch the address bar, or run curl -sIL on the link and read each location header. If the first URL has _gl and the final one does not, a redirect removed it.
Why does my booking tool show as a referral in GA4?
Often because the linker value was lost, so GA4 treats the arrival from your site as a new visit with your site as the referrer. Check that the domain is listed in your cross-domain settings and that no redirect removes _gl.
Is a missing _gl the same as cross-domain tracking not being set up?
No. If the link never contains _gl, the setup is missing or wrong. If the link has _gl but the final page does not, a redirect or script after the click removed it.
Can FunnelGuard detect a stripped _gl parameter?
Yes. FunnelGuard runs your real journey on a schedule and checks whether the linker parameter survives the click to the other domain. A failure is re-checked from a second region before you get an alert.
Related issues
- TRK-314Cross-domain _gl linker parameter not appendedFix guide
- TRK-316Cross-domain domains list missing the booking toolFix guide
- TRK-313UTMs lost crossing to checkout / booking domainFix guide
- TRK-311UTMs lost on redirect (http->https, www, trailing slash)Fix guide
- TRK-334Server redirects drop query string (301 to /)Fix guide
- TRK-327Thank-you page on another domain starts new sessionFix guide