1ConsentConsentDocs

Google Tag Manager

1Consent integrates with Google Tag Manager (GTM) two ways, and most sites need only the first:

  1. Google tags (GA4, Google Ads, Floodlight, Conversion Linker) are gated automatically through Google Consent Mode v2 — you don't configure anything in GTM.
  2. Non-Google tags (Meta Pixel, LinkedIn Insight, custom HTML) fire from a single 1consent:consent dataLayer event using a normal GTM trigger.

Enable the integration under Framework settings → Google Tag Manager in your dashboard. Turning it on makes 1Consent push Consent Mode signals and the 1consent:consent event to your dataLayer. Everything below assumes it's enabled.

How it works

When the 1Consent script loads, before any Google tags run, it sets Consent Mode defaults (everything denied except security_storage) so tags hold until the visitor decides. Then, on the visitor's decision, 1Consent pushes two things to the dataLayer:

  • gtag('consent', 'update', …) — updates Google Consent Mode. Google tags react natively.
  • A 1consent:consent event — a plain dataLayer event you can trigger any tag from.

The order is guaranteed: defaults are set synchronously at page load, and the 1consent:consent event fires once the visitor's consent is known (immediately for returning visitors, on the click for new ones).

Google tags: nothing to configure

If your tags are Google tags, you're already done. Because 1Consent pushes gtag('consent', 'update', …), the following services respect consent automatically — no triggers, no variables:

Google serviceConsent Mode types it reads
Google Analytics 4analytics_storage
Google Adsad_storage, ad_user_data, ad_personalization
Floodlightad_storage, ad_user_data, ad_personalization
Conversion Linkerad_storage

The mapping is resolved from the Google services you've configured in your framework — you don't map consent types by hand.

Basic vs Advanced mode (set in the dashboard): Basic blocks Google tags entirely until consent. Advanced lets them send cookieless pings before consent for better modelling. Pick Basic for the strictest compliance.

Non-Google tags: fire on the 1consent:consent event

For tags that aren't Consent-Mode-aware, use one GTM trigger keyed off a single event. You only need one trigger per tag — the 1consent:consent event covers both returning visitors and in-session changes.

Create a Data Layer Variable for the category

In GTM: Variables → New → Data Layer Variable. Set the variable name to the consent path you care about:

1consent.categories.marketing

Replace marketing with your category id (find it on the Categories page in your dashboard). To gate on a specific service instead of a whole category, use the services map:

1consent.services.meta-pixel

The value is true when the visitor has granted that category/service, false otherwise. Name the variable something like 1c - marketing granted.

Create a Custom Event trigger

In GTM: Triggers → New → Custom Event. Configure:

  • Event name: 1consent:consent
  • This trigger fires on: Some Custom Events
  • Condition: 1c - marketing granted equals true

Because the same 1consent:consent event fires both when a returning visitor arrives with stored consent and when a visitor changes consent during the session, this one trigger handles every case.

Attach the trigger to your tag

Open the tag you want gated (e.g. Meta Pixel), and set this trigger as its firing trigger. The tag now fires the moment marketing consent is present — and never before.

Remove any All Pages / DOM Ready triggers from tags you're gating this way, or they'll fire regardless of consent.

The 1consent:consent event payload

Each push looks like this — useful when you want to build richer triggers or read the high-level decision:

window.dataLayer.push({
  event: "1consent:consent",
  "1consent": {
    reason: "ready",          // "ready" = initial state on load, "update" = a change this session
    consentRequired: false,   // true only on load when the visitor hasn't decided yet
    decision: "A",            // "A" all accepted · "D" all denied · "G" granular · null = no decision yet
    categories: { analytics: true, marketing: false },
    services:   { "google-analytics-4": true, "meta-pixel": false },
  },
});
  • Gate on categories.<id> / services.<id> for the common case.
  • Use reason: "update" if you want a tag to fire only on an active change, not on page load.
  • decision and consentRequired are there for reporting or conditional logic — most tags don't need them.

Optional: let 1Consent load gtag.js for you

If your site uses a single Google tag and no full GTM container, enable Load Google Tag (gtag.js) in the dashboard and enter your Google Tag ID (G-XXXXXXXXXX). The 1Consent bootstrap then loads gtag.js and wires Consent Mode for you — no separate Google snippet needed.

If you already load a GTM container the normal way, leave this off and add your Google tag inside GTM instead — otherwise the tag loads twice.

Custom dataLayer name

If you renamed your dataLayer via the l parameter in the GTM snippet, set the same name in the dashboard's DataLayer Name field so 1Consent pushes to the right array. Leave it blank to use the default dataLayer.

Next steps

On this page