Our WordPress plugin now supports “Google Consent Mode v2.” This feature allows you to set up the plugin to inform Google’s gtag.js or GTM about the choices your users make regarding cookies and tracking on your site.
Note
Google Consent Mode v2 is a tool that helps communicate users’ consent choices from your website to Google. It’s crucial for websites using Google services like Analytics, Ads, and more, ensuring you comply with privacy laws.
Compliance with privacy laws: Using Consent Mode helps your website follow the GDPR by telling Google only to track users when they have given permission.
Necessary for websites using Google services: If your site uses any Google services, you need Consent Mode to keep collecting important data legally. This is especially true for visitors from the European Economic Area (EEA) and the UK, no matter where your website is based.
Improves data accuracy and personalization: With Consent Mode, Google can better track conversions and personalize without breaking privacy rules.
Enables conversion modeling: Consent Mode activates a feature called “Conversion modeling.” This advanced tool allows your website to track more conversions by compensating for the absence of data when cookies are rejected.
Deadline to enable: Advertisers should enable Consent Mode by March 2024 to keep their audience data accurate.
Enabling consent mode is a step towards better GDPR compliance. It allows Google to continue providing valuable insights and personalization options based on user consent. This helps in keeping your analytics and ad performance reports complete and accurate.
Our plugin’s compatibility with Google Consent Mode v2 makes it easier for your website to manage user consents effectively, ensuring you stay compliant with privacy regulations while maintaining access to critical data and features provided by Google.
Step 1 - Go to Ultimate GDPR & CCPA > Cookie Consent > Cookie popup tab.
Step 2 - Find the Google Analytics 4 section. Here, enter your Google Analytics ID (GA4 ID) or Google Tag Manager ID (GTM ID).
Step 3 - Look for the option named Google Consent Mode v2 and switch it to Enabled.
Step 4 - You’re all set! The tracking code (either GA4 or GTM) will now be added to your website’s header, and the user’s choices will be sent to Google through Consent Mode.
Before a user makes a choice, we send Google default consent values to ensure compliance.:
gtag("consent", "default", {
ad_personalization: "denied",
ad_storage: "denied",
ad_user_data: "denied",
analytics_storage: "denied",
functionality_storage: "denied",
personalization_storage: "denied",
security_storage: "granted"
});
To make sure everything is working as it should, you can use these tools:
Google Tag Assistant: A tool to help check if the consent signals are being correctly sent: https://developers.google.com/tag-platform/security/guides/consent-debugging
Chrome Addon ‘Analytics Debugger’: Use this Chrome extension to debug and verify analytics data: https://chromewebstore.google.com/detail/analytics-debugger/ilnpmccnfdjdjjikgkefkcegefikecdc
Note: This section is for those familiar with WordPress development. Changing these settings can affect how the plugin works, so please be careful. You can adjust Consent Mode’s functionality by adding custom code to your theme or a custom plugin.
Changing the GA4 or GTM code that gets added to the page header:
// functions.php
add_filter('ct_ultimate_gdpr_service_ga4_head_snippet', 'custom_modify_head_snippet1', 1, 2);
function custom_modify_head_snippet1($html, $id) {
$new_snippet = "<!-- Custom Snippet Here -->";
return $new_snippet . $html; // Prepend, append, or replace based on needs
}
add_filter('ct_ultimate_gdpr_service_gtm_head_snippet', 'custom_modify_head_snippet2', 1, 2);
function custom_modify_head_snippet2($html, $id) {
$new_snippet = "<!-- Custom Snippet Here -->";
return $new_snippet . $html; // Prepend, append, or replace based on needs
}
Adjusting how user choices are translated into Google consent mode parameters and how data is sent using gtag:
// custom.js
(function ($) {
$(document).off("consentUpdated.ctUltimateGdpr");
$(document).on("consentUpdated.ctUltimateGdpr", function(event, level, level_ids) {
// original logic: \ct-ultimate-gdpr\assets\js\consent-mode.js
// apply your logic here
let consent = {};
console.log(level);
console.log(level_ids);
});
})(jQuery);