Skip to content
FunnelGuard

Fix guide by FunnelsGuard

gclid stripped by trailing-slash or language redirect: fix

TRK-145High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

When someone clicks a Google ad with auto-tagging on, Google adds ?gclid=... to your landing page URL. Your Google tag reads that value and saves it in a first-party cookie (_gcl_aw) so a later conversion can be credited to the click.

Two common redirects break this. The first sends /pricing to /pricing/ (or the reverse). The second sends visitors from /pricing/ to /en/pricing/ or /de/pricing/ based on browser language or location. If the rule is written badly, the new URL has no query string. The gclid is gone before the page loads.

Where the gclid is lost
  1. Ad click/pricing?gclid=abc123
  2. Redirect301 to /en/pricing/ with no query string
  3. Landing pageGoogle tag finds no gclid
  4. ConversionNot matched to the click

The redirect fires before any tag can read the URL.

Why it costs you leads or sales

The leads still arrive, but Google Ads does not see them as coming from your ads. Reported conversions fall, cost per conversion looks worse, and Smart Bidding learns from less data. It may then lower bids on the very campaigns that work. UTM parameters are often lost in the same redirect, so your analytics shows the traffic as direct.

The problem is easy to miss. Pages load, forms submit and the thank-you page appears. Only the attribution breaks.

Conversions Google Ads can seeExample numbers
Conversions Google Ads can see (example)Real leads: 50 conversions per week; Reported in Ads (redirect OK): 44 conversions per week; Reported in Ads (gclid stripped): 9 conversions per week0193850449Real leadsReported in Ads (redi…Reported in Ads (gcli…conversions per week

Example: the same 50 real leads, before and after a redirect starts stripping the gclid.

A redirect drops the click ID

The visitor lands on the final URL without the gclid.

How to check if your site has it

Test your landing pages by hand
  1. Build a test URL

    Take a real landing page and add ?gclid=test123&utm_source=test. Try it with and without the trailing slash, for example /pricing?gclid=test123 and /pricing/?gclid=test123.

  2. Load it in a private window

    Open the URL and look at the address bar once the page has loaded. If gclid=test123 is missing, a redirect removed it.

  3. Test the language paths

    Repeat for the root URL and for each language version. Change the browser language if your site redirects by language.

  4. Trace the hops

    Run the command below. Check that every location: header still contains the query string.

Follow every redirect and print the Location headersbash
curl -sIL "https://example.com/pricing?gclid=test123" | grep -iE "^(HTTP|location)"

How to fix it

The goal is one redirect, to the final URL, that keeps the query string. Fix the rule where it lives. It may be in your server config, a CMS plugin, a CDN, a language plugin or a hosting panel. Also remove chains such as http to https to www to trailing slash to language, since each hop is another chance to lose parameters.

Keep the query string on redirects
  1. Find the redirect source

    Check redirect plugins (Redirection, Rank Math, Yoast Premium), your language plugin (WPML, Polylang, TranslatePress) and any caching or security plugin with redirect options.

  2. Turn on query-string passing

    In Redirection, edit the rule and set Query Parameters to 'Pass-through'. In language plugins, check the browser-language redirect settings and update the plugin if parameters are dropped.

  3. Fix the permalink slash

    Under Settings, Permalinks, keep the structure consistent. WordPress normally keeps the query string when it adds a trailing slash, so a custom rule is likely the culprit.

Apache: add a trailing slash and keep the query stringhtaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ /$1/ [R=301,L,QSA]
nginx: language redirect that keeps parametersnginx
location = /pricing/ {
    return 301 /en/pricing/$is_args$args;
}
Redirect behaviour

Before

  • /pricing?gclid=abc redirects to /en/pricing/
  • Query string dropped
  • No _gcl_aw cookie
  • Conversion not matched to the ad

After

  • /pricing?gclid=abc redirects to /en/pricing/?gclid=abc
  • Query string kept
  • _gcl_aw cookie saved
  • Conversion matched to the ad click
Try the redirectInteractive
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 landing page loads without the gclid, so no _gcl_aw cookie is saved and the conversion cannot be tied to the ad click.

Toggle to see how one redirect rule changes attribution.

How to confirm it's fixed

Confirmation checks
  • Test URLs with ?gclid=test123 load with the gclid still in the address bar, with and without the trailing slash
  • Each language version keeps the parameter
  • The curl output shows a single hop, with the query string in every Location header
  • A _gcl_aw cookie appears after landing
  • In GTM Preview or the Tag Assistant, the Google tag and Conversion Linker fire on the landing page with the gclid present
  • A real test conversion later shows in Google Ads, which can take some hours

How to prevent it happening again

Habits that keep it fixed
  • Test a gclid URL after every change to redirects, language plugins, CDN rules, domains or permalinks
  • Use the final canonical URL in every ad
  • Keep redirects to one hop
  • Ask agencies and plugin vendors whether redirects pass the query string
  • Re-test after site migrations and relaunches
How it usually happens
  1. Day 1

    A language plugin or new redirect rule is added.

  2. Day 1

    Pages load fine, so nobody notices anything wrong.

  3. Week 1

    Google Ads conversions drop and cost per lead rises.

  4. Week 2

    The redirect is found and fixed to keep the query string.

How FunnelGuard handles this

FunnelGuard detects this issue today. Its robot visitor loads your landing pages on a schedule, with a click ID and UTM parameters on the URL, and checks whether they survive any redirect to the final page. It also checks the tracking hits sent to Google Ads and other platforms. If a failure shows up, it is re-checked from a second region before one alert goes out, with a screenshot and a likely cause.

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 and no card. Paid plans have a 3-day free trial.

Questions people ask

Why is my gclid missing after the page loads?

Most often a redirect dropped the query string. Trailing-slash, www, https and language redirects can all do this. Test your landing page with ?gclid=test123 added and see if it is still in the address bar.

Does a trailing-slash redirect remove the gclid?

It can if the rule is written without passing the query string. Apache needs the QSA flag, and nginx needs $is_args$args in the target. Many CMS platforms keep the query string by default, but custom rules often do not.

How do I stop a language redirect from removing UTM parameters and gclid?

Change the redirect so it copies the full query string to the new URL. In a plugin, look for a query-parameter pass-through option or update the plugin. Better still, send ads straight to the final language URL so no redirect happens.

How can I test whether my redirect keeps the gclid?

Open your page with ?gclid=test123 added in a private window and check the address bar after loading. You can also run curl -sIL on the URL and check that every Location header keeps the query string.

What happens to Google Ads conversions if the gclid is lost?

Leads still come in, but Google Ads cannot connect them to the ad click. Reported conversions drop and Smart Bidding gets weaker data. Your analytics may also show the traffic as direct.

Can Google Tag Manager fix a gclid lost in a server redirect?

No. A server-side redirect happens before the page and GTM load, so the tag never sees the gclid. You have to fix the redirect rule, or link ads to the final URL.

Does FunnelGuard detect a stripped gclid?

Yes. It loads your landing pages with test parameters on a schedule and checks whether they survive redirects. It re-checks failures from a second region before alerting you.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

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.