Skip to main content

Snippet Reference (vanilla JS)

Script URL

Cluster CDN (example):

<script
src="https://cmp-cdn.uat.digiwedge.com/cmp/dw-cmp.min.js"
data-site-key="YOUR_SITE_KEY"
defer
></script>

Hosting behind IIS? Review the IIS & ASP.NET Core recipe for ARR proxy rules, headers, and consent gating middleware.

Attributes:

  • data-site-key — your Site Key (Portal → Sites)

Helpers

Reopen banner

<a href="#" onclick="window.DWConsent && window.DWConsent.open(); return false;"
>Privacy settings</a
>

Debug (see last decision)

window.DWConsent?.debug?.regionDecision?.(); // → { region, framework, source: 'cache'|'network'|'fallback', at }

Events (for GTM/dataLayer)

| Event | When it fires | Payload keys | | ------------ | ------------------------- | ---------------------------------------- | ------- | | cmp_accept | User accepts any category | region, framework, tcfString/gppString | | cmp_reject | User rejects | same as above | | cmp_open | Preferences opened | source: 'banner' | 'link' |

Tip: Use our GA4 Consent Mode template in GTM. It sets default‑deny and flips states after Accept.