We've discovered that in some situations thepreviousCategories field within the cookie banner's consent object has incorrect values.The Cookie Banner API provides consent listeners so that developers can properly handle cookies based on the user's consent, represented by the consent object. ThepreviousCategoriesfield was intended to store the previous state of the user's consent preferences. This was used so that if a user submitted preferences to the cookie banner, but later re-opened the cookie banner within the same page visit and changed preferences, then a developer could properly handle the differences.
{
allowed: true or false,
categories: {
necessary: true,
analytics: true or false,
advertisement: true or false,
functionality: true or false,
},
previousCategories: {
necessary: true,
analytics: true or false, # defaults to false
advertisement: true or false, # defaults to false
functionality: true or false, # defaults to false
},
}
After further investigation, we've determined there is no way to properly support this field. To prevent confusion and simplify the experience, we will be deprecating the field onMonday, April 3rd.
OnMonday, April 3rd we'll be releasing an update topreviousCategories which will always imply consent has changed. This should ensure that event listeners will always react the same way to negative consent, fix issues wherepreviousCategories contained incorrect values.
For the majority of sites, we expect no issues and it is more likely that this will actually fix bugs in consent listeners ensuring the user's change in consent is properly respected.
If you've written custom code for handling this change in users consent, you may want to review it just to ensure that if a change from the previous state is always implied - your code will continue to operate how you expect. As noted previously, in most situations, this should fix issues rather than create new ones.
No one has replied to this post quite yet. Check back soon to see if someone has a solution, or submit your own reply if you know how to help! Karma is real.