Skip to content

Black Friday 50% off your first year on all premium plugins and the Suite.

See the deals

UTM links and the page cache

Links with utm_source, gclid or fbclid often skip the WordPress page cache. Why it happens, how to test it, and how to fix it without losing tracking.

4 min read · Updated 5 November 2026

You run a Google or Facebook campaign, the landing page scores well in PageSpeed Insights, yet paid visitors bounce. A common, overlooked reason: the URL they click is not the URL you tested. Ad platforms and newsletters add parameters such as ?utm_source=…, gclid=… or fbclid=…, and many page caches treat every URL with a query string as a different, uncacheable page. Every paid click then waits for WordPress to build the page from scratch.

Why query strings skip the cache

A page cache stores one file per URL. Query strings often change what a page shows — search results, filters, pagination, previews — so the safe default for many caches (and for Cloudflare APO) is to bypass them. Tracking parameters are different: they are read by JavaScript (Google Analytics, the Meta pixel) and never change the HTML. Each click also has a unique gclid or fbclid, so even a cache that does store query-string URLs would store a new copy per click and never get a hit.

Test it in two minutes

  1. Open a private window (logged out — logged-in tests are misleading because you bypass the cache anyway).
  2. Load your landing page normally and note the cache header in the Network tab of developer tools. With TurboCache it is X-TurboCache-Cache; other caches use headers such as cf-cache-status, x-cache or x-litespeed-cache.
  3. Load it again with ?utm_source=test&gclid=abc123 added. If the header changes from HIT to MISS or BYPASS, campaign visitors are getting uncached pages.
  4. Also check the final ad URL. A missing trailing slash before the ? can trigger a redirect first, which costs another round trip and, on some setups, drops the parameters entirely.

Fix 1: strip tracking parameters from the cache key

The right fix is to tell the cache to ignore marketing parameters when it looks up a page, while leaving them in the browser’s address bar so analytics still reads them. Most serious caching tools have a setting for this, often called “ignored query parameters”. Only list parameters that never change the page — never pagination, search or filter parameters.

In TurboCache this is on out of the box. TurboCache → Settings → Exclusions and views → Ignored arguments already lists the utm_ family, gclid, wbraid, gbraid, gad_source, fbclid, msclkid, ttclid, yclid, Mailchimp’s mc_cid/mc_eid, _ga, ref and srsltid. Add any others your tools use, one per line — for example li_fat_id for LinkedIn or _hsenc and _hsmi for HubSpot emails.

Fix 2: if you cannot change the cache

  • Managed hosts — some hosts already strip UTM parameters at the server, which means PHP never sees them. That is good for speed, but anything that reads UTMs on the server (phone-number swapping, hidden form fields filled by PHP) must move to JavaScript.
  • Cloudflare — a Cache Rule or Transform Rule can remove known parameters from the cache key. Check your plan’s options.
  • Exclude campaign URLs — only if traffic is small. Excluding is the opposite of what you want for a busy campaign: every visit hits PHP.

Keep tracking working

Stripping parameters from the cache key does not remove them from the URL, so Google Analytics, Google Ads auto-tagging and the Meta pixel still read them. If a form must store the campaign source, read the parameters with JavaScript on the page and put them into hidden fields, instead of relying on PHP — that works on any cached page.

One more catch: if you delay analytics and pixel scripts until interaction (TurboCache does this by default for gtag, Google Tag Manager and the Facebook pixel), they still run as soon as the visitor scrolls, moves or taps, and the URL still contains the parameters. A visitor who leaves without any interaction may not be counted; if that matters for your campaign reporting, set a short delay timeout on Scripts and styles.

Frequently asked questions

Will ignoring UTM parameters break my Google Analytics campaign data?

No. The parameters stay in the address bar and Analytics reads them in the browser. Only the cache lookup ignores them.

Is gclid safe to ignore in the page cache?

Yes, for normal WordPress pages. gclid is used by Google Ads and Analytics in the browser and does not change the HTML WordPress prints.

Should I exclude my landing pages from the cache instead?

Only as a last resort and only for low traffic. Excluding means every paid visitor waits for PHP and the database, which is exactly the slowdown you are trying to avoid.

How do I check the fix worked?

Load the landing page twice in a private window with a made-up utm_source and gclid. The second load should report a cache hit; in TurboCache the X-TurboCache-Cache header shows HIT.

Did this answer the question? No — open a support request