Developers

Documentation

Everything to install Consorm, manage consent and integrate your tools, from the first script to exporting the records.

Integrations

Google Analytics and other tools

Add Google Analytics 4, Meta Pixel and the other providers through Consorm, understand Consent Mode v2, and condition your tags on consent correctly.

Once the banner is live, your measurement and advertising tools must wait for consent before firing. If you chose the automatic installation, Consorm creates and conditions these tags for you in the Providers tab, visible as soon as the automatic container exists; with the GTM template, you manage them in your own container by following Your tags with the GTM template.

Add Google Analytics 4

  1. 1Get your GA4 measurement ID, in the G-XXXXXXXXXX format (in Google Analytics: Admin → Data streams).
  2. 2In the Consorm dashboard, open your site then the Providers tab.
  3. 3Choose Google Analytics (GA4), paste the measurement ID and confirm.
  4. 4Click Deploy to publish the container update. The tag is live.

The tag created is a native Google Tag Manager GA4 tag, configured to require the analytics_storage signal and paired with a trigger on the banner's consent event. Nothing fires until the visitor accepts the Analytics category; on acceptance, the tag fires on the current page, without a reload.

Add Meta Pixel

Same process with Meta Pixel in the Providers tab: enter your pixel ID (a 6 to 20 digit number, visible in Meta's Events Manager). The tag created requires the advertising signals ad_storage, ad_user_data and ad_personalization: it stays inactive until the Advertising category is accepted.

The other providers

ProviderExpected identifierRequired consent
Google AdsAW- followed by 6 to 15 digitsAdvertising
TikTok Pixel10 to 30 charactersAdvertising
LinkedIn Insight4 to 10 digitsAdvertising
Hotjar3 to 12 digitsAnalytics
Microsoft Clarity4 to 20 charactersAnalytics
PostHogphc_… project keyAnalytics
Custom HTML or JavaScriptyour snippet (up to 20,000 characters), a category, and the domains to blockThat of the chosen category

Each built-in provider exists only once per site: entering an identifier again updates the existing tag. The custom snippet, for its part, fires only on the banner's consent event, and the domains you list join the blocked patterns of its category. As for the banner, an addition or a change stays a draft until you Deploy.

Consent Mode is the channel through which the banner informs Google tools of the visitor's choices. Consorm implements it in two phases, as Google requires:

MomentSignal sent
Before any tag (initialization)Default state: analytics_storage, ad_storage, ad_user_data, ad_personalization, functionality_storage and personalization_storage denied; security_storage granted; wait_for_update: 500. A returning visitor with a recorded choice gets their granted categories back from that moment.
On every visitor decisionA faithful update, signal by signal, according to the accepted or refused categories.

The banner also pushes the csm_consent_update event into the dataLayer: when a category has just been granted, and on each page load for a visitor whose choice is already recorded. In the automatic installation, a dedicated trigger fires the newly authorized tags on that event, without a reload; with the GTM template, you create that trigger yourself. For the regulatory context, read our article on Consent Mode v2.

Regimes without prior consent

"Denied by default" describes the opt-in regime, the one in Quebec and in Europe. If your consent strategy provides an opt-out regime (some US states) or a simple notice for the rest of the world, the script immediately grants the non-sensitive categories to the visitors concerned, and the tags fire without waiting for a click.

What about other tools?

Trackers that do not go through the Providers tab are not out of control for all that: the banner's script blocks at the source the requests of known analytics and advertising trackers as long as their category is not consented, even if they were pasted directly into your pages. The dashboard's cookie detection helps you spot those scripts and attach them to the right category. For a special need, write to us.