Custom dialog: Enabling a cookie type by default
We have created a custom Cookiebot dialog using the documentation and we are very happy with how it looks. However, we are unable to make a cookie type enabled by default. We have added the "checked" attribute to the checkbox input, but it's still not checked when the dialog is loaded.
We have found a workaround. You can select another template, check the checkbox(es) of the cookietype(s) you want to enable by default, then select your custom template again and save.
Is there a better way to accomplish this?
I previously submitted a support request, but the answer was useless.
-
Hi G.Frenken,
You could simply select which cookie categories to be checked by default from the 'Dialog' tab in the account manager, but this feature is available only for predefined Cookiebot dialog types.
However, in case that you are using custom banner then you must specify which cookie category to be selected/pre-checked by default from the template source code. You can achieve this by adding an ID and "checked" attribute on the checkbox input field, for example:<input type="checkbox" id="CybotCookiebotDialogBodyLevelButtonPreferences" class="CybotCookiebotDialogBodyLevelButton" checked="checked">
Please try using checked="checked" instead of just 'checked' attribute on the checkbox input field.
Regards,
Spas0 -
Hey,
I am having exactly the same problem, but adding checked="checked" doesn't help.
Got any ideas on that?
0
Please sign in to leave a comment.
Comments
2 comments