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.1.2(6mo ago)117.6k↓44.3%[4 issues](https://github.com/statikbe/craft-cookie-banner/issues)1MITPHPCI failing

Since Oct 7Pushed 6mo 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 1mo ago

READMEChangelogDependencies (4)Versions (40)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

41

—

FairBetter than 89% of packages

Maintenance46

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

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 ~41 days

Recently: every ~85 days

Total

37

Last Release

201d ago

Major Versions

1.1.0 → 5.0.0-beta.12024-05-14

3.3.0 → 5.0.12024-10-03

3.3.1 → 5.0.22024-11-04

3.3.2 → 5.0.32024-11-21

3.3.3 → 5.1.02025-05-12

### 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 (75 commits)")[![KarelJanVanHaute](https://avatars.githubusercontent.com/u/88485726?v=4)](https://github.com/KarelJanVanHaute "KarelJanVanHaute (28 commits)")[![Numkil](https://avatars.githubusercontent.com/u/5604686?v=4)](https://github.com/Numkil "Numkil (26 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 (2 commits)")[![SarahOorts](https://avatars.githubusercontent.com/u/79193214?v=4)](https://github.com/SarahOorts "SarahOorts (2 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/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[verbb/vizy

A flexible visual editor field for Craft.

4348.6k](/packages/verbb-vizy)

PHPackages © 2026

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