Behavior

Google Tag Manager and Consent Mode v2: measurement that respects cookie consent

Tag Manager decides what gets measured on your website, Consent Mode decides what you are allowed to measure. If either one fails, you make budget decisions on the wrong numbers.

Štěpán Pluháček6 min read

Illustration: coloured tags dropping into a container through a gate guarded by a shield and a consent toggle.
In this article
  1. What Google Tag Manager is and why you want it
  2. Three terms you can’t do without
  3. How to roll out GTM without chaos
  4. Consent Mode: measurement with cookie consent
  5. Example: how much data is missing without consent
  6. How to check that it works
  7. Checklist

What Google Tag Manager is and why you want it

Google Tag Manager (GTM) is a free tool for adding measurement and advertising code to your website: GA4, Google Ads, the Meta pixel, Sklik and others. The GTM container is added to the website once and everything else is managed in its interface, without touching the website code.

For a company this has a practical impact:

  • A change in measurement doesn’t wait for a developer and the next sprint.
  • All the code is in one place, so you know what runs on the website and what is sent to whom.
  • Every change is a version you can roll back.
  • Cookie consent can be handled centrally for all the code at once.

Three terms you can’t do without

Tags

The code that should run. For example sending an event to GA4 or a conversion to Google Ads.

Triggers

When the tag fires: on page load, on a button click, on a form submission or on a custom event from the website.

Variables

The values a tag needs: order amount, product ID, page URL.

They are connected by the data layer (dataLayer), the place where the website writes information for GTM. The most reliable measurement of purchases and forms is built on it: when an order is completed, the website writes the value and items to the data layer and GTM passes them on to GA4 and the ad platforms. Tracking clicks by button text is fragile. All it takes is someone renaming the button and measurement quietly stops working.

How to roll out GTM without chaos

  1. Write down what you measure and why. For each event, the business question it answers. If there is no question, don’t measure it.
  2. Map what already runs on the website. The most common mistake is duplicate measurement: GA4 hard-coded in the template and also in GTM.
  3. Agree the data layer with your developers. Above all for purchases, enquiries and sign-ups.
  4. Test in preview mode. GTM has a Preview mode where you see which tags fired on which action before you publish the change.
  5. Publish with a version description. In six months you will want to know who changed what and why.
  6. Watch the permissions. Whoever can publish can add any script to the website. Give publishing rights only to people who take responsibility for them.

In the Czech Republic, since 1 January 2022, cookies that are not essential for the website to work require prior consent (opt-in), as the Czech data protection authority explains (in Czech). You may use analytics and advertising cookies only after the visitor agrees. At the same time you want to know what your advertising brings in. This is where Google’s Consent Mode comes in.

Consent Mode is the mechanism through which the website passes the consent state to Google tags (GA4, Google Ads and others). The tags behave accordingly: without consent they don’t store cookies.

What version 2 brought

Consent Mode v2 added two new signals to the original two. Together there are four parameters:

  • analytics_storage – consent to analytics cookies.
  • ad_storage – consent to advertising cookies.
  • ad_user_data – consent to sending user data to Google for advertising purposes.
  • ad_personalization – consent to personalised advertising, including remarketing.

Since March 2024, Google has required consent and consent signals for visitors from the European Economic Area if you want to keep using measurement, remarketing and ad personalisation. This is linked to the EU Digital Markets Act (DMA).

Basic vs. advanced mode

  • Basic: according to Google’s documentation, Google tags don’t load at all until consent is given. Without consent nothing goes to Google.
  • Advanced: tags load straight away, but without consent they store no cookies and send only signals without identifiers (cookieless pings). Google then models part of the missing conversions from them.

Which mode to choose is a legal and business decision, not just a technical one. Advanced gives more accurate data for managing campaigns, basic is more conservative. Discuss it with whoever is responsible for data protection in your company.

  1. Before any tag loads, a default consent state is set. For visitors from the EU, typically everything denied.
  2. The cookie banner shows the choice.
  3. Once the visitor decides, the banner sends an update and the tags behave accordingly.
  4. The choice is stored and applied straight away on the next visit.

In practice this is handled by a cookie banner (CMP, consent management platform) with Consent Mode v2 support, connected through GTM. Google keeps a list of certified CMP providers, and with them the setup is easiest.

Example (made-up numbers): An e-shop has 1,000 orders a month according to its own system. About 70% of visitors consent to analytics cookies. In basic mode, GA4 will therefore see roughly 700 orders, and Google Ads only those where advertising cookies were accepted too.

The 300 orders “missing” from GA4 don’t matter as long as you know about it and follow the trend rather than absolute numbers. The problem comes when the budget of a campaign that actually makes money is cut based on incomplete data. That is why you should keep a source of truth from your e-shop next to GA4 and track the overall PNO across all revenue. More in PNO, ROAS and margin.

How to check that it works

  • Open the website in a private window and check in GTM preview mode that the default consent state is set before the first tag fires.
  • Decline cookies and check in the browser tools that neither the _ga cookies nor advertising cookies were written.
  • Give consent and check that the state changed to granted and that events reached GA4 (DebugView).
  • In Google Ads, check the consent diagnostics on your conversion actions.
  • Run the “analytics only” scenario: GA4 should measure, advertising tags should not.

Checklist

  • Each tag is added to the website in one way only.
  • Purchases and enquiries are measured from the data layer, not from button text.
  • The default consent state is set before the first tag.
  • The cookie banner sends all four Consent Mode v2 parameters.
  • You have tested the scenarios: all declined, all accepted, analytics only.
  • Only authorised people can publish and versions have descriptions.
  • Once a quarter you go through the container and delete what you no longer need.

GTM and Consent Mode are plumbing. Done well, nobody notices; done badly, they distort every budget decision. The follow-up reads are GA4 for beginners and our overview of analytics and measurement.

Share the article

Frequently asked questions

Is Google Tag Manager free?

Yes, the standard version is free. A paid version exists for large companies as part of Google Marketing Platform.

Do I have to use Consent Mode v2?

If you use Google Ads and target visitors from the EEA, Google requires it for full use of conversion measurement, remarketing and personalisation. Without it you lose data and targeting options.

Does Consent Mode replace the cookie banner?

No. Consent Mode only passes on to Google tags the choice the visitor makes in the cookie banner. You still need the banner.

Will Tag Manager slow down my website?

The container itself not significantly. What slows a website down are mainly the tags you put in it, so regularly delete the ones you no longer need.

Want to talk it through for your business?

In a consultation we go through where your marketing is leaking money and what to do about it. No strings attached, no bullshit.

Book a consultation

Your call withJan Rypar, Founder