Issue with Google Tag (gtag.js) script blocking
-
Hi,
I am experiencing an issue with the Pressidium Cookie Consent plugin. Despite following the configuration guidelines, the Google Analytics script is not being blocked before user consent, which is causing a “Prior Consent” compliance failure.
Current Configuration & Setup:
- General Settings: Both “Autorun” and “Page Script” options are enabled.
- Integrations: Both “Google Consent Mode v2 (GCM)” and “Tag Gateway” are currently disabled to avoid conflicts with manual blocking.
- Cookie Categories:
- Necessary cookies: Includes
elementor(along with domain, expiration, and description). - Analytics cookies: Includes
_gaand_gid(along with domain, expiration, and description).
- Necessary cookies: Includes
- Blocked Scripts:
- Script Source:
https://www.googletagmanager.com/gtag/js - Cookie Category: Assigned to
Analytics.
- Script Source:
- Implementation: The Google Tag script is injected into the
<head>using the Admin and Site Enhancements (ASE) plugin (Custom Code > Insert <head>, <body> and <footer> Code):HTML<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXXX'); </script>
The Problem: Even with the script source added to the “Blocked Scripts” list and “Page Script” enabled, the browser’s Network tab shows that
gtag/jsis loading with a Status 200 immediately upon page load. Data is being sent to Google (Status 204) before the user interacts with the consent banner.It seems the “Page Script” feature is failing to intercept the code injected via ASE. I suspect there might be a priority conflict where the ASE script is executed before the Pressidium plugin can initialize its blocking logic. Could you please investigate how to ensure the plugin takes precedence?
Regards,
RThe page I need help with: [log in to see the link]
You must be logged in to reply to this topic.