Skip to main content

Scripts Not Blocked

Symptom

Scripts that should require consent (Google Analytics, Meta Pixel, etc.) are loading before the user interacts with the banner — visible in DevTools → Network.

Cause 1: Scripts not marked for blocking

How to check: View your page source. Scripts that should be blocked must have type="text/plain" and data-consent-category.

Fix:

<!-- Wrong: will load immediately -->
<script src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"></script>

<!-- Correct: blocked until analytics consent -->
<script type="text/plain" data-consent-category="analytics"
src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"></script>

Cause 2: Scripts loaded via Google Tag Manager

How to check: If GA4 is configured in GTM rather than directly in your HTML, adding type="text/plain" won't work — GTM controls when GA4 loads.

Fix: Use the ConsentForge GTM template with Consent Mode v2. See the GTM setup guide. With Consent Mode, GTM tags wait for consent before firing.


Cause 3: ConsentForge script loads after the blocked scripts

How to check: Check script order in <head>. ConsentForge must load before any script it needs to block.

Fix: Move the ConsentForge <script> tag to the very top of <head>, before any third-party tags.


Cause 4: Vendor category set to necessary

How to check: Dashboard → Property → Vendors → find the vendor → check its category.

Fix: If the vendor requires consent, change its category to analytics or marketing.


Cause 5: Script uses a different loading mechanism

Some scripts inject themselves via document.write or are loaded by other scripts. These cannot be blocked via type="text/plain".

Fix: Block the parent script instead. If the injecting script is in GTM, use Consent Mode to control it.