Extending implied consent on click

Please note that this is no longer being updated. Kindly visit the new Cookiebot support area (https://support.cookiebot.com/hc/en-us) for updated guides, articles and FAQs. If you do not find the answer to your question there, you are welcome to post it in the Cookiebot community (https://support.cookiebot.com/hc/en-us/community/topics).

When using the consent method "Implied consent" with Cookiebot, your website visitor automatically consents to cookies by scrolling the entry page or by clicking a link on your website. All scripts setting cookies will then be triggered on the entry page, enabling e.g. statistics from the entry page in Google Analytics.

As default only links created with an <a>-tag will trigger an implied consent. Some websites also enables navigation on other tags by attaching an onclick event handler. To enable implied consent on these type of elements as well, attach the following event handler to your clickable elements, in this example all elements holding the class "menutile", using JQuery:

$(document).on("click", ".menutile", function(){
    if (Cookiebot && CookiebotDialog && !Cookiebot.hasResponse && CookiebotDialog.consentLevel=='implied')
    {
        CookiebotDialog.submitConsent(true, document.location.href);
    }
});


Feedback and Knowledge Base