Consent Mode v2
Consent Mode v2 is on by default (site Settings, “Google Consent Mode v2”). Before your Google tags, the script sends the default state, everything denied, then on each visitor choice the four signals Google expects:
| Signal | Granted when the visitor accepts |
|---|---|
analytics_storage | analytics |
ad_storage | advertising |
ad_user_data | advertising |
ad_personalization | advertising |
Google Analytics 4 and Google Ads then adjust on their own: without consent, they write no cookie.
Optooki script and GTM container
The recommended way: the Optooki line first in the <head>, then the Google
Tag Manager container.
<script src="https://consent.optooki.com/s/YOUR-SITE-ID.js"></script>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){ /* … */ })(window,document,'script','dataLayer','GTM-XXXX');</script> This way, the banner controls both the container’s tags and the scripts written directly in the site’s code.
optooki_consent trigger
Some tags do not know Consent Mode (advertising pixels, chat tools…). On each choice, Optooki
pushes the optooki_consent event to the dataLayer, with the state of
each category in the optooki variable.
-
Create a variable
Variables, New, type “Data Layer Variable”, name
optooki.marketing(oroptooki.analytics,optooki.preferences). -
Create the trigger
Triggers, New, type “Custom Event”, event name
optooki_consent, with the condition “the variable equalstrue”. -
Attach it to the tag
The tag now only fires once the visitor has agreed to that category.
Optooki tag template
If you cannot change the site’s code, the Optooki tag template installs the banner from your container. It sets the default state, everything denied, before all other tags, then loads the banner.
-
Download the template
The
optooki-google-tag-manager.tplfile is on the Integrations page. -
Import it into your container
In Google Tag Manager: Templates, Tag Templates, New, then the menu at the top right, Import. Choose the file and save.
-
Create the tag
Tags, New, type “Optooki - Bandeau de consentement (CMP)”. Paste the server URL and the site ID (Installation tab of the dashboard), then choose the Consent Initialization - All Pages trigger.
-
Publish the container
Check in Preview mode first: the banner shows and Google tags wait for the visitor’s choice.
In the same section : Install
- Any website One line to paste at the top of every page, for a site without a CMS.
- WordPress Plugin for WordPress 6.0 and later, compatible with WP Consent API.
- PrestaShop Module for PrestaShop 1.7, 8 and 9.
- Magento Module for Magento Open Source and Adobe Commerce 2.4.
- Joomla System plugin for Joomla 4.4, 5 and 6.
- Drupal Module for Drupal 10.3 and later, and Drupal 11.
- Contao A single package for Contao 4.4 to 6.
- Shopify App connected to Shopify’s Customer Privacy API.
- Wix App connected to Wix’s consent policy.
- Squarespace One line to paste into the site’s code injection.
- Webflow One line to paste into the site’s custom code.