Skip to content
FunnelGuard

Fix guide by FunnelsGuard

gclid stripped by redirect to www or https: how to fix it

TRK-144High impactDetectedBy FunnelGuardPublished Updated
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.

Where the gclid is lost
  1. Ad clickURL has ?gclid=abc123
  2. Redirect to www / httpsRule sends to a fixed URL without the query string
  3. Landing pageURL has no gclid
  4. 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

Conversions Google Ads can seeExample numbers
Conversions Google Ads can see (example)Real leads from ads: 100 conversions; Reported with gclid stripped: 35 conversions; Reported after fix: 95 conversions038771003595Real leads from adsReported with gclid s…Reported after fixconversions

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

Test the redirect by hand
  1. 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.

  2. Open it in a private window

    Paste the URL and press Enter. Look at the address bar once the page has loaded.

  3. 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.

  4. 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.

Show every redirect hopbash
curl -sIL "http://example.com/?gclid=test123&utm_source=test" | grep -i -E "^(HTTP|location)"

How to fix it

Keep the query string in the redirect
  1. 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.

  2. 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}.

  3. Check the site address

    In Settings > General, make sure WordPress Address and Site Address use the same https and www form you want.

Apache: one redirect to https + www, query string kepthtaccess
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
Nginx: redirect with the full request URInginx
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;
}
Redirect behaviour

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
Does the redirect keep the click ID?Interactive
Redirect strips the query string

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

Fix verification
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: utm and click-id persistence.

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.