Add callback hook (opt out cookies)

Hey there, I’d like to add this callback hook so my visitors can opt out of cookies.

onInitialise: function (status) {
 var type = this.options.type;
 var didConsent = this.hasConsented();
 if (type == 'opt-in' && didConsent) {
// enable cookies
 }
if (type == 'opt-out' && !didConsent) {
   // disable cookies
 }
},

and so on

where should I do this?

zerotoone.de

Thanks for your help!

Hi,

The theme doesn’t set cookies, so there are no cookies that users can opt-in/out from that are related to the theme. You can follow the simple guide of this script installation and customization published here.

To add this script on your website I recommend following this guide:

Thanks.

sorry there was a misunderstanding, I added a cookie. However I got the callback hook too, so it can be deactivated. Now I just need to know where to put this code

Hi there,

Your code is incomplete, the onInitialise is javascript attached to an element or object. You have to replace this line <!-- YOUR COOKIE CONSENT CODE HERE --> with your code, but it’s not gonna work since it’s incomplete. I suggest consulting to the provider of your code to have a complete implementation. This isn’t theme specific since it utilizes javascript as embed code.

Thanks!

Sorry the full code can be found here https://cookieconsent.insites.com/documentation/disabling-cookies/

Hello @zerotoone.de,

Thanks for updating the thread. :slight_smile:

Please copy the code from previous thread that my colleague @Alaa has shared and just replace replace with <!-- YOUR COOKIE CONSENT CODE HERE --> with the code that you can get from the link you have shared.

Thanks.

Thank you, how do I know if the opt out function works?

Hello There,

it will only work if you have fully installed the script. For more details, please review the 3rd party documentation here: https://cookieconsent.insites.com/documentation/javascript-api/

If you need further assistance please contact the creators of this 3rd party script as they are more familiar with the coding and they should be able to resolve any issues in no time.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.