Instructions for Loading Consent Management Platform (CMP)
Cookienovo používa dvojdielnu inštaláciu na zabezpečenie toho, aby boli predvolené nastavenia Google Consent Mode v2 nastavené pred spustením akýchkoľvek Google tagov. Toto sleduje rovnaký priemyselný štandard ako Cookiebot, CookieHub a ďalšie vedúce CMP.
Časť 1: Inline predvolené nastavenia súhlasu (Povinné)
Prvý skript nastaví predvolené nastavenia Google Consent Mode v2 synchrónne pred spustením akýchkoľvek Google tagov. Tento malý inline skript (~300 bajtov) zabezpečuje, že všetky typy súhlasu sú predvolene nastavené na 'denied' (okrem 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>
Časť 2: Skript banneru Cookienovo (Podporuje defer/async)
Druhý skript načíta banner Cookienovo. Tento skript môže bezpečne používať atribút defer alebo async pre lepší výkon bez kompromisov v oblasti súladu.
<!-- CookieNovo: Step 2 - Load banner -->
<script site-token="YOUR_TOKEN" src="https://cookienovo.com/assets/client.js" defer></script>
⚠️ Kritické: Poradie skriptov
Oba skripty Cookienovo musia byť umiestnené v sekcii <head> PRED akýmikoľvek Google tagmi (Google Analytics, Google Tag Manager, Google Ads, atď.). Inline skript s predvolenými nastaveniami súhlasu zabezpečuje, že aj keď sa Google tagy načítajú asynchrónne, predvolené nastavenia súhlasu sú už nastavené.
- 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]