---
title: Adding cookie law consent to web pages
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

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 [http://www.ico.gov.uk/](http://ico.org.uk/for_organisations/privacy_and_electronic_communications/the_guide/cookies). Kentico provides functionality that helps you comply with the law.

## Setting the default cookie level

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](https://docs.kentico.com/k11/configuring-kentico/adding-cookie-law-consent-to-web-pages/cookie-levels.md) 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).

## Including cookie consent on your website

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](https://docs.kentico.com/k11/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md) the **Cookie law and tracking consent** or **Simple cookie law consent** web part onto the page.

Kentico cookies are separated into several [cookie levels](https://docs.kentico.com/k11/configuring-kentico/adding-cookie-law-consent-to-web-pages/cookie-levels.md) according to their importance in the system. There are three main levels designed to comply with the law regulations.

## Available cookie consent web parts

To display a text message and buttons asking visitors for consent to store cookies in their browsers, use one of the following [web parts](https://docs.kentico.com/k11/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md):

- **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](https://docs.kentico.com/k11/developing-websites/designing-websites-using-css.md) to get the required look and feel.

### Cookie law and tracking consent

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.

> **Note:** **_All cookies_ level required for On-line marketing features to work correctly in Kentico EMS**
>
> The [On-line marketing features](https://docs.kentico.com/k11/on-line-marketing-features.md) 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](https://docs.kentico.com/k11/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/working-with-contacts.md) 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](https://docs.kentico.com/k11/configuring-kentico/gdpr-compliance/working-with-consents.md).

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](https://docs.kentico.com/k11/configuring-kentico/gdpr-compliance/working-with-consents.md) page.

> **Info:** **Kentico EMS required**
>
> To utilize all features of the **Cookie law and tracking consent**web part, namely managing tracking consents, you need the **Kentico EMS** license edition.

### Simple cookie law consent

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_.

> **Info:** **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.
