Hi James,
Indeed we have changed this functionality because it was not GDPR compliant. It is necessary to ask for explicit user consent before placing any cookies as you can read on ICO's pages:
https://ico.org.uk/for-organisations/guide-to-pecr/what-are-pecr/#gdprSo we removed this functionality and added the generic "Accept" buttons, to which the user can click on and turn on all the categories for which you have initialConsentState set to "on". We chose this as a compromise as you are gaining explicit user consent but don't really require your users to read through and toggle all categories on one by one.
If however despite the above you think you can have categories on by default (which again we think is not GDPR compliant), you could achieve that programmatically, by forcibly toggling the categories on via Cookie Control's API. So for instance, if you have a cookie category called "analytics", which you want on by default, you can do the following:
1. Take a note when the user explicitly revokes a category, by putting this on your onRevoke function:
localStorage.setItem("analyticsRevoked", "true");
2. Remove this from your local storage when/if the user consents again. So put this in your onAccept:
localStorage.removeItem("analyticsRevoked");
3. After the widget loads, wait for a couple of seconds for it to finish rendering and then toggle the category on, if the user has taken no action in the past:
setTimeout(
function() {
if (localStorage.getItem("analyticsRevoked") == null && CookieControl.getCookie('analytics') != "accepted") {
CookieControl.toggleCategory(0); // Assuming analytics is your first category in optional Cookies.
}
}, 2000
);
Since you are using the WP plugin, you could put this code either at the end of your theme or in your functions.php as described
here.
I hope this helps. But please note that we don't really advise turning cookie categories on by default.
Kind regards,
Gerasimos