PHPackages                             statikbe/craft-cookie-banner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. statikbe/craft-cookie-banner

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

statikbe/craft-cookie-banner
============================

Cookie banner and modal package

5.2.8(2w ago)119.9k↓55%[4 issues](https://github.com/statikbe/craft-cookie-banner/issues)1MITPHPCI failing

Since Oct 7Pushed 1w ago4 watchersCompare

[ Source](https://github.com/statikbe/craft-cookie-banner)[ Packagist](https://packagist.org/packages/statikbe/craft-cookie-banner)[ RSS](/packages/statikbe-craft-cookie-banner/feed)WikiDiscussions develop Synced 2d ago

READMEChangelogDependencies (14)Versions (58)Used By (1)

Cookie banner for Craft CMS 3.x
===============================

[](#cookie-banner-for-craft-cms-3x)

This is an internal Statik.be plugin for use with our Tag Manager consent management solution.

⚠️ The plugin will only render templates out of the box, it won't do anything to prevent tracking without proper configuration.

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions:

```
cd /path/to/project
composer require statikbe/craft-cookie-banner
./craft  plugin/install cookie-banner
```

Usage
-----

[](#usage)

The plugin uses a Twig function to render the initial popup and the cookie settings modal.

```
{{ craft.cookieBanner.render() }}
```

You can also pass an array of options:

- modal: path to the template for the modal
- banner: path to the template for the banner
- overlay: HTML string with styling that will you use as overlay behind the banner
- supportIE: wether or not the Javascript used should be compiled for ES6 or ES5 (defaults to false so using ES6)
- cookiePage: the entry where the cookie policy content is defined. It is also possible to provide an (external) URL. This is used on the modal template to show the possible settings.

For example:

```
{{ craft.cookieBanner.render({
        modal: '_site/_snippet/_cookie/_modal',
        banner: '_site/_snippet/_cookie/_banner',
        overlay: '',
        supportIE: true,
        cookiePage: craft.entries.section('cookiePolicy').one(),
        showCookieBanner: (entry.type is defined and entry.type.handle != 'cookiePolicy')
}) }}
```

It's adviced to not overwrite the templates just for styling, only for more fundamental and structural changes.

[Modal](https://github.com/statikbe/craft-cookie-banner/blob/master/src/templates/_modal.twig), [banner](https://github.com/statikbe/craft-cookie-banner/blob/master/src/templates/_banner.twig) and [overlay](https://github.com/statikbe/craft-cookie-banner/blob/develop/src/templates/_overlay.twig) templates have generic classes that can be used for styling.

To trigger the settings modal after closing the cookie banner, you can use the following code:

```
{{ 'Cookie settings'|t }}
```

Listeners
---------

[](#listeners)

You can listen to the following events:

```
cookie-banner-opened
cookie-closed
cookie-modal-opened
cookie-prop-performance-disabled
cookie-prop-performance-enabled
cookie-prop-marketing-disabled
cookie-prop-marketing-enabled

```

Example:

```
window.addEventListener('cookie-closed', () => {
  console.log('cookie-closed');
});
```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance78

Regular maintenance activity

Popularity28

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~2 days

Total

51

Last Release

8d ago

Major Versions

3.3.2 → 5.0.32024-11-21

3.3.3 → 5.1.02025-05-12

3.4.0 → 5.1.12025-05-26

3.5.0 → 5.2.22026-06-08

3.5.2 → v5.x-dev2026-06-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/1250437446b84017407f7f1900194b1e1c93fcf34b332ba382fb77f69b251cb6?d=identicon)[statikbe](/maintainers/statikbe)

---

Top Contributors

[![janhenckens](https://avatars.githubusercontent.com/u/755428?v=4)](https://github.com/janhenckens "janhenckens (80 commits)")[![KarelJanVanHaute](https://avatars.githubusercontent.com/u/88485726?v=4)](https://github.com/KarelJanVanHaute "KarelJanVanHaute (30 commits)")[![Numkil](https://avatars.githubusercontent.com/u/5604686?v=4)](https://github.com/Numkil "Numkil (29 commits)")[![stijnelskens](https://avatars.githubusercontent.com/u/12715277?v=4)](https://github.com/stijnelskens "stijnelskens (10 commits)")[![carolineboeykens](https://avatars.githubusercontent.com/u/42932673?v=4)](https://github.com/carolineboeykens "carolineboeykens (7 commits)")[![HannahDeWachter](https://avatars.githubusercontent.com/u/55497252?v=4)](https://github.com/HannahDeWachter "HannahDeWachter (3 commits)")[![SarahOorts](https://avatars.githubusercontent.com/u/79193214?v=4)](https://github.com/SarahOorts "SarahOorts (3 commits)")

---

Tags

craft-plugincraftcmscmscookiesCraftcraftcmscraft-plugingdpr

### Embed Badge

![Health badge](/badges/statikbe-craft-cookie-banner/health.svg)

```
[![Health](https://phpackages.com/badges/statikbe-craft-cookie-banner/health.svg)](https://phpackages.com/packages/statikbe-craft-cookie-banner)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[verbb/navigation

Create navigation menus for your site.

92705.0k18](/packages/verbb-navigation)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/workflow

Enforce multi-step review processes for creating entries.

138124.2k1](/packages/verbb-workflow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
