Hiding or showing content based on consent

Cookiebot can automatically hide or show content based on the given consent by the website visitor. The visibility of elements is defined by a series of CSS-class names which you can use by each element:

.cookieconsent-optinVisible when the visitor has given consent for 1 or more categories, otherwise hidden.
.cookieconsent-optoutVisible when a visitor has not yet given consent or consent is given for necessary cookies, otherwise hidden.
  
.cookieconsent-optout-preferencesVisible when a visitor has given consent for “preferences”, otherwise hidden.
.cookieconsent-optout-statisticsVisible when a visitor has not given consent for “statistics”, otherwise hidden.
.cookieconsent-optout-marketingVisible when a visitor has not given consent for “marketing”, otherwise hidden.
  
.cookieconsent-optin-preferencesVisible when a visitor has given consent for “preferences”, otherwise hidden.
.cookieconsent-optin-statisticsVisible when a visitor has given consent for “statistics”, otherwise hidden.
.cookieconsent-optin-marketingVisible when a visitor has given consent for “marketing”, otherwise hidden.

Example:

<div class="cookieconsent-optin-marketing">
This content is only visible if the visitor has given consent for marketing cookies.
</div>

<div class="cookieconsent-optout-marketing">To view this content, you should<a href="javascript: CookieConsent.renew()">accept marketing cookies.</a>.
</div>

30 day free trial Cookiebot

Cookie scanner, cookie banner, cookie declaration en cookie consent in one solution.

  • Use cookies on your website compliant with GDPR, ePrivacy and cookie legislation
  • Cookie management completely automated
  • Cookie banner based on your corporate identity
  • Automatic composed cookie declaration, always up to date

The Cookiebot solution runs on 500,000+ websites, manages 13 billion User Consents and supports 40+ languages.