1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187<aside id="consent" class="fixed-bottom row g-0 justify-content-end pe-none mh-100 overflow-auto" role="dialog" aria-modal="false" aria-labelledby="consent-title" aria-describedby="consent-text" data-consent hidden>
<div class="col-12 col-sm-9 col-md-7 col-lg-6 col-xl-5 col-xxl-4 p-3 pe-auto">
<div class="card shadow">
<div class="card-body">
<div class="d-flex align-items-center gap-2 mb-2">
<h2 class="h6 mb-0" id="consent-title" tabindex="-1">Manage consent</h2>
</div>
<p class="small text-body-secondary" id="consent-text">We use cookies and similar technologies. Functional ones keep the site working; the others load only with your consent, which you can change at any time under Cookie settings.</p>
<div class="accordion w-100 accordion-flush" id="consent-categories">
<div class="accordion-item">
<h3 class="accordion-header d-flex align-items-center gap-3">
<button class="accordion-button collapsed" type="button" id="consent-categories-functional-trigger" data-bs-toggle="collapse" data-bs-target="#consent-categories-functional" aria-expanded="false" aria-controls="consent-categories-functional">
<span>Functional</span>
<i class="lucide lucide-chevron-down" data-icon="inline-end" aria-hidden="true"></i>
</button>
<div class="form-check form-switch flex-shrink-0 mb-0">
<input class="form-check-input" type="checkbox" role="switch" id="consent-category-functional" checked disabled aria-labelledby="consent-categories-functional-trigger">
</div>
</h3>
<div id="consent-categories-functional" class="accordion-collapse collapse" aria-labelledby="consent-categories-functional-trigger">
<div class="accordion-body">
<p class="small mb-1">Needed for the site to work: the session, security against forged requests, the chosen language and colour mode.</p>
<div class="border-top pt-2 mt-2">
<p class="fw-medium mb-1">Site session</p>
<dl class="row small mb-0">
<dt class="col-4 fw-normal text-body-secondary">Provider</dt>
<dd class="col-8 mb-1">This website</dd>
<dt class="col-4 fw-normal text-body-secondary">Purpose</dt>
<dd class="col-8 mb-1">Sign-in, form security, language and theme</dd>
<dt class="col-4 fw-normal text-body-secondary">Cookies and storage</dt>
<dd class="col-8 mb-1">
<ul class="list-unstyled mb-0">
<li>
<code>session_id</code> <span class="text-body-secondary">Cookie, 7 days</span>
</li>
<li>
<code>frontend_lang</code> <span class="text-body-secondary">Cookie, Session</span>
</li>
<li>
<code>moo_consent_catalog</code> <span class="text-body-secondary">Cookie, 12 months</span>
</li>
<li>
<code>moo-website:1</code> <span class="text-body-secondary">Local storage, Until removed</span>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h3 class="accordion-header d-flex align-items-center gap-3">
<button class="accordion-button collapsed" type="button" id="consent-categories-statistics-trigger" data-bs-toggle="collapse" data-bs-target="#consent-categories-statistics" aria-expanded="false" aria-controls="consent-categories-statistics">
<span>Statistics</span>
<i class="lucide lucide-chevron-down" data-icon="inline-end" aria-hidden="true"></i>
</button>
<div class="form-check form-switch flex-shrink-0 mb-0">
<input class="form-check-input" type="checkbox" role="switch" id="consent-category-statistics" aria-labelledby="consent-categories-statistics-trigger">
</div>
</h3>
<div id="consent-categories-statistics" class="accordion-collapse collapse" aria-labelledby="consent-categories-statistics-trigger">
<div class="accordion-body">
<p class="small mb-1">Anonymous counts of visits and pages, measured on our own server, so we know which content helps.</p>
<div class="border-top pt-2 mt-2">
<p class="fw-medium mb-1">Matomo</p>
<dl class="row small mb-0">
<dt class="col-4 fw-normal text-body-secondary">Provider</dt>
<dd class="col-8 mb-1">This website (self-hosted)</dd>
<dt class="col-4 fw-normal text-body-secondary">Purpose</dt>
<dd class="col-8 mb-1">Visit and page statistics</dd>
<dt class="col-4 fw-normal text-body-secondary">Cookies and storage</dt>
<dd class="col-8 mb-1">
<ul class="list-unstyled mb-0">
<li>
<code>_pk_id.*</code> <span class="text-body-secondary">Cookie, 13 months</span>
</li>
<li>
<code>_pk_ses.*</code> <span class="text-body-secondary">Cookie, 30 minutes</span>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h3 class="accordion-header d-flex align-items-center gap-3">
<button class="accordion-button collapsed" type="button" id="consent-categories-external_media-trigger" data-bs-toggle="collapse" data-bs-target="#consent-categories-external_media" aria-expanded="false" aria-controls="consent-categories-external_media">
<span>External media</span>
<i class="lucide lucide-chevron-down" data-icon="inline-end" aria-hidden="true"></i>
</button>
<div class="form-check form-switch flex-shrink-0 mb-0">
<input class="form-check-input" type="checkbox" role="switch" id="consent-category-external_media" aria-labelledby="consent-categories-external_media-trigger">
</div>
</h3>
<div id="consent-categories-external_media" class="accordion-collapse collapse" aria-labelledby="consent-categories-external_media-trigger">
<div class="accordion-body">
<p class="small mb-1">Videos and maps from other providers. They load from the provider's servers, which then receive your IP address.</p>
<div class="border-top pt-2 mt-2">
<p class="fw-medium mb-1">Video platform</p>
<dl class="row small mb-0">
<dt class="col-4 fw-normal text-body-secondary">Provider</dt>
<dd class="col-8 mb-1">Example Video Ltd.</dd>
<dt class="col-4 fw-normal text-body-secondary">Purpose</dt>
<dd class="col-8 mb-1">Play embedded videos</dd>
<dt class="col-4 fw-normal text-body-secondary">Cookies and storage</dt>
<dd class="col-8 mb-1">
<ul class="list-unstyled mb-0">
<li>
<code>Provider cookies</code> <span class="text-body-secondary">Cookie, Up to 6 months</span>
</li>
</ul>
</dd>
<dt class="col-4 fw-normal text-body-secondary">Privacy policy</dt>
<dd class="col-8 mb-1">
<a href="#video-privacy" rel="noopener noreferrer" target="_blank">Example Video Ltd.</a>
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<div class="w-100">
<div class="row g-2">
<div class="col-12 col-sm">
<button class="btn btn-outline-secondary w-100" id="consent-accept" type="button">Accept all</button>
</div>
<div class="col-12 col-sm">
<button class="btn btn-outline-secondary w-100" id="consent-decline" type="button">Decline</button>
</div>
<div class="col-12 col-sm">
<button class="btn btn-outline-secondary w-100" id="consent-save" type="button">Save choices</button>
</div>
</div>
<nav class="mt-2" aria-label="Legal information">
<ul class="list-unstyled d-flex flex-wrap column-gap-3 row-gap-1 small mb-0">
<li>
<a class="text-body-secondary" href="#cookie-policy">Cookie policy</a>
</li>
<li>
<a class="text-body-secondary" href="#privacy">Privacy policy</a>
</li>
<li>
<a class="text-body-secondary" href="#legal-notice">Legal notice</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<script type="application/json" data-consent-config>{"categories": [{"id": "functional", "required": true}, {"id": "statistics", "required": false, "storage": [{"name": "_pk_id.*", "type": "cookie"}, {"name": "_pk_ses.*", "type": "cookie"}]}, {"id": "external_media", "required": false, "storage": [{"name": "Provider cookies", "type": "cookie"}]}], "cookie": {"days": 365, "name": "moo_consent_catalog"}, "revision": "7b2ac531ea92"}</script>
</aside>
<button class="btn btn-link" type="button" data-consent-open="consent" aria-haspopup="dialog">Cookie settings</button>
<div class="ratio ratio-16x9 bg-body-secondary rounded overflow-hidden" data-consent-embed>
<div>
<div class="h-100" data-consent-placeholder="external_media">
<div class="d-flex align-items-center justify-content-center h-100 p-3">
<div class="card w-100 mw-100">
<div class="card-header">
<div class="card-header__text">
<h3 class="card-title">Video platform</h3>
</div>
</div>
<div class="card-body">
<p class="small text-body-secondary">
This video loads from Example Video Ltd., which receives your IP address. <a href="#video-privacy" rel="noopener noreferrer" target="_blank">Privacy policy</a>
</p>
<div class="d-flex flex-wrap align-items-center gap-3">
<button class="btn btn-primary" id="consent-video-load" type="button" data-consent-grant="external_media">Load content</button>
<div class="form-check mb-0">
<input class="form-check-input" type="checkbox" id="consent-video-remember" data-consent-remember>
<label class="form-check-label" for="consent-video-remember">Always allow</label>
</div>
</div>
</div>
</div>
</div>
</div>
<img class="object-fit-cover w-100 h-100" alt="Introduction video" data-consent-category="external_media" data-consent-src="/images/video-poster.webp" hidden>
</div>
</div>
About Consent in Moo UI
Consent is a cookie consent banner you host yourself. It asks each visitor once which optional categories they allow, such as statistics, marketing or external media like videos and maps, and keeps everything optional switched off until they say yes. Sites describe their categories and services in one configuration; the same configuration renders the card, the settings dialog and the table on the cookie policy page, so the banner and the policy never disagree.
It runs on your own domain: the card is plain server-rendered Bootstrap markup and the small consent.js module stores the answer in a first-party cookie. No consent management platform, no script from another host and no request leaves the page before the visitor agrees. The Odoo and Astro adapters render it from their own settings and translations.
-
Your site loads anything that is not strictly necessary: analytics such as Matomo, embedded videos, maps, social media posts or advertising tags.
-
You want separate choices per category instead of a single accept or reject, as the GDPR and the German TDDDG expect.
-
You need a cookie policy page that lists every service, provider, purpose and lifetime, kept in step with the banner.
-
Optional categories start unchecked, and Decline is one click, as easy as Accept all.
-
The choice is stored with a revision and a time stamp and asked again when you add a category or service, or after twelve months.
-
Scripts, frames and images marked with data-consent-category load only after their category is granted; withdrawing consent removes their first-party cookies.
-
A footer link reopens the same card at any time, so visitors can change their mind.
Functional Always active
Needed for the site to work: the session, security against forged requests, the chosen language and colour mode.
| Service |
Provider |
Purpose |
Cookies and storage |
| Site session |
This website |
Sign-in, form security, language and theme |
session_id Cookie, 7 days
frontend_lang Cookie, Session
moo_consent_catalog Cookie, 12 months
moo-website:1 Local storage, Until removed |
Statistics
Anonymous counts of visits and pages, measured on our own server, so we know which content helps.
| Service |
Provider |
Purpose |
Cookies and storage |
| Matomo |
This website (self-hosted) |
Visit and page statistics |
_pk_id.* Cookie, 13 months
_pk_ses.* Cookie, 30 minutes |
External media
Videos and maps from other providers. They load from the provider's servers, which then receive your IP address.
| Service |
Provider |
Purpose |
Cookies and storage |
Video platform Privacy policy |
Example Video Ltd. |
Play embedded videos |
Provider cookies Cookie, Up to 6 months |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101<div class="w-100">
<section class="mb-4" data-consent-policy="functional">
<h3>
Functional <span class="badge text-bg-secondary">Always active</span>
</h3>
<p>Needed for the site to work: the session, security against forged requests, the chosen language and colour mode.</p>
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Service</th>
<th scope="col">Provider</th>
<th scope="col">Purpose</th>
<th scope="col">Cookies and storage</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Site session</th>
<td>This website</td>
<td>Sign-in, form security, language and theme</td>
<td>
<code>session_id</code>
<span class="text-body-secondary">Cookie, 7 days</span>
<br>
<code>frontend_lang</code>
<span class="text-body-secondary">Cookie, Session</span>
<br>
<code>moo_consent_catalog</code>
<span class="text-body-secondary">Cookie, 12 months</span>
<br>
<code>moo-website:1</code>
<span class="text-body-secondary">Local storage, Until removed</span>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section class="mb-4" data-consent-policy="statistics">
<h3>Statistics</h3>
<p>Anonymous counts of visits and pages, measured on our own server, so we know which content helps.</p>
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Service</th>
<th scope="col">Provider</th>
<th scope="col">Purpose</th>
<th scope="col">Cookies and storage</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Matomo</th>
<td>This website (self-hosted)</td>
<td>Visit and page statistics</td>
<td>
<code>_pk_id.*</code>
<span class="text-body-secondary">Cookie, 13 months</span>
<br>
<code>_pk_ses.*</code>
<span class="text-body-secondary">Cookie, 30 minutes</span>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section class="mb-4" data-consent-policy="external_media">
<h3>External media</h3>
<p>Videos and maps from other providers. They load from the provider's servers, which then receive your IP address.</p>
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Service</th>
<th scope="col">Provider</th>
<th scope="col">Purpose</th>
<th scope="col">Cookies and storage</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
Video platform
<br>
<a class="small" href="#video-privacy" rel="noopener noreferrer" target="_blank">Privacy policy</a>
</th>
<td>Example Video Ltd.</td>
<td>Play embedded videos</td>
<td>
<code>Provider cookies</code>
<span class="text-body-secondary">Cookie, Up to 6 months</span>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
How it works
Configuration
Each category has an id, a label, a description and its services. Each service names its provider and purpose and lists the cookies or storage it uses, with their lifetime. Only categories with at least one service are shown, and only functional is always active. The configuration's revision changes whenever a category or service is added or removed, which asks every visitor again.
Stored choice
The answer is saved in a first-party cookie, moo_consent by default, holding a format version, the revision, the time of the choice and one entry per optional category. Your server can read it too, for example to leave a statistics snippet out of the page entirely.
Loading scripts and embeds after consent
Mark a script as type="text/plain" with data-consent-category, or give a frame or image data-consent-src instead of src. The module activates them when the category is granted. Code can also ask directly with granted("statistics"), wait with whenGranted() or listen for the moo:consent:change event.
Accessibility
On the first visit the card appears without taking focus or blocking the page. Opened from the settings link, focus moves into the card and stays there until it closes, then returns to the link. Every switch is a labelled native checkbox, and the card follows reduced motion, dark mode and right-to-left layouts.
Keyboard interaction
| Key |
Action |
| Tab |
Moves between the category rows, switches, buttons and links. When the card is opened from the settings link, focus stays inside it. |
| Enter / Space |
Expands a category, toggles a switch or activates a button. |
| Esc |
Closes the card opened from the settings link without changes, once a choice exists. |
A note on the law
The block follows the common reading of the GDPR, the German TDDDG §25 and the CJEU Planet49 judgment: no pre-ticked boxes, refusing as easy as accepting, and a way to withdraw at any time. It is not legal advice; which services need consent on your site, and how your privacy policy describes them, is for you and your advisers to decide.