Skip to content

Cookie banner and switch

The cookie banner, if configured, displays freely configurable text with legal information on every page for website visitors who are visiting a website for the first time. The banner offers visitors the option to reject tracking cookies.

There is also a cookie switch that allows website visitors to change their cookie settings later.

In order to be able to use these settings optimally, advanced technical understanding and knowledge of HTML and CSS are helpful.

Erstellen eines Inhalts vom Typ 'Konfiguration für Datenschutz-Bestimmungen'

To activate the cookie banner for a website, you must first create a content item of the type “Configuration for data protection regulations” in the Explorer view. This file contains all settings for the banner, in particular the texts to be displayed.

To do this, switch to Explorer view and open the “Create Resource” dialog box using the magic wand icon in the toolbar. Then switch the view in the selection at the top left to “Other Types.” There you will find the content “Configuration for data protection regulations.”

In this documentation website, you will find the settings for the cookie banner in the file under /.content/privacy-policy.xml. The various setting options for the cookie banner are described in the help texts there.

Once you have created the configuration, you must link it to your website. To do this, set the file property mercury.privacy.policy in the start folder of your site and enter the path to the configuration file, e.g. /.content/privacy-policy.xml.

The cookie banner is always disabled in the page editor. To test your configuration, you can switch to preview mode. The cookie banner will then be displayed, provided you have not already accepted cookies.

The cookie banner allows you to consent to cookies in 3 groups (see below).

As long as you do not configure the cookie banner for a website as described above, all cookies are automatically enabled.

The privacy policy explains in detail which elements are controlled by cookies.

The following groups of cookies can be controlled via the cookie banner (de) and the privacy policy cookie switch function:

Necessary

These cookies are essential for the operation of the site and store, for example, the selection of which cookies may be used. 

External content

Content from video platforms, social media platforms, or map providers is blocked by default. If cookies from external media are accepted, access to this content no longer requires manual consent.

Statistics

In order to further improve our offering and our website, we collect anonymized data for statistics and analysis. With the help of these cookies, we can, for example, determine the number of visitors and the effect of certain pages of our website and optimize our content.
Note: This group is only displayed if an analytics service (de) is actually configured for the pages.

The cookie banner may not be displayed on certain pages. This is particularly advisable on pages that contain, for example, the imprint, information on privacy policy, or other legal notices. For legal reasons, these pages must always be readable, even if no cookies have been accepted yet. However, it is possible that the cookie banner may almost completely cover the content of the pages in the mobile view. Therefore, the cookie banner can be deactivated for these pages.

To disable the cookie banner, you must set the file property mercury.privacy.policy.nobanner to true in OpenCms Explorer. This can be done directly on a page or on a folder.

The cookie banner has a “Close” (‘X’) button in the top right corner. This allows the banner to be closed without accepting any cookies, including “necessary” cookies. As a result, the banner will be displayed again the next time a page is loaded.

The text of the cookie banner may also contain links to detailed function pages (de). You can specify these as described here. The following link (de) targets are supported in the text of the cookie banner:

  • opencms://function@Imprint
  • opencms://function@Datenschutz
  • opencms://function@Rechtliche Hinweise

After a user has saved their cookie settings, they can change them later using the “Privacy Cookie Switch” function element. This element can be placed on the privacy page, for example.

The cookie switch looks like this:

The Matomo analytics service is able to track visits to the website without cookies simply by executing JavaScript. This option must be activated separately; for details, see the description of Matomo integration (de).

If Matomo tracking via JavaScript is active, this is displayed in the “Privacy Cookie Switch” function. The user then has the option to actively object to tracking via JavaScript (“opt-out”). To do this, the user must click a checkbox. In this case, a cookie is stored indicating that the user does not want to be tracked with JavaScript.

The opt-out option described here is only displayed if tracking via JavaScript is configured and the user has rejected statistics cookies.

Matomo also offers the option of evaluating the browser's “Do Not Track” header and refraining from tracking page views in this case. This must be set on the Matomo server. If this is set, the matomo.jst property in OpenCms must be set to the value true: dnt. In the “Privacy Cookie Switch” function, a message is then shown to the user that their page views are not being tracked.

To comply with GDPR regulations, every website should offer a simple way for users to change their cookie settings at any time. After a user has accepted a website's cookie banner, a “cookie icon” with a link to the privacy policy can be displayed permanently as an option. This allows users to adjust their cookie preferences at any time.

Konfiguration Link zu Cookie Einstellungen

To activate and configure the cookie icon, you must open the “Configuration for data protection regulations” file. To do this, edit the file in the form editor.

Activate the “Show link to cookie settings” option there. Optionally, you can manually set the stored link in the “Link cookie settings” field. If this field is not filled in, the link set in the “Link to privacy policy” field will be used. If both fields are not filled in, the cookie icon will not be displayed.

Please note that the cookie icon is only displayed online or in preview mode. It will also only be displayed once the user has confirmed the privacy settings in the cookie banner.

The cookie icon is disabled in the page editor. However, by clicking on the OpenCms icon (“target”) in the editor toolbar at the top left, you can temporarily switch to preview mode and check the function of the cookie icon.

Please note that the cookie switch only works online or in preview mode.

The cookie switch is disabled in the page editor. By clicking on the OpenCms icon (“target”) in the editor toolbar at the top left, you can temporarily switch to online preview mode and check the functionality of the cookie switch.

The cookie banner sets cookies in the “Necessary” group or in all groups.

The cookie banner does NOT use JavaScript from external servers.

If configured for a website, the cookie banner is automatically integrated into all pages and is executed when each page is loaded.

The cookie banner is displayed until the web user has selected an option. As long as nothing has been selected, no cookie is set and cookies are automatically considered rejected. 

When the web user clicks on one of the buttons displayed, a cookie called privacy-options is stored. This cookie stores the options selected by the user.

The cookie banner is displayed until the privacy-options cookie has been set.

If the privacy-options cookie is NOT set, cookies are considered rejected.