Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Tracking breaks on cached or accelerated mobile pages: fix

TRK-386Low impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

Many sites use tools that make mobile pages load faster. These include page caching plugins, CDN features that rewrite scripts, script delay or defer options, and accelerated page formats served from someone else's cache. They work by serving a saved or rewritten copy of your page.

The problem is that tracking depends on things that must be live: scripts that run in the visitor's browser, URL parameters such as gclid and utm_source, and cookies. A saved or rewritten copy can freeze a value, load a tag too late, or drop it altogether. The page looks fine, but the ad and analytics platforms hear nothing, or the wrong thing.

Why it costs you leads or sales

The lead or sale still happens, so the direct damage is small. The cost is in the data. If tags fire late, visitors who leave quickly are never counted. If a cached page loses the ad click ID, the conversion cannot be tied back to the campaign. Ad platforms then learn from less data, and reports undercount your best mobile campaigns.

Where tracking is lost on a cached mobile page
  1. Ad clickVisitor lands with gclid and UTMs
  2. Cached copy servedSpeed layer returns a saved or rewritten page
  3. Tag loadsScript delayed, blocked or removed
  4. Page view recordedNever sent
  5. Conversion attributedNo campaign match

The cached copy delays or drops the tag, so later steps never reach the ad platform.

How to check if your site has it

Test a cached mobile page
  1. Open the page the way a visitor would

    On a real phone, open your landing page in a private tab with a test URL such as yourpage.com/?utm_source=test&utm_medium=check&gclid=test123. Load it twice so the second view comes from the cache.

  2. Check the tags fire

    Use Google Tag Assistant or GA4 DebugView, and the Meta Pixel Helper on desktop with mobile emulation. Confirm the page view and your key events appear.

  3. Check the parameters survive

    Look at the address bar and at the tag request. The UTMs and click ID should still be there and should match what you typed, not an earlier visitor's.

  4. Compare cache on and off

    Purge the cache or turn off the optimisation features, then repeat. If tags work only with the cache off, the speed layer is the cause.

  5. View the page source

    Search the delivered HTML for your tag ID (for example GTM-XXXX or G-XXXX). If scripts show type="rocketlazyloadscript" or similar, an optimiser is delaying them.

How to fix it

The goal is the same everywhere: keep tracking scripts live, and make sure the cache never serves one visitor's parameters or cookies to another. The steps depend on which speed tool you use.

Fix by platform
  1. Exclude tracking scripts from delay

    In your optimisation plugin (for example WP Rocket's File Optimization, or LiteSpeed Cache's JS settings), add your GTM, GA4 and pixel script URLs to the exclusion list for delayed, deferred or combined JavaScript. Menu names vary by plugin.

  2. Ignore tracking parameters in the cache

    Make sure utm_*, gclid, fbclid and similar parameters are not treated as separate cache pages that strip the query string. Most cache plugins have a setting for ignored or cached query strings.

  3. Purge and retest

    Clear the page cache and any CDN cache, then repeat the mobile test.

Stop Cloudflare Rocket Loader from delaying a tracking scripthtml
<script data-cfasync="false" async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
Read the click ID in the browser, not from cached HTMLjavascript
const params = new URLSearchParams(window.location.search);
const gclid = params.get('gclid');
if (gclid) {
  document.cookie = 'gclid=' + encodeURIComponent(gclid) + '; max-age=7776000; path=/; SameSite=Lax';
}
Cached mobile page before and after the fix

Before

  • Tracking scripts delayed or removed by the optimiser
  • Parameters dropped on the cached copy
  • Mobile conversions show as direct or not at all

After

  • Tracking scripts excluded from delay and rewriting
  • Parameters read live in the browser
  • Mobile conversions tied to the right campaign

How to confirm it's fixed

Confirmation checks
  • Second load of the page (from cache) still sends the page view
  • Tag Assistant or DebugView shows your key events on a real phone
  • UTMs and click ID in the tag request match the test URL
  • A test form or purchase appears in the platform with the right source
  • Results match with the cache on and with it purged

How to prevent it happening again

Speed settings change often: a plugin update, a new CDN rule or a new optimisation toggle can undo your exclusions. Keep a short list of the scripts that must never be delayed, and retest tracking after any speed or caching change.

Habits that help
  • Keep a written list of tracking scripts to exclude from optimisation
  • Retest on a real phone after every plugin, theme or CDN change
  • Test with a URL that has UTMs and a fake click ID
  • Purge caches after changing tag setup
  • Compare mobile and desktop conversion counts each month for gaps

How FunnelGuard handles this

FunnelGuard does not check this yet. Detecting a problem that only shows on certain cached or accelerated mobile copies is a possible future check.

What FunnelGuard does today is run your real customer journeys on a schedule, from the EU or the US, and check each step and the tracking hits sent to GA4, Google Ads, Meta and other platforms. If a tag stops firing on a journey it tests, that is visible in the results, but it will not tell you that a mobile-only cache layer is the reason.

Recorded conversions by deviceExample numbers
Recorded conversions by device (example)Desktop recorded: 100 conversions; Mobile recorded (cache on): 55 conversions; Mobile recorded (fixed): 95 conversions038771005595Desktop recordedMobile recorded (cach…Mobile recorded (fixe…conversions

Example: mobile and desktop send similar real leads, but the cached mobile pages record far fewer. Numbers are illustrative.

Questions people ask

Why is my tracking not working on mobile but fine on desktop?

A common cause is a speed layer that applies mainly to mobile, such as a cache, script delay or accelerated page copy. It can delay or remove tags and strip URL parameters. Test with the cache purged and with optimisation off to confirm.

Do caching plugins break Google Analytics and Meta Pixel?

They can, if they delay, combine or rewrite the tracking scripts, or serve a cached copy with the wrong parameters. Add your tracking scripts to the plugin's exclusion list and retest on a real phone.

How do I test tracking on a cached page?

Open the page on a phone with a test URL containing UTMs and a fake gclid, load it twice so the second view is cached, then check Tag Assistant or GA4 DebugView. Compare the result with the cache purged.

Why are UTM parameters missing on my cached landing page?

The cache or a redirect may be serving a copy without the query string, or a script reads the value from saved HTML. Make the cache ignore tracking parameters and read them in the browser with JavaScript.

Does Cloudflare Rocket Loader break tracking?

It can delay or reorder scripts, which may make tags fire late or not at all. Turn it off, or add data-cfasync="false" to the tracking script tags, then retest.

Does FunnelGuard detect tracking problems on cached mobile pages?

Not yet. It is a possible future check. FunnelGuard does run your journeys on a schedule and check tracking hits, so a tag that stops firing on a tested journey shows in the results, but it will not name a mobile cache as the cause.

Is this the same as AMP tracking problems?

No. AMP is a specific page format with its own analytics setup. This guide covers cached, rewritten or delayed copies of your normal pages.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

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.