Instructions for Loading Consent Management Platform (CMP)
Cookienovo uses a two-part installation to ensure Google Consent Mode v2 defaults are set before any Google tags fire. This follows the same industry-standard approach as Cookiebot, CookieHub, and other leading CMPs.
Part 1: Inline Consent Defaults (Required)
The first script sets Google Consent Mode v2 defaults synchronously before any Google tags can fire. This small inline script (~300 bytes) ensures all consent types default to 'denied' (except security_storage).
<!-- CookieNovo: Step 1 - Set Google Consent Mode v2 defaults -->
<script>
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}
gtag('consent','default',{'ad_storage':'denied','ad_personalization':'denied','ad_user_data':'denied','analytics_storage':'denied','functionality_storage':'denied','personalization_storage':'denied','security_storage':'granted','wait_for_update':500});
gtag('set','ads_data_redaction',true);
</script>
Part 2: Cookienovo Banner Script (Supports defer/async)
The second script loads the Cookienovo banner. This script can safely use the defer or async attribute for better performance without compromising compliance.
<!-- CookieNovo: Step 2 - Load banner -->
<script site-token="YOUR_TOKEN" src="https://cookienovo.com/assets/client.js" defer></script>
β οΈ Critical: Script Order
Both Cookienovo scripts must be placed in the <head> section BEFORE any Google tags (Google Analytics, Google Tag Manager, Google Ads, etc.). The inline consent defaults script ensures that even if Google tags load asynchronously, consent defaults are already set.
- Load the TCF Stub (if applicable): For sites operating under the IAB Europe Transparency and Consent Framework (TCF), include the TCF stub script in the
tag. This stub facilitates communication between your CMP and Google tags.- Delay Google Tags Until Consent is Processed: Ensure Google tags (e.g., Google Analytics, Ads, or Tag Manager) are configured to wait for the CMPβs consent signals. This can be achieved by: Setting up Google Tag Manager to trigger only after receiving consent status or Using Googleβs tag settings to defer loading until the CMP signals are available.
- Test and Verify Implementation: After implementation, test your setup to confirm that CMP and consent commands/stubs load before any Google tags. Also test Google tags respect user consent preferences and only fire accordingly.
For further assistance, contact us [email protected]