Kód BLACKGO: cookie lišta na rok zdarma. Založit účet →

consetgo consent module documentation /

Google Tag Manager and Consent Mode

By default GTM has the category “Container: analytics or marketing”, and the module blocks the tags inside the container (GA4, Meta Pixel, Google Ads…) separately, by their own category. In Consent Mode advanced mode (default from 1.3.49) GTM loads right away, after the “denied” signals, and other companies’ tags in the container (Meta Pixel, TikTok, LinkedIn…) still wait for consent. The table below shows basic mode (advanced mode off): GTM then loads after consent to analytics or marketing.

Visitor’s consentGTM as container (GA4 and Meta Pixel inside)GTM as marketing (GA4 and Meta Pixel inside)
nonenothing loadsnothing loads
analytics onlyGTM and GA4; Pixel blockednothing loads
marketing onlyGTM and Pixel; GA4 blockedGTM and Pixel; GA4 blocked
alleverythingeverything

Choose “container” for a typical container with standard GA4, Google Ads and Meta Pixel tags. Choose “marketing” when the container sends data in ways the module cannot see in the browser: server-side GTM, tags that send data in the background (fetch) or image pixels from unknown addresses. Sites installed before version 1.3.23 keep GTM as marketing until the owner changes it.

Google Consent Mode v2

The option is on by default (Settings → Integrations). Before GTM loads, the module sets all signals to “denied” and updates them after the visitor’s decision. In the same group you set wait_for_update (500 ms), ads_data_redaction and url_passthrough.

Advanced mode (the “Advanced mode (recommended)” option of the “Google Consent Mode v2” field, described under the “?” sign, the default from 1.3.49): GTM, GA4, Google Ads and the Google tag load right away, with “denied” signals. Until consent they set no cookies and send Google only cookieless signals – Google uses them to estimate visits and conversions of visitors who did not consent. Other companies’ tags, Universal Analytics (analytics.js) and scripts that contain another service next to the Google tag still wait for consent. “Basic mode”: Google tags load only after consent. “Off”: the module sends no consent signals to Google.

GTM without pasting code

If the GTM container is not on the site yet, enter its ID in “GTM ID (optional)” in Settings or in the “Code” field of the Google Tag Manager service. The module inserts the container itself, after setting Consent Mode.

GTM in the site code and in the panel

Keep the GTM container in one place: in the site code or in the module panel.

  • The same ID in the site code and in the "Code" field of Google Tag Manager: the module sees it in the site code and does not insert a second copy. It blocks the GTM from the site code until consent, so after consent the container loads once.
  • The "GTM ID (optional)" field in Settings does not check the site code. If GTM is already in the code, leave this field empty – otherwise after consent the container loads twice and GA4 counts page views twice.
  • Two different containers (one in the code, another in the panel) both load. Tags that are in both (for example GA4) then count visits twice.
  • GTM added by a plugin script (not in the page HTML): the module still blocks it until consent, but cannot see its ID – in that case do not enter it in the panel.

Tags inside the container

  • Do not enter the IDs of tags from the container (GA4, Meta Pixel, Google Ads) in the module again – GA4 would count visits twice. Leave the “Code” field of GA4 and the pixel empty, and switch the service on in the Services and scripts tab only so that visitors see it in the banner. Switch on only services that really are in the published container.
  • In GTM, in the consent settings of each tag (Advanced Settings → Consent Settings): Google tags (Google tag, GA4, Google Ads) – “No additional consent required”, because they read Consent Mode themselves. Other vendors’ tags (Meta Pixel, TikTok, LinkedIn, Hotjar) – “Require additional consent” with ad_storage and ad_user_data (Hotjar: analytics_storage).
  • Changes in GTM reach the site only after Submit → Publish. Preview mode (Tag Assistant) shows the workspace; the site shows the published version.
  • In basic mode Tag Assistant shows “Google tag not found” until the visitor consents to analytics or marketing – that is correct, because GTM does not load before consent. Accept, then reconnect. In advanced mode the tag is visible right away. The Consent tab shows the default “denied” state and the update after the decision.
  • “Phone click” conversion: use a “Click – Just Links” trigger with the condition Click URL starts with tel: (the built-in Click URL variable must be enabled). A “Custom Event” trigger works only if the site itself pushes that event to dataLayer.

Container tags in the scanner

The scanner does not read the content of the GTM container. It detects what the tags in the container load and send in the browser, so only the browser scan (scan mode and “Open the site in scan mode”) finds tags from GTM, and only after the container is published.

  • A detected service goes to “Detected on your site” – the same whether its tag is in the site code, in the container or added to GTM by hand. Its switch is off: the service appears in the banner once you switch it on and click “Save assignments”.
  • The tag has to fire during the scan. Tags on all pages are seen at once; a tag on an event (for example a conversion after a click on the phone number) only after that event.
  • The service has to be in the signature database. An address outside it goes to the list of unrecognised hosts in the Scanner – assign it a category and it becomes a service.
  • Google Ads in the new Google tag loads no separate file: it is inside gtm.js and sends data to googleads.g.doubleclick.net/pagead/… and google.com/pagead/…. From version 1.3.46 the scanner recognises these addresses as Google Ads (before: as Google DoubleClick).

Checking in the browser (F12)

Open the site in a private window to see the state before consent.

  • Elements: Ctrl+F and search for GTM-. Before consent the tag has type="text/plain" and data-consent-cat; after consent it is a normal script.
  • Network: filter gtm.js. Empty before consent; after accepting, gtm.js?id=GTM-… with status 200. Two gtm.js entries mean the container loads twice. Check Google Ads by filtering for the account number (the digits of AW-…).
  • Console: Object.keys(window.google_tag_manager || {}) lists the loaded containers (GTM-…); a Google Ads tag from the container has no separate entry there. dataLayer shows events and the consent state (consent, default and update).

dataLayer events

With “Send events to dataLayer” on, the module sends the events consent_ready, consent_update, consent_accept_all and consent_reject_all. You can use them as triggers in GTM.

Vyzkoušejte consetgo na svém webu

14 dní zdarma. Instalace zabere pár minut.

Vyzkoušejte 14 dní zdarma