Skip to content

Releases: udiinsight/insight-cookie-banner

v2.0.2 — WP Rocket delayed JS fix

Choose a tag to compare

@udiinsight udiinsight released this 06 Sep 11:58

Fixes the consent banner never appearing on sites running WP Rocket with Delay JavaScript Execution enabled.

The bug

WP Rocket delayed banner.js until the visitor's first interaction, so the banner's hidden attribute was never removed. Meanwhile the head script had already set Google Consent Mode defaults to denied, leaving visitors unable to grant consent until they moved, scrolled or clicked. Google Ads received no _gcl_aw cookie and could not attribute conversions.

The fix

The plugin now registers rocket_delay_js_exclusions for its own scripts, and — when Google Consent Mode is enabled — for the Google tag scripts it depends on:

  • insight-cookie-banner, data-icb — always
  • googletagmanager.com, google-analytics.com — under Consent Mode
  • gtag(, gtm.start — under Consent Mode, so inline configuration snippets carrying only a measurement ID are excluded too

Customisable via the icb_delay_js_exclusions filter.

Note

Excluding Google tags from Delay JS trades some PageSpeed score for correct measurement. Sites that would rather keep the delay can drop those patterns through the filter.

Install

Download the zip below and upload it via Plugins → Add New → Upload Plugin. Clear the WP Rocket cache afterwards, including minified CSS/JS.