Hey, @nikodemsky!
Your Google Tag Manager (GTM) snippet:
<script data-cookiecategory="analytics">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WW3CNFH');</script>
seems to be loading too early, which may interfere with our “Blocking scripts” functionality and Google Consent Mode (GCM) integration.
Our plugin tries to load its files (/public/block-scripts.js
and /public/consent-mode.js
) before other scripts, by hooking into wp_head
and wp_enqueue_script
with a priority of -10
— lower numbers correspond with earlier execution.
However, that won’t work in certain scenarios, such as:
- Your GTM snippet is hardcoded into your theme before
do_action( 'wp_head' );
- You’re using an mu-plugin to load your GTM snippet, which is going to load before normal plugins
- You’re hooking into
wp_head
specifying an even lower priority than -10
- etc.
Could you please try to load your GTM snippet after our plugin’s JS files have loaded, and then try again?
If the problem persists after those adjustments, please let us know so we can further investigate the issue.