On this page
What this issue is
Ad platforms add query parameters to your link, such as ?utm_source=google&utm_campaign=spring or ?gclid=abc123. Your analytics and ad tags read them from the page address when the visitor lands.
Caching layers sit between the visitor and your site. Some are set to ignore the query string so one cached copy serves every URL, and some redirect to a clean URL to do it. If that redirect drops the parameters, or the cache rule rewrites the address, the tags never see the campaign data.
Why it costs you leads or sales
When parameters vanish, paid clicks are credited to direct traffic or the wrong channel. Conversions can't be matched to the campaign, so reports undercount ad results, and Google Ads can't import offline or click-based conversions that rely on gclid.
The result is bad decisions: you cut campaigns that work, or bidding algorithms learn from incomplete data. The site looks fine to visitors, so nobody notices for weeks.
- Ad clickURL has ?gclid and utm_*
- CDN / cacheRedirects to clean URL
- Landing pageURL has no parameters
- Analytics and ad tagsVisit logged as direct
The cache or redirect removes the query string before the tags run.
Example: share of paid clicks attributed to their campaign before and after fixing a cache rule.
How to check if your site has it
Build a test URL
Add parameters to your landing page, for example https://example.com/landing?utm_source=test&utm_medium=cpc&utm_campaign=cachecheck&gclid=TEST123
Open it in a private window
Watch the address bar after the page loads. If the parameters disappear or the URL changes, something is redirecting or rewriting it.
Check the response headers
In browser DevTools, open Network, click the first request and look for a 301 or 302 status and a Location header. Also look at cf-cache-status, x-cache or x-litespeed-cache.
Check the tags
In GA4 DebugView or the Network tab, confirm the page_view hit includes the campaign values (look for dl= with the full URL, or the campaign fields).
curl -sI "https://example.com/landing?utm_source=test&gclid=TEST123" | grep -iE "^(HTTP|location|cf-cache-status|x-cache)"How to fix it
The goal: the visitor's browser must still have the full URL when your tags run. A cache can ignore query strings for its cache key, which is fine, as long as it does not redirect or rewrite the address.
Open your caching plugin settings
In WP Rocket, check Advanced Rules > Cache Query Strings and the Never Cache URL list. In LiteSpeed Cache, review Cache > Excludes > Drop Query String, and remove utm_* and gclid from any strip list that redirects.
Do not redirect to a clean URL
Plugins that 'ignore' marketing parameters should serve the cached page and leave the address alone. If a setting redirects, turn it off.
Purge the cache
Clear the plugin cache and any host-level cache, then retest.
Check apps and redirects
Under Content > Menus > View URL redirects, and in any speed or CDN app, make sure no rule redirects landing pages to a version without the query string.
Check a proxy in front of the store
If you put Cloudflare or another CDN in front of a custom domain, apply the Cloudflare steps in the Custom code tab.
Review redirects
In Site settings > Hosting > 301 redirects, check that no rule sends landing pages to a clean path. Webflow passes the query string through on normal pages.
Check any CDN in front
If you use Cloudflare proxying, review its Cache Rules and Redirect Rules.
Confirm the page URL variable
In Preview mode, open Variables and check Page URL still contains the parameters when the Container Loaded event fires.
Do not fix cache problems in GTM
If the URL is already clean on load, the cause is upstream. Fix the cache or redirect rule, not the tag.
Cloudflare: review Cache Rules
In Caching > Cache Rules, avoid rules that rewrite or redirect URLs. Setting the cache key to ignore query strings is fine. Also check Rules > Redirect Rules and Transform Rules for 'Remove query string'.
Nginx or Apache: keep the query string on redirects
Use $request_uri in Nginx, or the QSA flag in Apache rewrite rules, so redirects carry the parameters.
Varnish or other cache
If you strip tracking parameters from the cache key, do it in the hash only and keep the original URL for the browser.
location = /old-landing {
return 301 /new-landing$is_args$args;
}RewriteEngine On
RewriteRule ^old-landing/?$ /new-landing [R=301,L,QSA]Broken
- Cache redirects /landing?gclid=... to /landing
- Tags see a URL with no parameters
- Paid visits show as direct
Fixed
- Cache serves one copy but leaves the URL unchanged
- Tags read utm_* and gclid on load
- Visits credited to the right campaign
How to confirm it's fixed
- A tagged URL keeps its full query string in the address bar after loading
- curl shows no redirect, or a redirect whose Location includes the parameters
- GA4 DebugView shows the right source, medium and campaign
- The gclid reaches Google Ads tags (check the Network tab for the conversion hit)
- Test a second time on a cached response (cf-cache-status: HIT) so you know the cached copy behaves too
How to prevent it happening again
Cache and redirect settings change quietly: a plugin update, a new CDN rule, a host migration. Keep a short note of which layer handles query strings. After any change to caching, redirects or the CDN, rerun a tagged-URL test on your main landing pages.
How FunnelGuard handles this
FunnelGuard detects this today. Its robot visitor lands on your page with marked test parameters (such as utm_source=funnelguard) and checks whether they are still present when the journey runs and when tracking hits go out. If the parameters are lost along the way, the utm_lost check fails.
A failure is re-checked from a second region, then you get one alert (email, Slack, Teams, WhatsApp, webhook or PagerDuty) with a screenshot and a likely cause. The Free plan covers 1 site and 2 journeys with daily checks and no card. A free read-only website audit is also available.
Questions people ask
Why are my UTM parameters not showing in Google Analytics?
Often something between the ad click and your page removes them, such as a CDN redirect, a caching plugin or a URL rewrite rule. Load a tagged URL in a private window and see whether the query string survives. If it disappears, fix the redirect or cache rule.
Does Cloudflare strip UTM parameters?
Cloudflare does not strip them by default. A Redirect Rule, Transform Rule or Worker that removes or rewrites the query string can. Ignoring the query string in the cache key is fine, as long as the visitor's URL stays unchanged.
Why is my gclid missing from the landing page URL?
A redirect or cache rule is probably dropping it before the page loads. Check with curl -I and look at the Location header. Also check that auto-tagging is on in Google Ads.
How do I stop a caching plugin removing tracking parameters?
Open the plugin's query string settings and remove utm_* and gclid from any list that triggers a redirect or strips the URL. Then purge the cache and test again with a tagged link.
Is it safe for a cache to ignore UTM parameters?
Yes, if it only ignores them when choosing which cached copy to serve. That lets all campaign links share one page. It becomes a problem when the cache redirects or rewrites the visitor's address.
How can I tell if paid traffic is being counted as direct?
Compare ad platform clicks with GA4 sessions by campaign. If clicks are steady but direct or unassigned traffic rises, parameters are likely being lost. A tagged test URL confirms it.
Can FunnelGuard detect lost UTM parameters?
Yes. It visits your page with marked test parameters and flags the utm_lost check if they are gone when the journey runs. You are alerted once after a second-region re-check.
Related issues
- OPS-104WAF blocking ad click URLs with long gclid/UTM queryFix guide
- OPS-107CDN serving stale page after deployFix guide
- OPS-116Rocket Loader / JS optimisation breaking tags or formsFix guide
- OPS-117Minification/combine breaking scriptsFix guide
- OPS-112Cache keyed without currency/language (wrong prices)Fix guide
- OPS-100Cloudflare/WAF blocks real visitors (challenge loops)Fix guide