Fix guides

Redirects drop the gclid and other ad click IDs: how to keep them

Ad platforms add a click ID such as gclid, fbclid, ttclid or msclkid to the landing page URL, and their tags read it from there. If a redirect on the way (http to https, www, a trailing slash, a language or country page) does not keep the query string, the ID is lost and the conversion cannot be tied to the ad click.

Check your own site: the free scan tells you in about a minute whether this problem is on your page.

What the finding means

The scan loaded your page with test values for every platform's click ID (gclid, gbraid, wbraid, fbclid, ttclid, msclkid and others) and looked at the final URL after all redirects. The IDs it names were gone. Conversions from those clicks then show up as unattributed or "direct", and automated bidding learns from fewer conversions.

Find the redirect that drops them

In a terminal, follow the redirects for the exact URL your ads use and look at each Location header:

curl -sIL "http://example.com/landing?gclid=test123" | grep -i '^location'

The step where ?gclid=test123 disappears is the one to fix. Common culprits:

  • http → https or example.com → www.example.com rules in the web server or CDN
  • Adding or removing a trailing slash
  • Language or country redirects (for example / → /en/ or /de/)
  • JavaScript redirects that set location.href to a fixed URL
  • Link shorteners, consent walls and landing page builders that rebuild the URL

Fix it

Make every redirect carry the full query string to the new address:

  • nginx: use $request_uri, which includes the query string: return 301 https://www.example.com$request_uri;
  • Apache: RewriteRule keeps the query string unless the target has its own ?; add the QSA flag when it does.
  • Cloudflare: in Redirect Rules, turn on "Preserve query string".
  • JavaScript redirects: append location.search to the new URL.

Also point your ads at the final URL (with https, the right host and the trailing slash your site uses), so most clicks need no redirect at all.

Check that it works

  1. Open https://your-site/landing?gclid=test123&fbclid=test456 and check that both values are still in the address bar after the page loads.
  2. Run the Plumfinch scan again: the finding should change to "Ad click IDs survive redirects".

Sources

Updated 2026-10-27. Based on the platforms' public documentation; menus and names change, so check the linked pages if a step looks different.