Google Consent Mode v2: Free Copy-Paste Setup

🔒ma-boutique.fr
Welcome to our online shop. Discover our handcrafted products made with care.
🍪 This site uses cookies
We use cookies to improve your experience and analyse traffic.
Necessary Essential for the site to function.
Analytics Audience measurement (e.g. Google Analytics).
Marketing Targeted advertising (e.g. Facebook Pixel).
Powered by WebLegal.ai
Preferences saved

In short: Google Consent Mode v2 has been mandatory since March 2024 for any advertiser using Google Ads, Google Analytics 4 or Google Tag Manager to reach the EEA or the UK. It requires four signals — ad_storage, analytics_storage, ad_user_data and ad_personalization — and two ordering rules decide whether an implementation actually works: every signal must default to denied before any Google tag loads, and the update must fire the moment the visitor chooses, not on the next page load. Send nothing and Google Ads keeps running, but conversion measurement collapses and remarketing audiences stop building.

The cost of getting it wrong is measurable: campaigns lose up to 70% of their measured conversions, and some remarketing features are disabled outright.

The good news: if your cookie banner is well designed, integration takes 5 minutes. In this article we explain what Consent Mode v2 is, why it has become unavoidable, and how to implement it cleanly, with or without a custom banner.

Set up a Consent Mode v2 banner in 2 minutes →

Google Consent Mode is a technical framework that lets your Google scripts (Analytics, Ads, Tag Manager) adapt dynamically to each visitor’s consent choice. Rather than fully blocking or unblocking the scripts, it sends them signals so they can run in a degraded mode when the user declines.

Version 2, introduced late 2023 and made mandatory in March 2024 for EEA + UK advertisers, adds two major signals (note: the UK Data (Use and Access) Act 2025 softened consent for some low-risk analytics cookies but kept marketing-side opt-in fully in scope, so Consent Mode v2 remains required for Google Ads and remarketing in the UK):

  • ad_user_data: whether user data may be passed to Google for advertising
  • ad_personalization: whether personalised advertising is allowed (remarketing)

These two signals add to the four existing ones (analytics_storage, ad_storage, functionality_storage, personalization_storage, security_storage).

Without a proper Consent Mode v2 implementation:

  • Google Ads stops recording conversions from users who did not consent (instead of modelling them via Google’s AI)
  • Remarketing audiences drain progressively
  • Google Analytics 4 no longer sends data for denied users and cannot model missing conversions
  • Your GA4 reports become incomplete and unusable for marketing decisions

In practice, an e-commerce site without Consent Mode v2 loses 60 to 70% of visibility on the purchase journey. Google Ads campaigns are flown blind.

The two modes: Basic vs Advanced

Google distinguishes between two implementations:

Basic mode

Google scripts only load after consent. If the user declines, no data is sent and no conversion model is built. This is the simplest approach but the least performant for marketing.

Google scripts load on arrival, but in degraded mode. They send anonymous signals (cookieless ping) to Google, which uses AI to model the missing conversions. Users who consent trigger the scripts fully.

Advanced mode typically recovers 40 to 60% of lost conversions via Google’s modelling. It is Google’s recommended mode and the one natively implemented by modern banners such as WebLegal CCB.

Recent banners integrate Consent Mode v2 transparently. With WebLegal CCB, you write no code: the script automatically emits the correct signals to gtag.js and Google Tag Manager based on the user’s choices.

<script src="https://weblegal.ai/js/wl-cookie-consent.js"
  data-wl-cc
  data-position="popup"
  data-theme="auto"
  data-privacy-url="/privacy-policy"
  defer></script>

That is all. The script:

  1. Sets the defaults to denied before any interaction
  2. Loads your Google tags (Analytics, Ads) in degraded mode
  3. Updates the analytics_storage, ad_storage, ad_user_data, ad_personalization signals according to the visitor’s choice
  4. Triggers the normal tag flow after consent

On Joomla, WordPress, Shopify, PrestaShop or Wix

Most Consent Mode guides send you hunting for a plugin, which is why the answer differs on every platform. It does not have to. Consent Mode v2 is emitted by JavaScript in the page, so a banner that ships as a plain script tag works identically everywhere, with no extension to install, update or pay for.

Where to paste the snippet above:

  • Joomla: System, then Site Templates, edit your template’s index.php and paste it before </head>. A custom HTML module set to the head position works too if you prefer not to touch the template. Joomla has platform-specific traps — page caching, template updates overwriting the file, plugin load order — covered in our dedicated Joomla Consent Mode v2 guide.
  • WordPress: your theme’s header.php before </head>, or any “insert header scripts” field (most themes and SEO plugins expose one). No dedicated consent plugin needed.
  • Shopify: Online Store, Themes, Edit code, theme.liquid, before </head>.
  • PrestaShop: Design, Theme, edit head.tpl, or add it through a custom HTML block in the header.
  • Wix, Squarespace and other closed builders: the custom-code panel, scoped to all pages and set to load in the head.

One caveat that applies to every platform: if your CMS already has its own cookie banner or consent plugin active, disable it first. Two banners emitting gtag('consent', ...) will fight, and the last one to run wins, which is how sites end up sending denied to Google after the visitor accepted.

With a manual implementation

If you use a custom solution, you must add, before any Google script:

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'functionality_storage': 'granted',
  'security_storage': 'granted',
  'wait_for_update': 500
});
</script>

Then at the moment of consent:

gtag('consent', 'update', {
  'ad_storage': 'granted',
  'ad_user_data': 'granted',
  'ad_personalization': 'granted',
  'analytics_storage': 'granted'
});

With Google Tag Manager

GTM offers built-in Consent Mode templates. You need to:

  1. Enable consent mode in the GTM interface
  2. Configure each tag to respect the required signals
  3. Wire the CMP (Consent Management Platform) to the trigger variables

This approach is flexible but demands a good grasp of GTM and debugging with Tag Assistant.

Mistakes to avoid

1. Implementing Consent Mode but letting cookies drop before consent. Google accepts the signals, but the ICO, CNIL and their peers punish the pre-consent cookie drop. Consent Mode does NOT exempt you from the prior consent obligation. That obligation comes from Article 5(3) of the ePrivacy Directive.

  1. Member States shall ensure that the storing of information, or the gaining of access to information already stored, in the terminal equipment of a subscriber or user is only allowed on condition that the subscriber or user concerned has given his or her consent, having been provided with clear and comprehensive information, in accordance with Directive 95/46/EC, inter alia, about the purposes of the processing.

ePrivacy Directive, Article 5(3)

2. Forgetting wait_for_update. This parameter (in milliseconds) tells Google how long to wait for the visitor’s choice before sending the first signals. Without it, pings are sent immediately in denied mode, skewing your metrics.

3. Confusing Consent Mode with the cookie banner. Consent Mode is the technical plumbing that sends signals to Google. The banner is the interface that collects the user’s consent. You need both.

4. Not testing. Google’s Tag Assistant Chrome extension lets you verify in real time that signals are being emitted. Test the three scenarios: full refusal, partial acceptance, full acceptance.

How to check your site is compliant

Three free tools:

  1. The WebLegal scanner checks for a banner, tracker blocking before consent, and Consent Mode configuration
  2. Google Tag Assistant (Chrome extension) displays the signals your tags send
  3. DevTools > Application > Cookies lets you verify no analytics or advertising cookie is dropped before the “Accept” click

In summary

Consent Mode v2 has become the technical standard for reconciling marketing measurement and GDPR compliance. Manual implementation is possible but demands rigour and testing. For most sites, a modern banner with native integration, such as WebLegal CCB, is the most robust and simplest solution.

Beyond Consent Mode, remember that compliance also requires the mandatory legal documents: privacy policy, cookie policy, legal notice.

Generate your banner + GDPR documents →

FAQ

It is mandatory for advertisers using Google Ads, GA4 or GTM to reach EEA and UK audiences. If you use no Google products, you do not need it, but you must still comply with GDPR for other trackers.

The same way on all three. Consent Mode is emitted by JavaScript in the page, so a banner shipped as a plain script tag works everywhere with no plugin: paste it before the closing </head> tag. In Joomla via the template’s index.php or a head-position custom HTML module, in WordPress via header.php or an insert-header-scripts field, in Shopify via theme.liquid. Disable any existing consent plugin first, since two banners emitting consent signals will conflict.

No. Consent Mode v2 handles signals on Google’s side, but GDPR compliance also requires prior consent, a banner with a “Reject” button as prominent as “Accept”, and a documented cookie policy.

Basic or Advanced mode: which to pick?

Advanced mode is recommended by Google because it enables conversion modelling, recovering 40-60% of the lost marketing performance. Basic mode is simpler to implement but less performant.

How much does it cost to implement?

Zero with a banner like WebLegal CCB which integrates it natively. Between €500 and €2,000 for a manual implementation by a developer, depending on the complexity of your stack.

Your GA4 reports are incomplete, your Google Ads campaigns lose 60-70% of measured conversions, and remarketing audiences drain. Technically Google Ads keeps working, but your marketing steering becomes blind.