{"id":30104,"date":"2026-08-01T11:18:00","date_gmt":"2026-08-01T10:18:00","guid":{"rendered":"https:\/\/www.web-systems.pl\/consent-mode-v2-cookie-banner-google-tags\/"},"modified":"2026-10-13T14:55:58","modified_gmt":"2026-10-13T13:55:58","slug":"consent-mode-v2-cookie-banner-google-tags","status":"publish","type":"post","link":"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/","title":{"rendered":"Consent Mode v2: how to connect a cookie banner to Google tags"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Consent Mode v2<\/strong> is a mechanism that passes the user&#8217;s decision from the cookie banner to Google tags. The tags adjust their behavior to match it. You already have a banner, but you see gaps in your Google Analytics data and Google Ads keeps throwing consent warnings?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then the problem almost always sits where the banner meets the tags. Below we describe how Google&#8217;s consent mode works and which variant to choose. We also show how to set it up in GTM or in gtag.js and how to check that everything works.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#What_is_Consent_Mode_v2_and_what_does_it_not_take_care_of\" >What is Consent Mode v2 and what does it not take care of?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Which_consent_signals_does_the_cookie_banner_pass_to_Google_tags\" >Which consent signals does the cookie banner pass to Google tags?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#ad_storage_denied_what_does_it_mean_in_practice\" >ad_storage denied: what does it mean in practice?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Basic_or_advanced_Consent_Mode_which_one_to_choose\" >Basic or advanced Consent Mode: which one to choose?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Setting_up_Consent_Mode_in_GTM_step_by_step\" >Setting up Consent Mode in GTM step by step<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#How_to_check_that_the_cookie_banner_Google_Analytics_and_Ads_work_together\" >How to check that the cookie banner, Google Analytics and Ads work together?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#What_to_do_about_gaps_in_statistics_after_adding_the_banner\" >What to do about gaps in statistics after adding the banner?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Frequently_asked_questions\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Is_Consent_Mode_v2_enough_to_make_a_website_GDPR_compliant\" >Is Consent Mode v2 enough to make a website GDPR compliant?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Does_Google_Analytics_collect_nothing_when_consent_is_denied\" >Does Google Analytics collect nothing when consent is denied?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.web-systems.pl\/en\/consent-mode-v2-cookie-banner-google-tags\/#Do_I_have_to_use_Google_Tag_Manager\" >Do I have to use Google Tag Manager?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Consent_Mode_v2_and_what_does_it_not_take_care_of\"><\/span>What is Consent Mode v2 and what does it not take care of?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Consent Mode v2 is the channel through which the cookie banner passes the consent state to Google. Analytics tags, Ads tags and third-party tools change how they work based on it. This is how the <a href=\"https:\/\/support.google.com\/google-ads\/answer\/10000067\" rel=\"nofollow noopener\" target=\"_blank\">Google Ads help page on consent mode<\/a> describes it: the mechanism receives the choice from the banner or widget and dynamically adapts the behavior of tags that create or read cookies. The consent state also travels with the user to subsequent pages, so there is no need to set it again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And this is where a misunderstanding often comes up. The banner and consent mode are two separate things: the banner collects the decision, and Consent Mode only delivers it to the tags. So Consent Mode alone will not make you GDPR compliant. You handle the legal basis, the banner wording and the consent log separately, and as a starting point I recommend reading what <a href=\"https:\/\/www.web-systems.pl\/en\/gdpr-aspects-cookies-and-consent-implementation\/\">cookie consent under GDPR<\/a> looks like.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Which_consent_signals_does_the_cookie_banner_pass_to_Google_tags\"><\/span>Which consent signals does the cookie banner pass to Google tags?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Google tags read several consent parameters. For advertising, <strong>ad_storage<\/strong> matters most. Each parameter has the value <em>granted<\/em> or <em>denied<\/em>, nothing in between:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ad_storage<\/strong> - storing and reading advertising cookies,<\/li>\n<li><strong>analytics_storage<\/strong> - cookies for traffic measurement,<\/li>\n<li><strong>ad_user_data<\/strong> - consent to send user data to Google for advertising purposes,<\/li>\n<li><strong>ad_personalization<\/strong> - consent to personalized ads, including remarketing.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ad_storage_denied_what_does_it_mean_in_practice\"><\/span>ad_storage denied: what does it mean in practice?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When consent is denied, no new advertising cookies are created. Previously stored third-party cookies from google.com and doubleclick.net are not used either (the exception is fighting spam and abuse). But watch out. As the <a href=\"https:\/\/developers.google.com\/tag-platform\/security\/guides\/consent\" rel=\"nofollow noopener\" target=\"_blank\">Google guide for developers<\/a> points out, the full page URL still reaches Google, along with the ad click parameters. Want to cut that off? Turn on <em>ads_data_redaction<\/em>. Then, when consent is denied, click identifiers disappear from Ads and Floodlight tag requests, and the requests themselves go through a domain without third-party cookies.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same setting also decides what cookie consent means for Google Ads. ad_storage decides whether cookies and advertising identifiers collected by the Analytics tag can reach the advertising account at all.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Basic_or_advanced_Consent_Mode_which_one_to_choose\"><\/span>Basic or advanced Consent Mode: which one to choose?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In basic mode, Google tags do not fire before consent. In advanced mode they load right away, and when consent is denied they send cookieless pings. Without consent, the basic variant passes nothing to Google, not even the status itself. Conversion modeling in Ads then relies on a general model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the advanced variant, the tags load the consent mode API when the user lands on the page. The user declines? The tags do not store cookies, they only send cookieless signals about the consent state and activity. Oh, and in the paid version of Google Analytics this does not add extra events or push up event-based billing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my opinion, the choice should follow from a legal assessment and from how the company approaches sending any data at all without consent. Not from the mere wish to get the statistics back. And nobody honest will tell you upfront what share of conversions will come back.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Setting_up_Consent_Mode_in_GTM_step_by_step\"><\/span>Setting up Consent Mode in GTM step by step<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The whole setup comes down to two things: setting the default consent state before the tags load, and updating it the moment the user clicks in the banner. In <a href=\"https:\/\/www.web-systems.pl\/en\/google-tag-manager-organize-tracking-codes\/\">Google Tag Manager<\/a> the order looks like this:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The Google tag on every page of the site.<\/li>\n<li>Default <em>denied<\/em> for all parameters, set before the other tags (the consent initialization trigger).<\/li>\n<li>The banner sends the <em>update<\/em> command right after the user&#8217;s decision.<\/li>\n<li>GA4 and Ads tags use built-in consent handling, and tags from other vendors get additional consent conditions in their settings.<\/li>\n<li>A test in preview mode, described in the next section.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">It can be done without GTM too. The consent mode code then goes directly into gtag.js on every page. This is how the banner on web-systems.pl works: it is a custom solution that sets <em>denied<\/em> by default for gtag and changes the state only after the user makes a choice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_check_that_the_cookie_banner_Google_Analytics_and_Ads_work_together\"><\/span>How to check that the cookie banner, Google Analytics and Ads work together?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You check this in GTM preview mode and in the browser&#8217;s developer tools, looking at the consent state before and after the click in the banner. Three things to tick off: default <em>denied<\/em> before the first interaction, a change to <em>granted<\/em> after acceptance, and zero new advertising cookies after a refusal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typical slip-ups? Default consent set only after the tags. A banner that does not send the update. Third-party tags fired without a consent condition. And you have to wait for the results in reports: according to the description of the consent mode impact report, Google Ads and Analytics can show an uplift after at least 7 full days, and only with enough data. If the warnings in your advertising account mean your conversions need tidying up, <a href=\"https:\/\/www.web-systems.pl\/en\/adwords-campaigns-why-is-it-worth-investing-in-them\/\">Google Ads campaign management<\/a> by a team that knows both sides of the configuration will help.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_to_do_about_gaps_in_statistics_after_adding_the_banner\"><\/span>What to do about gaps in statistics after adding the banner?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Less data in GA4 after adding the banner is simply the result of denied consent. Consent Mode v2 partly patches these gaps with modeling, but it will not restore the full picture. So the numbers in Analytics will drift apart from the sales system, which sees every order. And that is normal. The simplest approach is to agree within the company that the source of truth for revenue is the store or the CRM, and GA4 is for trends and the proportions between channels.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Companies that prefer to keep their data in-house look toward analytics without Google Analytics, for example a <a href=\"https:\/\/www.web-systems.pl\/en\/analytics-without-google-self-hosted-matomo\/\">self-hosted Matomo instead of GA<\/a>. The technical details are covered on the page about <a href=\"https:\/\/www.web-systems.pl\/en\/matomo-analytics-implementation\/\">Matomo analytics implementation<\/a>. Just remember that such a tool also has to be assessed under GDPR.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Where to start? With one thing: check whether the default consent state is set before all the tags. Without that, even a properly configured Consent Mode v2 will not work the way you expect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1790303236621-0\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Is_Consent_Mode_v2_enough_to_make_a_website_GDPR_compliant\"><\/span>Is Consent Mode v2 enough to make a website GDPR compliant?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>No. Consent mode only passes the user&#8217;s decision to Google tags. Collecting consent, its wording and documenting it are a separate obligation of the website&#8217;s data controller.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1790303236621-1\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Does_Google_Analytics_collect_nothing_when_consent_is_denied\"><\/span>Does Google Analytics collect nothing when consent is denied?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>It depends on the mode. In basic mode the tags are blocked and nothing reaches Google. In advanced mode the tags send cookieless pings with information about the consent state and activity.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1790303236621-2\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Do_I_have_to_use_Google_Tag_Manager\"><\/span>Do I have to use Google Tag Manager?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>No, you can set up consent mode directly in gtag.js on every page. GTM does come in handy when you have many tags, because it lets you manage them and their consent conditions in one place.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Consent Mode v2 is a mechanism that passes the user&#8217;s decision from the cookie banner to Google tags. The tags adjust their behavior to match it. You already have a banner, but you see gaps in your Google Analytics data and Google Ads keeps throwing consent warnings? Then the problem almost always sits where the [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":30073,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[814],"tags":[2153,1683,1105,2159,974,2161],"class_list":["post-30104","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-online-marketing-en","tag-consent-mode-x","tag-cookies-en","tag-gdpr","tag-google-ads-x","tag-google-analytics-en","tag-gtm-x"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts\/30104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/comments?post=30104"}],"version-history":[{"count":3,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts\/30104\/revisions"}],"predecessor-version":[{"id":30153,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts\/30104\/revisions\/30153"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/media\/30073"}],"wp:attachment":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/media?parent=30104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/categories?post=30104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/tags?post=30104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}