Consent Mode v2 – Implementation Issues
-
First and foremost, I would like to thank you for your tremendous effort and continuous updates to the plugin. It’s great that the topic of Consent Mode v2 has been addressed. However, we have noticed a few inconsistencies, namely:
A) Incorrect implementation of gtag(“consent”, “default”) and gtag(“consent”, “update”) – the googleConsentMode() function. As the documentation states, upon the initial page load, gtag(“consent”) was introduced with all “consent” settings (ad_storage, ad_user_data, ad_personalization, analytics_storage) set to “denied”.
After selecting specific data processing consents (Statistics, Experience, Marketing), all (unfortunately, here we encounter another bug, which I’ll address in point B) settings in gtag transition to “granted” through the action
gtag('consent', 'update', { ad_storage: "granted", ad_user_data: "granted", ad_personalization: "granted", analytics_storage: "granted" })
and upon page reload, all the above settings are switched from “update” mode to “default” mode using the setting
gtag('consent', 'default', { ad_storage: "granted", ad_user_data: "granted", ad_personalization: "granted", analytics_storage: "granted" })
which causes a significant problem in correctly interpreting consent mode v2.
The correct sequence of tasks execution for gtag upon each page reload is as follows:
- Set gtag(“consent”, “default”) to “denied” and set the page load time to capture the saved data processing consents (Statistics, Experience, Marketing)
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" })
- Update gtag(“consent”, “update”) to “granted” for the selected (point B) and saved data processing consents (Statistics, Experience, Marketing)
gtag("consent", "update", { ad_storage: "granted", ad_user_data: "granted", ad_personalization: "granted", analytics_storage: "granted", functionality_storage: "granted", personalization_storage: "granted", security_storage: "granted" })
Following these tasks in this order will result in the correct display of Consent Mode v2 in Google Tag tools. The page will initially receive “denied” for “On-page Default” and then the value will be changed to “granted” for “On-page Update”.
The “update” action is crucial in all of this because Google uses it to understand what the user agrees to and bases its other actions on it in the statistics. Therefore, if someone opts out of granting data processing consents, you cannot rely solely on the “default” settings (which are set to “denied”), but you must perform the next “update” action and once again pass “denied” – so that Google knows that the user did not agree to data processing in the “On-page Update” section. – I refer you to the documentation: https://developers.google.com/tag-platform/security/guides/consent?hl=pl&consentmode=advanced
You can test this on the website (https://tagassistant.google.com/) and see the correct implementation by testing the domain https://www.cookiebot.com/.
B) Lack of logical conditions for selected data processing consents (Statistics, Experience, Marketing)
Currently, as written in point A), after selecting options:- “Statistics” – the plugin activates gtag(“consent”, “default”, {analytics_storage: “denied”}), when it should be gtag(“consent”, “update”, {analytics_storage: “granted”}) – the update action should be performed every time the page is reloaded (as in point A))
- “Experience” – the plugin does not change gtag(“consent”)
- “Marketing” – the plugin activates gtag(“consent”, “default”, {ad_storage: “granted”, ad_user_data: “granted”,ad_personalization: “granted”}), when it should be gtag(“consent”, “update”, {ad_storage: “granted”, ad_user_data: “granted”,ad_personalization: “granted”}) – the update action should be performed every time the page is reloaded (as in point A))
Finally, I refer you to a great article that perfectly describes everything that needs to be done to correctly implement Consent Mode v2: https://adequate.digital/en/consent-mode-v2-what-you-need-to-know/ – it’s worth familiarizing yourself with it ??
Once again, thank you for your work, and I hope we can implement the above updates ??
- The topic ‘Consent Mode v2 – Implementation Issues’ is closed to new replies.