• Resolved pramakrishna

    (@pramakrishna)


    Hi,
    I am trying to add this code
    <script type=”text/javascript”>

    window.addEventListener(‘CookiebotOnAccept’, function (e) {
    if (Cookiebot.consent.marketing)
    {
    //Execute code that sets marketing cookies
    }
    }, false);

    </script>
    inside my code to customize the plugin and I am getting error saying “Cookiebot” is not defined and not able to go further. Please suggest me how to add the code inside our javascript file

    The page I need help with: [log in to see the link]

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author cookiebot

    (@cookiebot)

    @pramakrishna

    Glad you got your problems fixed.

    Suppose I have 2 button as options for the user to Opt-in and Opt-out for Statistics cookies:

    Opt-in Cookiebot.submitCustomConsent(true,true,false)
    Opt-out Cookiebot.submitCustomConsent(true,false,false)

    You should use:

    Opt-in Cookiebot.submitCustomConsent(Cookiebot.consent.preferences,true,Cookiebot.consent.marketing)
    Opt-out Cookiebot.submitCustomConsent(Cookiebot.consent.preferences,false,Cookiebot.consent.marketing)

    This way you keep the original consent state for preferences and marketing, and only change statistics. Same approach applies for your marketing opt-in and opt-out buttons.

    Furthermore, if you want to check whether or not the changes have taken effect, you can call: Cookiebot.renew(); which will popup the banner with the current state.

    Let us know if you need further assistance.

    Thread Starter pramakrishna

    (@pramakrishna)

    Hi,

    Thanks. It worked fine.

    Plugin Author cookiebot

    (@cookiebot)

    Glad to hear you got it working @pramakrishna!
    Dont forget to review 🙂
    Regards

    • This reply was modified 7 years, 6 months ago by cookiebot.
Viewing 3 replies - 16 through 18 (of 18 total)

The topic ‘Adding script inside your code to customize the plugin as per development page’ is closed to new replies.