Install

Google Tag Manager

A Custom HTML tag with the snippet, fired on Consent Initialization.

Steps

  1. In Tag Manager, create a Custom HTML tag and paste the snippet into it.
  2. Set its trigger to Consent Initialization — All Pages, so it runs before every other tag.
  3. Our own template, CMPStack Consent Banner, is not in the Community Template Gallery yet. Once it is listed it replaces this tag: add it from Templates → Search Gallery, paste the Site ID, and use the same trigger.
  4. Publish the container, verify the domain in the panel, then publish a banner.

“The Site ID” is your domain’s identifier, shown under Domains → Install tag in the panel.

Snippet for a Custom HTML tag

The default, then the tag
<script>
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}
gtag('consent','default',{ad_storage:'denied',ad_user_data:'denied',ad_personalization:'denied',analytics_storage:'denied',wait_for_update:500});
</script>
<script async src="https://cdn.cmpstack.io/cmpstack.js?site=YOUR-SITE-ID&api=https%3A%2F%2Fapi.cmpstack.io"></script>

Here the Site ID is in the tag’s own address rather than in a data-site attribute. Tag Manager rebuilds the element and does not keep those attributes, so the attribute form would arrive with no Site ID.

Replace YOUR-SITE-ID with your Site ID, or copy the snippet from the panel, where it is already filled in.

Other routesPaste the snippetWordPressShopifyWix