Skip to content
Admetriva

Connecting your consent platform (CMP)

How the tracker reads the visitor's consent directly from Google Consent Mode or your site's CMP, which categories it uses and what it does when consent is missing.

On this page

Under the Consent required or Hybrid policy, the tracker collects fully only after the visitor consents. Consent can reach the tracker in two ways:

  • your site calls Admetriva.consent('grant'), 'deny' or 'revoke' from its banner (the existing option, unchanged);
  • the tracker reads consent itself from your consent management platform (CMP) or from Google Consent Mode, once you tell it which one.

The second option is optional. Without it, the tracker behaves exactly as before, even when a CMP is on the page.

Turning it on

Add the data-consent-source attribute to the snippet:

<script async src="https://admetriva.com/assets/client/admetriva.js" data-site-token="YOUR_DOMAIN_TOKEN" data-consent-source="cookiebot"></script>

Accepted values:

Value Source
gcm Google Consent Mode v2 (the consent commands in dataLayer)
cookieyes CookieYes
cookiebot Cookiebot
complianz Complianz
onetrust OneTrust
usercentrics Usercentrics (the __ucCmp version)
iubenda iubenda
didomi Didomi
tcf any IAB TCF v2.2 compatible CMP

You can also use window.AdmetrivaConfig = { consentSource: 'cookiebot' }, defined before the snippet.

The three categories

The tracker turns consent into three categories, each granted, denied or unknown:

Category What it means
Analytics measuring visits and the product → cart → order journey
Attribution linking ad click identifiers (gclid, fbclid and the others) to visits and orders
Marketing advertising identifiers in the browser and transfers to ad platforms

As before, only Analytics decides whether the tracker collects. Attribution and Marketing are reported to the server and shown by Admetriva.getConsentState().

The rules are restrictive:

  • only an explicit choice by the visitor grants a category. A banner the visitor has not answered, an implied consent, or a region where the CMP accepts everything without asking grants nothing;
  • consent for advertising never grants Analytics;
  • Attribution is granted only when both Analytics and Marketing are granted, except in CMPs where you point it to a category of its own.

What the tracker reads from each CMP

Source Analytics Marketing
Google Consent Mode analytics_storage ad_storage and ad_user_data
CookieYes the Analytics category the Advertisement category
Cookiebot the Statistics category the Marketing category
Complianz the Statistics category the Marketing category
OneTrust group C0002 group C0004
Usercentrics the categories you specify the categories you specify
iubenda purpose 4 (Measurement) purpose 5 (Marketing)
Didomi purposes cookies and measure_content_performance purposes cookies and measure_ad_performance
IAB TCF v2.2 purposes 1 and 8 purposes 1 and 7

With Google Consent Mode only the updates (update) sent after the visitor's choice count. Default values (default) are not a choice.

For OneTrust, Usercentrics and Didomi you can specify other categories, groups or purposes, comma-separated:

<script async src="https://admetriva.com/assets/client/admetriva.js" data-site-token="YOUR_DOMAIN_TOKEN" data-consent-source="usercentrics" data-consent-analytics="statistics" data-consent-marketing="marketing"></script>

The data-consent-attribution attribute points Attribution to a category of its own. For Usercentrics the categories are required: without them the tracker has no consent.

If the CMP has not loaded yet, the visitor has not chosen, or the value of data-consent-source is not recognized, the tracker collects nothing and writes nothing. It does not delete the identifiers of a visitor who consented on an earlier visit either. Collection starts as soon as the CMP reports consent, on the same page. Under the Hybrid policy, only the anonymous counters are sent until then.

An explicit refusal stops collection. If the visitor had consented before, the local identifiers are deleted, as with Admetriva.consent('revoke').

Checking it

Admetriva.getConsentState() shows the state of each category and the source (for example cmp:cookiebot). Admetriva.getDiagnostics().consentBridge shows the configured source and the CMPs detected on the page. Detection is only reported: the tracker never uses a CMP you have not configured.

The adapters follow each CMP's public documentation and have not yet been tested on real accounts. Configuring the categories in your CMP remains your responsibility as the site owner.

Didn’t find your answer? Write to us and we’ll help.

Contact