Klaro Cookie Consent: Configuration
Configuring Klaro Cookie Consent for Sylius 2 - channel settings, service catalog, admin grids and practical examples for Google Consent Mode v2.
Klaro Cookie Consent: Configuration
This documentation always describes the latest published version.
You find all settings in the admin under MMKreativ Plugins > Klaro settings.
Every setting applies per channel, not globally. A channel with no row of its own shows no banner.
Channel configuration
| Setting | Default | Description |
|---|---|---|
enabled |
false |
Turns the banner for this channel on or off |
privacyPolicyPath |
empty | Route name, path or full URL to the privacy policy; {_locale} is replaced with the current locale code |
noticeExemptPages |
empty | Pages (one per line, same forms as the privacy policy) on which no blocking dialog appears, maximum 20 lines |
showFooterLink |
true |
Shows the "Cookie settings" link in the footer |
mustConsent |
true |
Visitor must actively decide before services load |
acceptAll |
true |
Shows the "Accept all" button |
hideDeclineAll |
false |
Hides the "Decline all" button |
hideLearnMore |
false |
Hides the "Learn more" link |
groupByPurpose |
true |
Groups services in the dialog by purpose |
storageMethod |
cookie |
Where the decision is stored: cookie or localStorage |
storageName |
klaro |
Name of the cookie/storage key, letters, digits, _ and - only |
cookieExpiresAfterDays |
365 |
Validity of the stored decision in days, 1 to 3650 |
googleConsentMode |
false |
Enables the Google Consent Mode v2 bridge |
googleConsentModeWaitForUpdate |
true |
Delays Google tags by 500 ms until the first consent decision is available |
primaryColor |
#1a73e8 |
Accent color (hex) |
secondaryColor |
#2581c4 |
Second accent color (hex) |
declineColor |
#5c5c5c |
Color of the "Decline" button (hex) |
bannerPosition |
bottom |
bottom, top, bottom-left or bottom-right |
theme |
light |
light or dark |
Service catalog
The Consent services button on the same page leads to the catalog of third-party services. Per service:
| Field | Default | Description |
|---|---|---|
code |
- | Unique code, lowercase letters, digits, _ and - only; the code technically-necessary is reserved and cannot be assigned |
purpose |
functional |
functional, analytics, marketing, security or other |
required |
false |
Service cannot be opted out of |
defaultEnabled |
false |
Service is pre-selected before any decision |
enabled |
true |
Whether the service appears in the dialog at all |
cookies |
empty | Cookies to delete on opt-out, see below |
onlyOnce |
true |
Consent is asked only once, not again on every load |
contextualConsentOnly |
false |
Service does not appear in the main dialog, only contextually (e.g. in front of an embedded video) |
position |
0 |
Sort order in the dialog and the admin grid |
channels |
all | Which channels the service applies to; left empty it applies to all |
| Title/description | - | Translatable per language |
The built-in Technically necessary entry (cart, checkout, login, security, the stored decision itself) is hardcoded, appears without any catalog row in every enabled channel, cannot be opted out of and does not influence Google Consent Mode.
The cookies field
In the admin form, cookies is a text field, one rule per line:
_ga
_gid:/:.example.com
A plain pattern deletes any matching cookie on the current path/domain. pattern:path:domain (path and domain optional, separated by :) scopes the deletion.
Admin grids
| Grid | Purpose | Columns |
|---|---|---|
| Consent services | CRUD list of third-party services, sorted by position |
Position, code, purpose, title, required, enabled |
| Channel configurations | CRUD list of channel settings | Channel, enabled, must consent, Google Consent Mode |
Practical examples
Google Analytics 4 with Google Consent Mode v2: service ga4, purpose analytics, cookies _ga and _gid one per line, required off, defaultEnabled off. On the channel configuration, enable googleConsentMode and googleConsentModeWaitForUpdate so gtag('consent', 'update', ...) only reacts with analytics_storage after the decision.
Marketing pixel (e.g. Meta Pixel): service meta-pixel, purpose marketing, cookie rule _fbp, required off, defaultEnabled off, onlyOnce on so visitors are not asked again on every page load.
Embedded YouTube video, contextual only: service youtube-embed, purpose functional, contextualConsentOnly on, so the service does not appear in the main dialog but only leads to a consent prompt directly in front of the embedded player.