1.5.9 — WP Rocket consent fix (GTM/GA4 outage)
Critical fix for sites running WP Rocket (or LiteSpeed / Cloudflare Rocket Loader).
On WP Rocket-cached pages, "Delay JavaScript execution" rewrote the scripts inside the plugin's gated templates and deferred the Consent Mode head block, with two consequences: gated GTM/Meta/GA4 scripts never executed after the visitor accepted (Tag Assistant: "No Google tags found"), and returning visitors' Google hits were sent with consent denied (gcs=G100), so GA4 reported almost no data.
Fixes
- Script activation now undoes optimizer rewrites (promotes
data-rocket-src/data-srctosrc, resets non-JStype) before injecting gated scripts. - The Consent Mode update is always pushed as a real
argumentsobject — Google ignores plain-arraydataLayerpushes. - The Consent Mode head block, banner.js, and the WhatConverts loader are marked
nowprocket data-no-optimize data-cfasyncso page optimizers never defer them.
After updating: purge the site's page cache (WP Rocket + any server cache such as Varnish) so cached HTML regenerates, then verify in a private window on the bare URL: accept cookies and confirm /g/collect requests carry gcs=G111.
QA-trap reminder: WP Rocket serves no cache to logged-in users and query-string URLs bypass it — always test logged-out on the bare URL.