Kentico EMS required
Features described on this page require the Kentico EMS license.
In Kentico, consents are records used to inform website visitors about the means of collecting and manipulating their personal data. This page describes how to display created consents on websites, enable visitors to give consent agreements, and serve content based on received consents.
When creating a consent for the tracking of contacts and activities, you also need to provide a way for visitors to adjust their allowed cookie level. The system only performs the tracking for visitors whose cookie level is Visitor or higher (i.e., All cookies in the configuration of cookie law web parts).
Prerequisites
On-line marketing must be enabled to allow contact creation:
To ensure that visitors are not tracked until they give the tracking consent, you need to set the default cookie level for your website:
Open the Settings application.
Navigate to the System category in the settings tree.
Set the value of the Default cookie level setting to System or Essential.
With the System cookie level, basic functionality such as authentication and language selection will not work for visitors by default.
If possible, we recommend setting the level to Essential (or higher if you are not legally required to obtain tracking consent). However, you may need to verify that the Essential cookies are compliant with any applicable legal requirements and regulations.
Click Save.
To allow visitors to give or revoke agreements with the tracking consent:
Now when a visitor arrives on your website, the system does not track them as a contact until they give their consent via the Cookie law and tracking consent web part. For visitors whose cookie level is lower than Visitor (i.e. No cookies or Only essential cookies in the web part configuration), the web part additionally displays the Short text of the selected tracking consent.
When a visitor changes their allowed cookie level, the web part automatically manages agreements for the assigned tracking consent:
The following is a sample configuration of the Cookie law and tracking consent web part. You can modify the properties and use this as a basis for your own setup.
Levels category:
Below level behavior category:
Exact level behavior category:
Above level behavior category:
Consent buttons category:
On-line marketing category:
Testing cookie law web parts
Cookies are used for both the live site and the Kentico administration interface. When a user signs in to the administration interface, the system automatically allows all cookies in the user's browser. This may prevent users from interacting with cookie web parts on the live site. On the other hand, adjusting the cookie level via a cookie web part on the live site may interfere with the administration interface.
To avoid such issues, we recommend testing any changes of cookie level settings and the related web parts in a different browser or computer, or using a separate anonymous/private/incognito window of your current browser.
To collect consent agreements regarding the processing of personal data submitted by visitors through on-line forms, utilize the Consent agreement form control.
The consent field in the resulting form displays a check box, followed by the Short text of the given consent. When a visitor selects the consent checkbox and submits the form, the system automatically creates a corresponding consent agreement for the given contact.
Note: The system does not support consent fields that are required. If you enable the Required property for consent fields, the validation will always fail (the system sets the field's value only after the form is submitted).
To collect consent agreements from visitors who subscribe to newsletters, utilize the Custom subscription form web part and an alternative form with a field using the Consent agreement form control.
To ensure that consent agreements are recorded correctly for each subscriber, make sure that the Newsletter - Subscriber class is configured to map the subscription form's Email address field to the email address contact attribute.
Make sure that pages containing your newsletter subscription form use the Custom subscription form web part with the correct alternative form.
Open the Pages application and select the appropriate page.
Switch to the Design tab and place the Custom subscription form web part.
Select the correct Alternative form.
To allow signed in users to give consent agreements, you need to disable the One-click subscription for signed in users property of the Custom subscription form web part.
Click Save & Close.
The consent field in the resulting form displays a check box, followed by the Short text of the given consent. When a visitor selects the consent checkbox and submits the subscription form, the system automatically creates a corresponding consent agreement for the given contact.
To collect consent agreements from visitors who register as new users, utilize the Custom registration form web part and an alternative form with a field using the Consent agreement form control.
To ensure that the consent agreements are recorded correctly for each visitor, make sure that:
Make sure that your site's registration page contains the Custom registration form web part with the correct alternative form. For more information about custom registration forms in general, see Using the Custom registration form web part.
Open the Pages application and select your registration page.
Switch to the Design tab and place the Custom registration form web part.
Click Save & Close.
The consent field in the resulting form displays a check box, followed by the Short text of the given consent. When a visitor fills in the registration form and selects the consent checkbox, the system automatically creates a corresponding consent agreement for the given contact.
To display the short and full text of consents on the live site, for example on your website's privacy policy page, first get the consent object using the GlobalObjects.Consents.<ConsentCodeName> macro (use the indexer macro format GlobalObjects.Consents["<ConsentCodeName>"] if the code name contains any special characters, like a hyphen). Then call the consent object's GetConsentText() macro method, which returns a ConsentText object providing consent text values in its ShortText and FullText properties.
By default, the GetConsentText() macro method returns consent texts in the culture selected by the current visitor. To get a specific culture version of the consent text, add the cultureCode parameter: GetConsentText(string cultureCode)
Open the Pages application.
Navigate to a page where you want to add the consent text.
Add a Static text web part to the page.
In the web part's configuration, enter HTML content with the required macros into the Text property (under the Content category).
<h3>{% GlobalObjects.Consents["DancingGoatMachineRentalForm"].ConsentDisplayName %}</h3>
<p>{% GlobalObjects.Consents["DancingGoatMachineRentalForm"].GetConsentText().ShortText %}</p>
<p>{% GlobalObjects.Consents["DancingGoatMachineRentalForm"].GetConsentText().FullText %}</p>Click Save & Close.
Kentico does not provide any ready-to-use components for revoking consent agreements. Each website has its own personal data processing requirements and its own unique set of consents, so your developers need to create custom components for this purpose.
See Revoking consent agreements for details.
You can use the AgreedWithConsent macro method and the Contact has agreed with consent macro rule to check if a contact has given an agreement with a specified consent. You can use them in the following ways:
The AgreedWithConsent macro method resolves to false even if called for a contact object that does not exist. This is important, because if a visitor does not accept the tracking consent, the system does not create a contact associated with this visitor (i.e. OnlineMarketingContext.CurrentContact is null).
On the live site, you can use the macro to build conditional content based on the current contact's consents. For example, to display different text to visitors who have given an agreement with a consent:
Add a Static text web part to a page.
Enter the following code into the Text property under the Content category.
{% if (OnlineMarketingContext.CurrentContact.AgreedWithConsent("ConsentCodeName")) {"Thank you for accepting the consent."} else {"Please accept the consent."} %}On the live site, you can use the macro to adjust the properties of web parts. For example, to show a web part only to those visitors who have given an agreement with a consent:
Modify an existing web part.
Expand the Visibility category. Click the Edit value icon () next to the Visible check box to enter a macro condition.
Enter the following code into the editor:
{% OnlineMarketingContext.CurrentContact.AgreedWithConsent("ConsentCodeName") %}In on-line marketing modules such as personas, contact scoring, marketing automation and contact groups you can use the macro rule to create rules and segment visitors. For example, to create a contact group which contains users who have given an agreement with a consent: