
Google Consent Mode is a framework created by Google that provides options to a website to modify its behavior based on a user’s consent set . Google Consent Mode also includes additional UI options that, when used in combination, help support the user’s selection for their preferred personalized data use.
Is Google Consent Mode Mandatory?
Yes, there’s a particular type of Google Consent Mode, Google Consent Mode v2, that as of 6 March 2024 will be mandatory for all businesses using Google’s advertising services, Google Ads and Google Analytics (GA4), for advertising purposes or audience targeting. Google’s advertising-related platforms won’t be able to collect data for new users to these services in the EEA (European Economic Areas) if the businesses delivering those services don’t implement Google Consent Mode v2.
Furthermore, CMP (Consent Management Platform) approved by Google must now be used to manage consent. CookieYes, for example, is a CMP that supports Consent Mode v2.
Integrating Google Consent Mode v2 with CookieYes WordPress Plugin

The WordPress plugin, CookieYes comes out of the box with built-in Google Consent Mode v2 support. This allows any WordPress website owner to add Google Consent Mode v2, this privacy feature, as an out-of-the-box solution for their website.
With this feature, users have to give their consent in various ways to enable Google advertising cookies and any other vendor cookies. This guide provides step-by-step instructions on integrating Google Consent Mode v2 using this WordPress plugin.
If you haven’t already installed CookieYes on your WordPress site, Install and set up the CookieYes WordPress Plugin following this installation guide.
New Parameters in Consent Mode v2
ad_user_data: Whether user consent had been granted for the Google ad service to share user data, taking on a value of ‘granted’ or ‘denied’. If consent has been denied, Google ads will not collect identifiable user data.
ad_personalization: Shows if the user consented to receive personalized ads and to be retargeted. If user consent is revoked, the value is denied, which causes personalized ads not to function.
Steps to Integrate Google Consent Mode v2 with CookieYes
Step 1: To enable Google Consent Mode v2, connect your plugin to the CookieYes WebApp:
- Log in to your CookieYes web app account.
- Navigate to CookieYes Dashboard > Advanced Settings.
- Toggle the “Support GCM” button.

Step 2: Integrate GCM v2 Using Custom Consent Mode Scripts.
- Copy the below custom 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: “denied”,
personalization_storage: “denied”,
security_storage: “granted”,
wait_for_update: 2000,
});
gtag(“set”, “ads_data_redaction”, true);
gtag(“set”, “url_passthrough”, true);
</script>
Note
The values in the code are changeable as per your requirements. E.g.
gtag(“set”, “ads_data_redaction”,false);
gtag(“set”, “url_passthrough”,false);
2. Add the custom script directly above the wp_head() function in the website header.

Step 3: Add the gtag/GTM script.
Ensure that the Google Tag Manager (GTM) script is positioned directly below the Custom Consent Mode Script and above the wp_head() function. If GTM is not already installed:
- Create a Google Tag Manager account and set up a container.
- Navigate to the GTM Dashboard and copy the Container ID script.
- Paste the GTM script between the custom script and the wp_head() function, and insert the <noscript> element immediately after the <body> tag.

Step 4: Ensure the Order of the Scripts
Maintain the following script order for proper functionality:
- Custom Consent Mode script
- gtag / GTM script
- CookieYes script
Maintaining this sequence is essential for the correct operation of the functionality.
Note
Do not add CookieYes script again from the CookieYes Webapp. The wp_head() function already executes this action.
Google Consent Types and Mapping
CookieYes CMP maps Google’s seven consent types into four categories:By integrating Google Consent Mode v2 with CookieYes, you ensure compliance with privacy regulations and enhance user trust by respecting their consent choices.
Google Consent Type
CookieYes Consent Type
Purpose
ad_storage
advertisement
To enable advertisement cookies.
analytics_storage
analytics
To enable analytics cookies.
functionality_storage
functional
To enable functional cookies for website functionality and settings.
personalization_storage
functional
To enable functional cookies for user personalization.
security_storage
necessary
To enable necessary cookies for website security and protection.
ad_user_data
advertisement
To set consent for sending personal data to Google’s core services.
ad_personalization
advertisement
To use data for ad personalization, such as remarketing.
When combined with Google Consent Mode v2, CookieYes helps you meet the required privacy standards and ensures user trust by respecting their consent.
- How to Implement Google Consent Mode in WordPress: A Comprehensive Guide - July 12, 2024
- Is Kinsta’s Single Site Hosting Worth the Investment? - July 12, 2024