Adding cookie law consent to web pages

The Cookie law is in effect in some European countries, which requires websites to ask visitors for consent to use cookies. You can find more information at Kentico provides functionality that helps you comply with the law.

A site’s default cookie level determines which cookies the system stores in users’ browsers by default. To set the default cookie level:

  1. Open Settings application and select the System category.
  2. Under the Cookies heading, select a Default cookie level.
    • The available cookie level values are System,Essential,Editor,Visitor,All as described on the Cookie levels page. The None cookie level cannot be set as a default level because the system cookies are required for critical functionality (such as storing the allowed cookie level).
  3. Click Save.

The system now uses the selected cookie level when evaluating which cookies are stored in users’ browsers (until they make another choice using a cookie law web part).

  1. Open the Pages application.
  2. Select the page where you want to display the consent message.
  3. Switch to the Design tab.
  4. Add the Cookie law and tracking consent or Simple cookie law consent web part onto the page.

Kentico cookies are separated into several cookie levels according to their importance in the system. There are three main levels designed to comply with the law regulations.

To display a text message and buttons asking visitors for consent to store cookies in their browsers, use one of the following web parts:

  • Cookie law and tracking consent
  • Simple cookie law consent

Both web parts are implemented by the ~/CMSWebParts/General/CookieLaw.ascx control. The “simple” variant is a preconfigured version of the Cookie law and tracking consent web part, set up only for the cookie law consent. By default, the web parts are not styled, so you need to update your site’s CSS stylesheet to get the required look and feel.

This web part offers three cookie levels to choose from:

  • No cookies
  • Only essential cookies
  • All cookies

On each level, actions to switch to the remaining levels are offered. You may customize the text messages, available actions as well as button texts.

The Default cookie level setting, which can be set in the Settings application under the System category, determines the cookie level that visitors have before making a choice via the web part.

All cookies level required for On-line marketing features to work correctly in Kentico EMS

The On-line marketing features of the Kentico EMS edition only work fully for visitors who have their cookie level set to All cookies. For example, the system does not create contacts for visitors whose allowed cookie level is only System or Essential.

You can either set the Default cookie level setting to Visitor or All, or allow individual visitors to give tracking consent and increase their cookie level. For more information, see Working with consents.

The Compare current cookie level to property is a basis for other settings in the web part. It defines a level to which the user’s current cookie level is compared. Three states with their own settings are defined depending on the selected level:

  • When the current level is below the compared level (Below level behavior settings).
  • When the current level exactly matches the compared level (Exact level behavior settings).
  • When the current level is above the compared level (Above level behavior settings).

This should give you enough options to configure the web part.

In addition to managing cookie law consents, this web part also allows you to manage consents for tracking of personal data of users. For information about tracking consents, see the Working with consents page.

Kentico EMS required

To utilize all features of the Cookie law and tracking consentweb part, namely managing tracking consents, you need the Kentico EMS license edition.

This is a preconfigured version of the previous web part. The preset behavior is: Disable cookies by default, request allowing, and once allowed, hide the web part. To make sure the web part behaves according to the preset behavior, you need to set the Default cookie level setting in the Settings -> System category to System.

Message visibility for administrators

All users who access the Kentico administration interface automatically have all cookies enabled and stored in their browser. As a result, you might not see the cookie law web part message if you view the live site after adding the web part.

To check whether your configuration of the cookie web part is correct, open the website in a different browser or computer, or use a separate anonymous/private/incognito window of your current browser.