Skip to main content

Configure Google Consent Mode v2 (Hard-coded Integration)

Since 2024, using a compatible CMP is mandatory to track European audiences with Google products.

Written by Alexandre Dias Da Silva

This article is for you if you integrated Axeptio via a hard-coded snippet. Using a different method? Check out the guide for: GTM integration · CMS integration — Learn more about integration methods

Google Consent Mode v2 is a mechanism offered by Google that adjusts the behavior of its tags (Google Analytics 4, Google Ads, etc.) based on your visitors' consent choices. Without it, your Google services cannot adapt their behavior to your visitors' choices, which results in degraded measurements in Google Analytics and Google Ads.

Concretely:

  • If the visitor accepts: the tags work normally, cookies are placed, complete data is sent to Google.

  • If the visitor refuses: the tags do not place cookies, but send pings to Google — minimalist signals (consent state, user agent, timestamp) without individual identification of the visitor. These pings allow Google to model unobserved conversions.

To go deeper into the concepts: Consent Mode — official Google documentation 💉 Need a refresher? Check out our blog post

Consent Mode signals

Consent Mode v2 is based on 4 required signals:

Signal

Role

analytics_storage

Authorizes Google Analytics to measure visitor behavior on the site

ad_storage

Authorizes Google to save advertising information on the visitor's device

ad_user_data

Authorizes the sending of visitor activity data to Google for targeted advertising

ad_personalization

Authorizes personalization of Google ads displayed to the visitor

Google also defines 3 optional signals (functionality_storage, personalization_storage, security_storage) that you can configure if your use case requires it. For most sites, the 4 signals above are sufficient.

Configuration takes place in 2 steps — both are mandatory: 1. Define default signals (in your GTM tag or code snippet) These values are sent to Google as soon as the page opens, before any visitor interaction with the banner. For European visitors subject to GDPR, the 4 signals must be denied by default. 2. Enable the Consent Mode v2 screen in your Axeptio banner This screen allows updating the signals after the visitor makes their choice. Without it, the signals remain locked at their default values — even if the visitor accepts everything, Google will continue to receive denied. The Axeptio registry will be correct, but the Google tags will never receive the granted signal.

⚠️ These 2 steps are inseparable. One without the other produces an invalid implementation.

Basic mode or advanced mode: which one to choose?

Before configuring anything, choose your mode — it directly determines how your Google tags should be triggered.

Basic mode

Advanced mode

Loading Google tags

Blocked until banner interaction

Immediate when page opens

Data sent to Google before consent

None — not even a ping

Pings without cookies (consent state, user agent, timestamp)

Google modeling

Generic model (less accurate)

Advertiser-specific model (more accurate)

Conditioning logic

Google tags blocked until consent

Google tags triggered systematically

Depending on the mode chosen, you must adapt your conditioning logic (in GTM or in your code).

Basic mode: Google services (GA4, Google Ads) must be present in your Axeptio banner — they control the blocking/unblocking of tags. Advanced mode: only the Consent Mode v2 screen is needed in the banner — no need to add Google services.

Basic mode

Google tags do not load until the visitor has interacted with the banner. No data is sent to Google before this interaction — not even a consent ping. If the visitor refuses or ignores the banner, Google receives nothing.

In return, Google modeling is based on a generic model (global population, less accurate than in advanced mode).

For conditioning logic, rely on our documentation:

Advanced mode

Google tags load as soon as the page opens, before any interaction with the banner. From that moment, they send pings without cookies to Google — minimalist signals (consent state, user agent, timestamp) that do not allow individual identification of the visitor, but that allow Google to build a modeling model specific to your site (more accurate than in basic mode).

  • When the visitor accepts: cookies placed, complete data transmitted.

  • When the visitor refuses: pings without cookies only, no individual targeting.

For conditioning logic:

  • In Google Tag Manager: load your Google tags with the "All Pages" trigger

  • With Gtag.js: load the script directly, without condition

Note — Google modeling requires sufficient traffic volume to activate. Thresholds vary by product: for GA4, you need at least 1,000 consenting visitors per day over 7 consecutive days; for Google Ads, 700 ad clicks over 7 rolling days. Below these thresholds, advanced mode remains valid but without modeling benefit. For details: Behavioral modeling — GA4 · Conversion modeling — Google Ads.

FR_Infographie-COMOv2.png

Enable the dedicated screen in your banner

With Axeptio, you control the Consent Mode signals directly from your cookie banner. In just a few clicks, you can enable a dedicated screen for managing Consent Mode v2.

To do this, go to your widget configuration.

Below the "classic" screens, you will find the option "Enable Consent Mode v2 (step)":

By checking this option, a new screen will be added to your widget with the 4 Google Consent Mode parameters:

Once the option is checked, don't forget to republish your project!

Without this screen, the signals are never updated. The default values (e.g. denied) remain in place for all visitors, including those who accept. Google never receives the granted signal.

Compliance with Google requirements

For a CMP to be recognized as compatible by Google, your banner must meet three requirements:

  • Inform visitors that data is collected for personalization and advertising effectiveness measurement purposes

  • Include a link to Google's privacy policy: https://business.safety.google/privacy/

  • Provide an explicit acceptance button (an "Accept" button or equivalent clearly visible)

When you add Google Analytics 4 or Google Ads to your Axeptio banner, the dedicated Consent Mode v2 screen is automatically enabled. This screen presents the 4 Consent Mode parameters with the information and link required by Google — the three requirements above are thus satisfied without any additional action.

Set Consent Mode default parameters

Here, you will configure the default values of Consent Mode, that is, for each parameter, whether it will be accepted or refused before any user choice.

This configuration must be done in the same place where you load Axeptio.

For example, if you load Axeptio via our WordPress module, the configuration will be done in that module. If you load Axeptio directly via our hard-coded script, then the modification will be done directly in the script. And if you load Axeptio via GTM, it will be done in GTM.

Denied or granted by default: the choice of signals The default signals you must define depend on the regulation applicable to the region of your visitors. For example, for visitors from European Union countries (and therefore subject to GDPR), you must set the 4 parameters to denied by default.

Loading order — The Axeptio snippet must be placed before any Google script (gtag.js, gtm.js) in your <head>. Otherwise, Google tags may execute before the default consent signals are set.

We will add a googleConsentMode object to the axeptioSettings object, which will contain the Consent Mode default parameters.

We will also pass a wait_for_update parameter which tells Google services to wait for consent for a defined time (in milliseconds) before executing. The standard value is 500ms.

An optional region parameter allows you to specify default parameters specific to a given region, in ISO 3166-2 format (e.g. "FR" for France).

Here is an example in which the 4 parameters are refused by default, for all regions, with the correct loading order:

<!-- Axeptio first in the <head> -->
<script>
window.axeptioSettings = {
clientId: "yourProjectID",
googleConsentMode: {
default: {
analytics_storage: 'denied',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
wait_for_update: 500,
}
}
};
(function(d, s) {
var t = d.getElementsByTagName(s)[0], e = d.createElement(s);
e.async = true; e.src = "//static.axept.io/sdk.js";
t.parentNode.insertBefore(e, t);
})(document, "script");
</script>

<!-- Google scripts after -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>

Once your parameters are properly configured, Consent Mode is now active on your site. Congratulations!

Verify Consent Mode v2 implementation

You can verify proper implementation of Consent Mode v2 by following one of the following tutorials:

About the old Axeptio Consent Mode v2 tag model

🚧 If you had followed the old documentation on implementing Consent Mode v2 via the "Axeptio Consent Mode v2" model in Google Tag Manager, you do not need to update your current implementation.

Furthermore, you do not need to enable the special Consent Mode screen in your cookie widget, as the Axeptio Consent Mode v2 model is based on the acceptance of Google Analytics and Google Ads directly. Make sure you have these two services listed in your cookie widget.

The Axeptio Consent Mode v2 model will continue to work, but may not be maintained if Consent Mode updates are released. If you wish, you can update your implementation to the new method today, but it is not required.

Official Google documentation

To learn more about Consent Mode parameters and functionality, consult official Google resources:

Need help?

If you detect issues related to missing Consent Mode or TCF signals on Google tags, contact Axeptio first.

Did this answer your question?