canonical / canonical.com

Repository for the new version of canonical.com
Other
33 stars 66 forks source link

Update cookie policy to v3.6.3 #1236

Closed samhotep closed 5 months ago

samhotep commented 5 months ago

Done

QA

webteam-app commented 5 months ago

Demo

Jenkins

demos.haus

laszlokajtar commented 5 months ago

hey @samhotep, i did a quick test and the results are much better, however, GTM still seems to load earlier than the default consent:

image image

lorumic commented 5 months ago
  • After accepting cookies,

    • There should be a {"consent", "update"} object in the dataLayer

Is the object with "consent", "default" in it supposed to go away after accepting the cookies? It currently stays there, alongside the one with "consent", "update".

samhotep commented 5 months ago
  • After accepting cookies,

    • There should be a {"consent", "update"} object in the dataLayer

Is the object with "consent", "default" in it supposed to go away after accepting the cookies? It currently stays there, alongside the one with "consent", "update".

Yeah it stays there by default

laszlokajtar commented 5 months ago

@samhotep another issue is that the update seems to somehow work in reverse way, in another test, i only allowed essential cookies, which resulted in this update push:

{"ad_storage":"granted","ad_user_data":"granted","ad_personalization":"granted","analytics_storage":"granted","functionality_storage":"denied","personalization_storage":"denied","security_storage":"granted"}

samhotep commented 5 months ago

@samhotep another issue is that the update seems to somehow work in reverse way, in another test, i only allowed essential cookies, which resulted in this update push:

{"ad_storage":"granted","ad_user_data":"granted","ad_personalization":"granted","analytics_storage":"granted","functionality_storage":"denied","personalization_storage":"denied","security_storage":"granted"}

This happens because the default object has all values denied, so any selection, even essential will cause some update since some values will be updated to true

I basically just followed the existing cookie logic, which starts with no cookies, and sets the essential cookies only after the user has dismissed the notification

laszlokajtar commented 5 months ago

@samhotep another issue is that the update seems to somehow work in reverse way, in another test, i only allowed essential cookies, which resulted in this update push: {"ad_storage":"granted","ad_user_data":"granted","ad_personalization":"granted","analytics_storage":"granted","functionality_storage":"denied","personalization_storage":"denied","security_storage":"granted"}

This happens because the default object has all values denied, so any selection, even essential will cause some update since some values will be updated to true

my bad, wrong selection choice, sorry please discard!

laszlokajtar commented 5 months ago

@samhotep on this demo, GTM still loads first for me

laszlokajtar commented 5 months ago

@samhotep on this demo, GTM still loads first for me

is it possible that

cpNs.cookiePolicy();

doesn't push the required values into the dataLayer before GTM is loaded?

samhotep commented 5 months ago

@samhotep on this demo, GTM still loads first for me

is it possible that

cpNs.cookiePolicy();

doesn't push the required values into the dataLayer before GTM is loaded?

You're right, I've made the changes in the cookie policy, thanks! I'll update the version as soon as it's released and we can QA again