Klaro Cookie Consent: Configuration
Settings of Klaro Cookie Consent for OXID eShop 7: module settings with defaults, creating cookie services, cookie deletion rules and practical examples.
Klaro Cookie Consent: Configuration
Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net
The configuration has two parts: the module settings and the cookie services.
Module settings
You find them in the admin under Extensions > Modules > Klaro Cookie Consent Manager > Settings. The settings apply per shop.
General Settings
| Setting | Default | Description |
|---|---|---|
| Activate Cookie Consent | On | Turns the banner, the dialog and the loading of the Klaro scripts in the storefront on or off |
| Privacy Policy URL | /datenschutz |
Link to your privacy policy, linked in the consent dialog |
Consent Behavior
| Setting | Default | Description |
|---|---|---|
| Must Consent (Modal blocking) | On | Visitors have to decide in the dialog before they can use the page |
| Show "Accept All" button | On | Shows a button that accepts all services at once |
| Hide "Decline All" button | Off | Hides the "Decline All" button. Visitors can still decline individual services |
| Hide "Learn More" links | Off | Hides the "Learn more" links |
| Group services by purpose | On | Groups the services in the dialog by purpose (Analytics, Marketing and so on) |
Storage Settings
| Setting | Default | Description |
|---|---|---|
| Storage Method | Cookie (recommended) | Where the visitor's decision is kept: Cookie or Local Storage |
| Storage Name | klaro |
Name of the cookie or localStorage key. Letters, digits, - and _ are allowed, all other characters are removed |
| Cookie expires after (days) | 365 |
Valid are whole numbers from 1 to 730. Larger or smaller values are clamped to these limits, input containing non-digits falls back to 365 |
Google Consent Mode v2
| Setting | Default | Description |
|---|---|---|
| Enable Google Consent Mode v2 | Off | Sets the default values "denied" before Klaro. For the behavior see Storefront |
Styling
| Setting | Default | Description |
|---|---|---|
| Banner Position | Bottom (full width) | Bottom (full width), Top (full width), Bottom Left, Bottom Right. Applies only to banner mode, with "Must Consent" enabled a centered dialog is shown instead |
| Color Theme | Light | Light or Dark |
The admin also shows the fields "Accept All Button Color" (
#1a73e8), "Save Selection Button Color" (#2581c4) and "Decline All Button Color" (#5c5c5c). They currently have no effect in the storefront, because the bundled stylesheet does not use the CSS variables they set. You can ignore them.
Managing cookie services
You manage the services under Customer Info > Cookie Consent. The list shows the services of the current shop with the columns Active, Technical Name, Title, Purpose, Required and Sort order. Use "Add new service" to create one.
The "Title" column of the list shows the technical name, not the saved title. You see the title in the edit view.
Each service stands for a third-party service or script that needs consent. Creating a service does not add a script to the shop. Which scripts a service controls is defined in your template, see Storefront.
Service fields
| Field | Default | Description |
|---|---|---|
| Technical Name | empty | Required, at most 64 characters, unique per shop. This name links the service to the scripts in your template (data-name) |
| Purpose | Analytics | Functional, Analytics, Marketing or Security. Determines the group in the dialog |
| Sort order | 0 |
Smaller values appear higher up |
| Active | On | Only active services appear in the dialog |
| Required | Off | The visitor cannot switch the service off. Required services cannot be deleted in the list |
| Default enabled | Off | The service is preselected in the dialog. This is not the GDPR recommendation |
| Load only once | On | The service's script is executed only once per page view |
| Contextual consent only | Off | The service is not activated by "Accept All", only through the placeholder on the embed |
| Title | Technical name | Display name, per language |
| Description | empty | Explanation for visitors, per language |
| Cookies | empty | Cookies that are deleted on withdrawal, see below |
You maintain title and description per language: pick the language in the admin and save the service once per language. The storefront has texts for German (language ID 0) and English (language ID 1). If the title is missing in a language, the module uses the German title, then the technical name.
Saving with an empty technical name does nothing: no error message appears and nothing is saved.
Cookie deletion rules
When a visitor withdraws consent, Klaro deletes the cookies you entered. You can enter them in one of two notations.
One line per cookie in the format name,path,domain, path and domain are optional:
_ga
_gid
_pk_id,/,.example.com
As a JSON list:
[
{"pattern": "_ga", "path": "/", "domain": ".example.com"},
{"pattern": "_gid"}
]
| Field | Required | Description |
|---|---|---|
pattern |
Yes | Cookie name or regular expression |
path |
No | Cookie path, / if omitted |
domain |
No | Cookie domain, the current domain if omitted |
This is how pattern is evaluated:
- A value that does not start with
^is an exact cookie name. - A value that starts with
^is a regular expression, for example^_ga_.*$. - Wildcards such as
_ga_*do not work, they are read as part of the name.
An entry that starts with [ but is not valid JSON is read line by line as a cookie list. Check the JSON before you save.
Practical examples
Google Analytics 4
| Field | Value |
|---|---|
| Technical Name | google-analytics |
| Purpose | Analytics |
| Title | Google Analytics |
| Description | Web analytics service that helps us understand how visitors use our shop. |
| Cookies | see below |
[
{"pattern": "_ga", "path": "/", "domain": ".your-shop.com"},
{"pattern": "^_ga_.*$", "path": "/", "domain": ".your-shop.com"},
{"pattern": "_gid", "path": "/", "domain": ".your-shop.com"}
]
You mark the Google script itself in your template with data-name="google-analytics".
YouTube embed with placeholder
| Field | Value |
|---|---|
| Technical Name | youtube |
| Purpose | Marketing |
| Title | YouTube |
| Description | Embedded videos from YouTube. YouTube may set cookies and collect data when you play a video. |
| Contextual consent only | On |
You mark the iframe with data-name="youtube" and data-src, see Storefront.