Instructions for Loading Consent Management Platform (CMP)

Cookienovo používá dvouc ástnou instalaci k zajištění toho, aby byla výchozí nastavení Google Consent Mode v2 nastavena před spuštěním jakýchkoli Google tagů. Toto sleduje stejný průmyslový standard jako Cookiebot, CookieHub a další vedoucí CMP.


Část 1: Inline výchozí nastavení souhlasu (Povinné)

První skript nastaví výchozí nastavení Google Consent Mode v2 synchronně před spuštěním jakýchkoli Google tagů. Tento malý inline skript (~300 bajtů) zajišťuje, že všechny typy souhlasu jsou výchozě nastaveny na 'denied' (kromě 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>


Část 2: Skript banneru Cookienovo (Podporuje defer/async)

Druhý skript načte banner Cookienovo. Tento skript může bezpečně používat atribut defer nebo async pro lepší výkon bez kompromisů v oblasti souladu.

<!-- CookieNovo: Step 2 - Load banner -->
<script site-token="YOUR_TOKEN" src="https://cookienovo.com/assets/client.js" defer></script>


⚠️ Kritické: Pořadí skriptů

Oba skripty Cookienovo musí být umístěny v sekci <head> PŘED jakýmikoli Google tagy (Google Analytics, Google Tag Manager, Google Ads, atd.). Inline skript s výchozími nastavením souhlasu zajišťuje, že i když se Google tagy načítají asynchronně, výchozí nastavení souhlasu jsou již nastavena.

- 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.

Website builders (Creativesites and similar platforms)

On hosted website builders such as Creativesites you usually cannot edit the page <head> directly. Instead, paste both snippets above (Step 1 and Step 2) into the platform's custom code in the header / <head> field. Place this custom code before the builder's built-in Google Analytics or Google Tag Manager integration — the header field renders at the top of <head>, so the consent defaults run first automatically.

Tags loaded through the builder's native Google integration (Analytics, Ads, Tag Manager) need no extra work: once the consent defaults load first, those tags respect Consent Mode on their own.

For custom marketing tags that Google does not manage (for example the Facebook / Meta Pixel), gate them behind the CookienovoUserConsentChanged event so they only fire after the visitor accepts. Match the category by name (not by array position) so it keeps working even if categories are reordered, and also read the consent cookie so it covers returning visitors who already chose on a previous visit:

<script>
(function () {
  var loaded = false;
  function cnAllowed(category) {
    return ("; " + document.cookie).indexOf("; cn-category-" + category + "=1") > -1;
  }
  function loadMarketing() {
    if (loaded || !cnAllowed("marketing")) return;
    loaded = true;
    // load your Facebook / Meta Pixel here
  }
  ["CookienovoUserConsentChanged", "DOMContentLoaded"].forEach(function (evt) {
    document.addEventListener(evt, loadMarketing);
  });
})();
</script>

For further assistance, contact us [email protected]