How do I make sure tracking only runs after consent?

September 30, 2026

This is the core feature: script blocking.

By default, ConsentBit will detect and block scripts in three ways:

  1. Auto-blocking by category: When you assign a script to “Marketing” or “Analytics,” ConsentBit prevents it from loading until the visitor agrees to that category.
  2. Manual script tagging: You can mark any specific script as blocked-until-consent by changing its type attribute. For example, <script type="text/plain" data-consentbit-category="marketing" src="..."></script>. This is useful for scripts the auto-scanner doesn’t catch (custom integrations, niche tools).
  3. Google Tag Manager integration: If you use GTM, ConsentBit can hook into GTM’s built-in consent triggers, and you don’t need to tag individual scripts.
  4. Google tags and Consent Mode: by default, ConsentBit lets Google's own tags (gtag.js, gtm.js) load with Consent Mode set to denied. This is Google's Advanced Consent Mode. If you want Google tags fully blocked until consent (Basic Consent Mode), tag them manually as shown above (see Manual script tagging). See Google Consent Mode v2 for both setups.

Example: You have Google Analytics, Meta Pixel, and a HubSpot chat widget. After installing ConsentBit:

  • A visitor lands on your site.
  • They see the banner: “We use cookies to improve your experience.”
  • They click Customize and toggle on Analytics but leave Marketing off.
  • ConsentBit allows Google Analytics to load but blocks Meta Pixel.
  • HubSpot is set to “Necessary” because you use it for customer service, so it loads regardless.

‍

Frequently asked questions

No items found.
Didn’t find your answer?
Contact us here