On this page
What this issue is
The gclid (Google Click ID) is a parameter that Google Ads adds to your ad URL when auto-tagging is on, for example https://example.com/?gclid=abc123. Your tags read it from the landing page URL and store it, usually in the _gcl_aw cookie, so a later conversion can be tied back to the click.
- Ad clickURL has ?gclid=abc123
- Redirect to www / httpsRule sends to a fixed URL without the query string
- Landing pageURL has no gclid
- ConversionCannot be matched to the click
The redirect drops the query string before the page and its tags ever see the gclid.
Why it costs you leads or sales
Example: 100 real leads from ads in a month. With the redirect stripping the gclid, far fewer are credited to the campaign.
How to check if your site has it
Build a test URL for each variant
Take your landing page and add a fake gclid, for example http://example.com/?gclid=test123&utm_source=test. Make one version for each variant you might redirect from: http, https, with www and without www.
Open it in a private window
Paste the URL and press Enter. Look at the address bar once the page has loaded.
Check the final URL
If the address still ends in ?gclid=test123&utm_source=test, the redirect is fine. If it ends at the path with nothing after it, the redirect is stripping the parameters.
See each hop with curl
Run the command below and read the Location header of every response. A Location without the query string shows exactly which rule drops it.
curl -sIL "http://example.com/?gclid=test123&utm_source=test" | grep -i -E "^(HTTP|location)"How to fix it
Find the rule
Check your redirect or SEO plugin (for example under Tools or the plugin's Redirects menu), your host's control panel, and the .htaccess file. Look for rules that send to a fixed https or www URL.
Use the htaccess version
Replace the rule with the .htaccess code shown in the Custom code tab. Apache keeps the query string by default when the target uses %{REQUEST_URI}.
Check the site address
In Settings > General, make sure WordPress Address and Site Address use the same https and www form you want.
Set the primary domain
Go to Settings > Domains and pick the primary domain. Shopify then handles http to https and the www redirect itself, and keeps the query string.
Review URL redirects
Under Content > Menus > View URL Redirects (or Online Store > Navigation), check that no manual redirect points at a fixed URL for your landing pages.
Update ad final URLs
Use your primary domain in the ads so no redirect is needed.
Set the default domain
In Project settings > Hosting, choose the default domain (www or non-www) and turn on Force SSL. Webflow redirects the other version and keeps the query string.
Check 301 redirects
In Hosting > 301 redirects, make sure rules for landing pages are not sending paths to a fixed URL. Test one after each change.
Set the primary domain
In Domains, set the primary domain so the other version redirects to it. Wix handles https automatically.
Test the result
Use the curl command to see whether your Wix redirect keeps the gclid. If it does not, point ad final URLs straight at the primary domain, and contact Wix support.
Set the primary domain
In Settings > Domains, select the primary domain and keep SSL on. Squarespace redirects the other version.
Check URL Mappings
In Settings > Developer Tools > URL Mappings, check that no rule sends landing pages to a fixed address. Use the final URL in your ads.
Check the domain setup
In your funnel or website settings, confirm the custom domain is connected and which version (www or not) is the main one.
Check path redirects
Look at any URL redirects set in the funnel or site settings. Point ad final URLs straight at the live domain so no redirect is needed, then test with the curl command.
Know the limit
GTM runs after the page loads, so it cannot rescue a gclid that a server redirect already removed. The fix must be in the redirect or in the ad final URL.
Confirm the Conversion Linker
Once the redirect keeps the gclid, check that your Conversion Linker tag fires on all pages so the gclid is stored in a cookie.
Apache (.htaccess)
Use one rule that goes straight to the final https www URL. See the .htaccess snippet below.
Nginx
Use $request_uri in the return statement, as in the Nginx snippet below. Avoid a fixed destination.
Avoid redirect chains
One hop is better than two. Every extra hop is another chance to drop parameters.
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]server {
listen 80;
server_name example.com www.example.com;
return 301 https://www.example.com$request_uri;
}
server {
listen 443 ssl;
server_name example.com;
# ssl_certificate lines here
return 301 https://www.example.com$request_uri;
}Before
- http://example.com/?gclid=abc redirects to https://www.example.com/
- Landing page URL has no gclid
- Conversion cannot be matched to the click
After
- http://example.com/?gclid=abc redirects to https://www.example.com/?gclid=abc
- Tags read and store the gclid
- Conversion is credited to the campaign
Ad click → yoursite.com/offer?gclid=Cj0KCQ…&utm_source=google&utm_campaign=spring
301 redirect
Lands on → yoursite.com/offer/
- gclid
- utm_source
- utm_campaign
The visitor lands on a URL without gclid or UTMs. Google Ads cannot match the conversion to the click.
Toggle the redirect behaviour to see what reaches your landing page.
How to confirm it's fixed
- Each test URL (http and https, www and non-www) ends with the same gclid and UTMs after redirecting
- curl shows a Location header that includes the query string at every hop
- There is only one redirect hop
- The _gcl_aw cookie appears in your browser's cookies after you land with a test gclid
- Ad final URLs use the canonical https address
- A test conversion shows up in Google Ads or Tag Assistant with the click ID attached
How to prevent it happening again
How FunnelGuard handles this
Questions people ask
Why is my gclid missing after a redirect?
A redirect rule probably sends visitors to a fixed URL without the query string. The gclid sits in the query string, so it is dropped on the way. Change the rule to keep the full request URI, or point your ads at the final URL.
Does an http to https redirect remove the gclid?
It can, if the rule is written with a fixed destination or discards the query string. A correctly written rule keeps it. Test with a URL like http://yoursite.com/?gclid=test123 and see whether it survives.
How do I test if my redirect keeps the gclid?
Add a fake gclid to your landing page URL, open it in a private window and check the address bar after loading. For more detail, run curl -sIL on the URL and read each Location header. If the query string is gone at any hop, that rule is the problem.
Can Google Tag Manager fix a stripped gclid?
No. GTM runs in the browser after the page loads, so it cannot recover a parameter that a server redirect already removed. The fix has to be in the redirect rule or in the ad final URL.
Does a stripped gclid stop leads from arriving?
No. The forms and checkouts still work. You lose the link between the lead and the ad click, so Google Ads reports fewer conversions and bidding has less data.
Should my ad final URL include www and https?
Yes. Use the exact canonical address your site ends on, so ad traffic never needs a redirect. This removes the most common place where parameters are lost.
Does the same problem affect UTM parameters?
Yes. UTMs are also in the query string, so the same redirect strips them. Fixing the redirect protects both, which helps your analytics as well as Google Ads.
How can I monitor this automatically?
FunnelGuard checks UTM and click-id persistence on a schedule. It visits your landing page with tagged test parameters, follows redirects, and alerts you with a screenshot and likely cause if they are lost.
Related issues
- TRK-145gclid stripped by trailing-slash or language redirectFix guide
- TRK-146gclid stripped by cookie banner reloadFix guide
- TRK-143_gcl_aw cookie not set after gclid landingFix guide
- TRK-147gbraid / wbraid not preserved (iOS traffic)Fix guide
- TRK-148gclid not stored in hidden form field / CRMFix guide
- TRK-149Auto-tagging off in Google Ads (no gclid on clicks)Fix guide