Aller au contenu
Québec Studio

Extension pour Craft CMS

Cookie Consent Kit

Le consentement aux témoins, fait correctement : aucun témoin tiers avant l’accord du visiteur, et des pages qui restent en cache. Pensé pour la Loi 25.

Craft CMS 5
v5.0.8
Craft CMS 6
v6.0.10
Éditions
Lite (gratuite), Pro
Aussi pour
Statamic, Laravel

La documentation technique est rédigée en anglais, comme dans le dépôt.

Settings

Every setting the plugin reads. Where they are stored and how they are edited is covered by Configuration.

Reference

SettingTypeDefaultWhat it does
cookieNamestringcookie_consentCookie that stores the decision. Accepts $ENV_VAR.
cookieMaxAgeint15552000Lifetime of that cookie, in seconds (180 days).
versionint1A stored decision with another version is treated as absent.
defaultLanguagestringenLanguage used when the site's language has no wording file.
policySourceper site—entry or url. Inferred from what is set when absent.
policyEntryper site—[<entry id>]. Craft only.
policyUrlstring or per site/politique-de-confidentialitePolicy link. Accepts $ENV_VAR. A site missing from a map gets the default.
autoInjectbooltrueAppends the banner to every site page. Never to the control panel.
templateRootstring_consentSite template folder whose templates replace the plugin's.
colorSchemestringautoauto, light or dark.
backdropStylestringblurBehind the manage panel: blur, dim or none.
displayModestringfullfull, floating, corner-left or corner-right. Full width under 40rem. See Styling.
reopenButtonbooltrueTab that reopens the banner once a decision is stored.
reopenPositionstringautoSide of that tab: left, right, or auto, which follows displayMode (right for corner-right).
gpcHidesBannerbooltrueSkips the banner for a browser sending Global Privacy Control.
analyticsCategorystringstatisticsCategory granting Matomo and analytics_storage. Empty grants nothing.
marketingCategorystringmarketingCategory granting ad_storage, ad_user_data and ad_personalization. Empty grants nothing.
videoFacadebooltrueYouTube videos load on click.
videoThumbnailsbooltrueThe facade shows the YouTube thumbnail, fetched and served by the site.
videoConsentCategorystring''Category whose consent loads videos without the facade. Empty keeps the facade.
inventoryFrameworkstring''Class set of the cookie table: '', bootstrap, bulma, tailwind or custom.
inventoryClassesmap[]Classes per table element, used with custom.
categoriesmapshipped categoriesCategories and their cookies, in display order.
registryboolfalsePro. Records decisions server-side. See Register.
registryUserbooltruePro. Records the signed-in user with their decision, when there is one.
registryRequestContextboolfalsePro. Records the visitor's address and browser. Makes the register personal data.
registryGraceint12Pro. Months a record is kept beyond the life of the consent cookie. Zero keeps everything.

Per-site settings

policySource, policyEntry and policyUrl are maps keyed by site id or site handle. A key is looked up as an id, then as a handle:

'policyUrl' => [
    'default' => '/politique-de-confidentialite',
    'english' => '/en/privacy-policy',
],

A plain string applies to every site.

version

Increase it when a cookie is added to an optional category, a category is added, or a purpose changes. Every visitor is asked again. Renaming cookieName has the same effect.

Categories

'categories' => [
    'necessary' => [
        'required' => true,
        'label' => ['default' => 'Necessary'],
        'description' => ['default' => 'Required for the site to work.'],
        'cookies' => [
            'craft-session' => [
                'name' => 'CraftSessionId',
                'provider' => null,
                'purpose' => ['default' => 'Keeps your browsing session.'],
                'duration' => ['default' => 'Session'],
            ],
        ],
    ],
    'statistics' => [
        'required' => false,
        'label' => ['default' => 'Statistics'],
        'description' => ['default' => 'Help us understand how the site is used.'],
        'cookies' => [
            'ga' => [
                'name' => '_ga',
                'provider' => 'Google (google-analytics.com)',
                'purpose' => ['default' => 'Distinguishes visitors.'],
                'duration' => ['default' => '2 years'],
            ],
        ],
    ],
],
KeyWhat it is
category handle (statistics)Identifier shared by every site; stored in the consent cookie
requiredAlways on, not shown as a choice. Only necessary is required.
label, descriptionPer site, keyed by site handle. A plain string applies to every site.
cookie handle (ga)Identifier of the cookie across sites and across renames
nameTechnical name. {cookieName} is replaced with cookieName.
providerWho sets it. null is the site itself.
purpose, durationPer site, keyed by site handle

Rules

  • A category with no declared cookie is not shown in the banner.
  • Optional categories always start unchecked.
  • necessary cannot be removed.
  • A site with no wording of its own shows the wording of its language from the language files, then another site's.

Shipped categories

necessary, with the cookies Craft and the plugin set; statistics and marketing, with none. They are written into the settings when the plugin is installed, each site worded in its language.

Removing a category

  • Its cookies are removed with it.
  • Visitors who accepted it keep it in their consent cookie until version changes. window.qsmConsentKit.granted('<handle>') returns true for them.
  • Tags marked data-consent="<handle>" are no longer activated.

Une extension Craft CMS qui n’existe pas encore?

Si Craft CMS ne fait pas encore ce dont vous avez besoin, on peut le développer pour vous.

Parlons-en

Nous utilisons des témoins

Ce site utilise des témoins (« cookies ») nécessaires à son fonctionnement. Avec votre accord, nous en utilisons aussi pour mesurer la fréquentation. Vous pouvez changer d'avis en tout temps. Politique de confidentialité

Vos préférences de témoins

Toujours actif

Indispensables au fonctionnement du site et à la sécurité des formulaires. Ils ne peuvent pas être désactivés.

Nécessaires
Témoin Déposé par Finalité Conservation
CraftSessionId Ce site Maintient votre session de navigation. Session
CRAFT_CSRF_TOKEN Ce site Protège les formulaires contre la falsification de requête. Session
cookie_consent Ce site Mémorise vos choix en matière de témoins. 6 mois

Nous aident à comprendre comment le site est utilisé, afin de l’améliorer. Mesurées avec Matomo.

Statistiques
Témoin Déposé par Finalité Conservation
_pk_id.* Ce site Reconnaît le navigateur d’une visite à l’autre, sans vous identifier. 13 mois
_pk_ses.* Ce site Regroupe les pages vues pendant une même visite. 30 minutes