Skip to content
Québec Studio

Craft CMS extension

Cookie Consent Kit

Cookie consent, done right: no third-party cookie before the visitor agrees, and pages that stay cached. Built for Quebec’s Law 25.

Craft CMS 5
v5.0.8
Craft CMS 6
v6.0.10
Editions
Lite (free), Pro
Also for
Statamic, Laravel

Wording

Visitor-facing wording comes from language files, one per language. English and French are shipped.

To replace a string or add a language in a project, see Wording.

File shape

<?php

return [
    'texts' => [
        'title' => 'We use cookies',
        'accept' => 'Accept',
        // …
    ],
    'categories' => [
        'necessary' => [
            'label' => 'Necessary',
            'description' => 'Required for the site to work.',
            'cookies' => [
                'craft-session' => ['purpose' => 'Keeps your browsing session.', 'duration' => 'Session'],
            ],
        ],
    ],
];

Language resolution

  1. The site's locale (fr-CA), if a file exists for it.
  2. Its base language (fr).
  3. defaultLanguage.

A key missing from the resolved file comes from the defaultLanguage file, then from English.

texts keys

KeyWhere it appears
title, bodyBanner
accept, refuse, manageBanner buttons
panelTitle, save, closeManage panel
details, alwaysOnCategory rows
colName, colProvider, colPurpose, colDuration, firstPartyCookie table
policyLabelPrivacy policy link
reopenLabelReopen tab
confirmation, reloadNoticeScreen-reader announcements
gpcNoticeManage panel, when the browser sends Global Privacy Control
videoPlay, videoNotice, videoLabelVideo facade

categories

Wording of the shipped categories and cookies. It is written into each site's inventory when the plugin is installed, and read for a site that has no wording of its own. The inventory's wording is then edited per site.

Adding a language

A project adds one by translating a copy of the shipped English file — see Wording.

A Craft CMS extension that doesn’t exist yet?

If Craft CMS doesn’t do what you need yet, we can build it for you.

Let’s talk

We use cookies

This site uses cookies that are required for it to work. With your consent, we also use cookies to measure traffic. You can change your mind at any time. Privacy policy

Your cookie preferences

Always on

Required for the site to work and for form security. These cannot be turned off.

Necessary
Cookie Set by Purpose Retention
CraftSessionId This site Keeps your browsing session. Session
CRAFT_CSRF_TOKEN This site Protects forms against cross-site request forgery. Session
cookie_consent This site Remembers your cookie choices. 6 months

Help us understand how the site is used so we can improve it. Measured with Matomo.

Statistics
Cookie Set by Purpose Retention
_pk_id.* This site Recognizes the browser from one visit to the next, without identifying you. 13 months
_pk_ses.* This site Groups the pages viewed during a single visit. 30 minutes