wiki/knowledge/web-analytics/wp-rocket-gtm-blocking-issue.md Layer 2 article 746 words Updated: 2026-04-05
↓ MD ↓ PDF
web-analytics conversion-tracking wp-rocket google-tag-manager wordpress performance-optimization

WP Rocket Delayed JavaScript Blocking Google Tag Manager

Overview

WP Rocket's "delayed JavaScript" feature is a common WordPress performance optimization that defers script execution until user interaction. However, when Google Tag Manager (GTM) is loaded via a delayed script, it prevents GTM from firing on page load — silently breaking all dependent tracking, including form submission conversions and Google Ads conversion events.

This issue is insidious because the site appears to function normally, GTM may show as "installed," and no errors surface in the browser console under typical browsing. The failure only becomes apparent when auditing conversion data and finding zero recorded events despite confirmed form submissions.

How the Problem Occurs

  1. WP Rocket's delayed JavaScript setting is enabled (a common default for performance scores).
  2. GTM's script tag is not explicitly excluded from the delay.
  3. GTM loads only after a user interaction trigger (scroll, click, keypress), rather than on page load.
  4. Any GTM triggers configured to fire on page load or DOM ready never execute.
  5. Form submission events, which depend on GTM being initialized, are never captured.
  6. Google Ads and Google Analytics receive no conversion signals.

Symptoms

Resolution

In WP Rocket settings, navigate to File Optimization → Delay JavaScript Execution and add GTM to the exclusion list:

googletagmanager.com
gtm.js

This allows GTM to load normally while still deferring other scripts.

Option 2: Disable Delayed JavaScript Entirely

If exclusion configuration is unavailable or unreliable, disabling the delayed JavaScript feature entirely eliminates the risk. The performance trade-off is typically minor compared to the cost of broken conversion tracking.

Verification Steps

After applying the fix:

  1. Use Google Tag Assistant or GTM's Preview mode to confirm tags fire on page load.
  2. Submit a test form and verify the conversion event appears in GA4 DebugView and Google Ads conversion tracking.
  3. Check that GTM's dataLayer is populated before form interaction events.
  4. Monitor Google Ads conversion counts over the following 24–48 hours for recovery.

Downstream Impact on Campaigns

Missing conversion data has compounding effects on paid search performance:

In the AHS account, this issue resulted in zero form submissions recorded over a 30-day period despite active campaigns. The DSA and display campaigns continued consuming budget with no measurable return. See [1] for account context.

When this WP Rocket issue was discovered during an automated audit of the AHS account, several compounding problems were also present:

Fixing the WP Rocket setting alone restores data collection, but the conversion action configuration should also be corrected to give Smart Bidding a clean, focused signal.

Detection via Automated Audit

This issue was identified during a live demo of an agentic AI audit tool ([2]) that cross-references Google Tag Manager installation, GTM firing behavior, and conversion data gaps. The tool logged into the AHS WordPress admin, identified the WP Rocket setting, and corrected it autonomously — a task that would typically require manual investigation across multiple platforms.

Prevention

References