Starting from March 2024, the use of a CMP compatible with Consent Mode v2, will be mandatory to track European audiences with Google Ads. From July 31, 2024, it's Switzerland's turn!
Axeptio is a Google Partner CMP : https://www.axept.io/blog/cmp-partner-program-google
By following the steps in this documentation, you will ensure that you comply with the requirements of Consent Mode v2.
Here is how to implement Consent Mode v2 with Axeptio.
1. Activate the special screen in your widget
2. Set the default parameters of Consent Mode
A. Integration with Google Tag Manager
B. Integration into the Axeptio script
C. Integration with our Wordpress module
3. Basic Mode or Advanced Mode: the question of loading Google services
1. Activate the special screen in your widget
First of all, you will need to activate Consent Mode at your cookie widget level.
For this, go to your widget configuration.
Under the "classic" screens, you will find the "Activate Consent Mode v2 (screen)" option:
By checking this option, a new screen will be added to your widget, with the 4 parameters of Google's Consent Mode:
Once the option is checked, don't forget to republish your project!
2. Set the default parameters of Consent Mode
Here, you will set the default values of Consent Mode, that is, for each parameter, whether it will be accepted or refused, and this before any user choice.
This setup will need to 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 this module. If you load Axeptio directly via our hard script, then the modification will be made directly in the script. And if you load Axeptio in GTM, you'll have to do it there.
Go to the section corresponding to your Axeptio installation:
A. Integration with Google Tag Manager
B. Integration into the Axeptio script
C. Integration with our Wordpress module
A. Integration with Google Tag Manager
First, you will need to retrieve our "Axeptio CMP" tag model, available in the Google Tag Manager tag gallery.
For this, go to the "Templates" section in your GTM container, then click on "Search in the gallery":
Search in the window that opens "Axeptio CMP". Once found, add it to your workspace:
Now that the model has been added, we will be able to create a tag from it.
Therefore, go to the "Tags" section of your container and create a new one.
In the configuration of your new tag, select the "Axeptio CMP" model:
Then enter your Axeptio project ID and the cookie version in the corresponding fields. This is the section that will manage the loading of Axeptio.
For the record, if you were already loading Axeptio in another way via GTM, you will need to disable the old tag in favor of this one.
If you were already using the Axeptio CMP model to load Axeptio and these fields are already filled, you can skip this step.
We will now look at the "Google Consent Mode v2" section of this tag.
You will find a checkbox to activate the support of Consent Mode v2.
Once checked, new fields will appear:
Here we will be able to define the default values of Consent Mode, depending on the region.
Click on "Add a line".
In the "Region" field, enter the region code for which these default settings will apply. If you leave this field blank, it will apply to everyone. This field should be filled in according to the ISO 3166-2 standard, for example for France, the code to put is "FR".
You'll then have a dropdown field for each of the 4 Consent Mode v2 parameter, where you'll be able to choose if each is to be Granted or Denied on default. For the record, here are the 4 parameters of Consent Mode:
- analytics_storage: allows Google Analytics to measure how the visitor uses the site
- ad_storage: allows Google to save advertising information on the visitor's device
- ad_user_data: allows the sharing of the visitor's activity data with Google for targeted ads
- ad_personalization: allows the personalization of the visitor's advertising experience by allowing Google to personalize the ads he sees.
Here is an example where the parameters ad_storage and analytics_storage are by default granted, while ad_user_data and ad_personalization are by default denied. This is just an example and regulations may vary depending on the regions. For example, for visitors from European Union countries covered by the GDPR, it is recommended to set all these parameters to denied by default:
Once the various fields have been filled in, you can validate the addition of your line.
Please note that it is possible to create several lines, especially to have different configurations depending on the regions.
For example, I will create a default line, and a specific line for the United States.
In my default line, I will set my 4 parameters to Denied, while in the one for the United States, everything will be Granted. I then get two lines like this:
By this setting, my visitors will not be tracked by default, except for visitors from the United States.
Regarding the last two options "Redact Ads Data" and "Pass through URL parameters", these are additional operating options that are explained when hovering over the "?" next to the option.
All that's left is to load our tag at the right time, which is as early as possible!
To do this, go to the "Triggering" section of your tag, and add a "Consent Initialization - All Pages" trigger like this:
All that's left is to save your tag, and the Consent Mode is now active on your site! Congratulations
B. Integration into the Axeptio script
If you load Axeptio directly via our script, you should have something like this:
<script>
window.axeptioSettings = {
clientId: "yourProjectID",
};
(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>
We are going to add in the axeptioSettings object a googleConsentMode object, which will contain the default parameters of the Consent Mode, that is to say for each parameter, is it accepted or refused before any choice of the user, as soon as he arrives on the site.
As a reminder, here are the 4 parameters of the Consent Mode:
- analytics_storage: allows Google Analytics to measure how the visitor uses the site
- ad_storage: allows Google to save advertising information on the visitor's device
- ad_user_data: allows the sharing of the visitor's activity data with Google for targeted ads
- ad_personalization: allows the personalization of the visitor's advertising experience by allowing Google to customize the ads he sees.
Each of these parameters can be set by default either to "denied" or to "granted".
We will also pass a "wait_for_update" parameter which will allow to indicate to Google services to wait for consent for a set time before doing anything.
This parameter takes as value an integer, which corresponds to the number of milliseconds that this waiting period will last.
Another optional parameter is the "region" parameter, which allows to indicate default settings specific to a given region. This parameter takes as value the ISO 3166-2 code of the region. For example, for France, this code is "FR".
Here is an example in which the 4 parameters are accepted by default, for all regions combined, with a delay of 500 milliseconds, which is the standard waiting time.
window.axeptioSettings = {
clientId: "yourProjectID",
googleConsentMode: {
default: {
analytics_storage: 'denied',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
wait_for_update: 500,
}
}
};
Let's now look at an example, where for all my visitors, everything is refused by default, except for those from the United States, where the Consent Mode parameters will be accepted by default.
window.axeptioSettings = {
clientId: "yourProjectID",
googleConsentMode: {
default: [
{
analytics_storage: 'denied',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
wait_for_update: 500,
},
{
region: ['US'],
analytics_storage: 'granted',
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
wait_for_update: 500,
}
]
}
};
Once your settings are well defined, the Consent Mode is now active on your site. Congratulations!
C. Integration with our Wordpress module
Go to your WordPress admin, then to your Axeptio module.
In the "Configuration" section, you will find a brand new option to activate Consent Mode v2.
If you don't see this option, check if you have the latest version of our WordPress module.
For each parameter, you can set its default value by checking or unchecking the box to the left of the parameter. If the box is checked, the parameter will be in "Granted" by default, whereas if the box is unchecked, the parameter will be in "Denied" by default.
It is recommended for your visitors from the Euro zone to set all four parameters to "Denied" by default, as in the example above.
Once your settings are done, don't forget to save your changes at the bottom of the page.
Consent Mode v2 is now activated on your site!
3. Basic Mode or Advanced Mode: the question of loading Google services
Google describes two operating modes of Consent Mode: basic mode and advanced mode.
In basic mode, your Google services should only be loaded after consent. This corresponds to a "classic" integration of Axeptio, where Axeptio will be the conductor who decides when Google services are loaded. To set up this integration, you can rely on our existing documentation:
- If you load your Google services with Google Tag Manager: Google Tag Manager Interface
- If you load your Google services with Gtag.js: Custom Integration / synchronization
With basic mode, you can be sure that nothing is loaded on your site before the visitor's consent!
In advanced mode, your Google services will be loaded as soon as you arrive on the site, regardless of whether the visitor has already accepted cookies or not. This mode allows Google to make more precise models on visitors who have refused, by collecting anonymous data on them.
In this mode, you will therefore not have to control consent before loading your Google services.
For example:
- in Google Tag Manager, you can load your Google tags on "All pages"
- or if you load your Google services via Gtag.js, you can load the script directly without any conditions, as would be the case in a "classic" Axeptio integration.
With advanced mode, you give all their chances to your Google services to have the most qualified data!