PHPackages                             thoughtco/statamic-cookiepanel - 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. thoughtco/statamic-cookiepanel

ActiveLibrary

thoughtco/statamic-cookiepanel
==============================

Cookie Panel for a Statamic site

2.3.1(1y ago)06.8k—0%JavaScript

Since Feb 17Pushed 1y ago5 watchersCompare

[ Source](https://github.com/thoughtco/statamic-cookiepanel)[ Packagist](https://packagist.org/packages/thoughtco/statamic-cookiepanel)[ RSS](/packages/thoughtco-statamic-cookiepanel/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (21)Used By (0)

Cookie Panel
============

[](#cookie-panel)

> Cookie Panel is an add on for Statamic that provides add a privacy-first cookie panel for your front-end site. It works flawlessly with fully static cached sites.

How to Install
--------------

[](#how-to-install)

Run the following command from your project root:

```
composer require thoughtco/statamic-cookiepanel
```

How it works
------------

[](#how-it-works)

The addon should provides a `{{ cookie_panel:has_consented_to }}` tag that you can use to wrap any external libraries (such as Google Analytics, Maps, Meta Pixels) inside a `` tag so they aren't displayed by default.

On load the `{{ cookie_panel:scripts }}` tag checks for what cookie groups have been consented to and displays them if consent has been fiven.

Consent is managed through the `{{ cookie_panel:panel }}` tag, which pulls from settings in a new Cookie Panel global in your site's CP. Consent groups are stored in LocalStorage so no cookies are set and static caching is fully supported.

How to use
----------

[](#how-to-use)

Add the following files to your site's layout, they are needed to make the other tags work:

```
{{ cookie_panel:scripts }}
{{ cookie_panel:styles }}
```

### Check if consent has been given

[](#check-if-consent-has-been-given)

Wrap any libraries that set cookies inside this tag: `{{ cookie_panel:has_consented_to type="group-name" }}`

e.g

```
{{ cookie_panel:has_consented_to type="analytics" }}

	Bad stuff here

{{ /cookie_panel:has_consented_to }}

```

### Ouput the Cookie Panel

[](#ouput-the-cookie-panel)

To display a cookie consent panel to the end user add:

```
{{ cookie_panel:panel }}

```

### Output the Cookie Table

[](#output-the-cookie-table)

If you want to display a list of cookies to your user, populated with the data you add in the Cookie Panel global add:

```
{{ cookie_panel:cookie_table }}

```

### Interacting with Consent through Javascript

[](#interacting-with-consent-through-javascript)

The `{{ cookiepanel:scripts }}` tag provides a `ConsentPanel` variable to your global javascript.

It has a number of methods you can access:

#### ConsentPanel.open() / ConsentPanel.close()

[](#consentpanelopen--consentpanelclose)

Use these to open and close the panel.

#### ConsentPanel.hasConsentedTo('group-name')

[](#consentpanelhasconsentedtogroup-name)

Use this to determine if consent has been given to a certain cookie group.

#### ConsentPanel.getContentSettings()

[](#consentpanelgetcontentsettings)

This method provides an array of cookie group handles that have been consented to.

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance42

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 90.7% 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 ~82 days

Recently: every ~62 days

Total

18

Last Release

466d ago

Major Versions

1.2.0 → 2.0.02024-02-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51899?v=4)[Ryan Mitchell](/maintainers/ryanmitchell)[@ryanmitchell](https://github.com/ryanmitchell)

---

Top Contributors

[![ryanmitchell](https://avatars.githubusercontent.com/u/51899?v=4)](https://github.com/ryanmitchell "ryanmitchell (39 commits)")[![anditopping](https://avatars.githubusercontent.com/u/1104234?v=4)](https://github.com/anditopping "anditopping (4 commits)")

### Embed Badge

![Health badge](/badges/thoughtco-statamic-cookiepanel/health.svg)

```
[![Health](https://phpackages.com/badges/thoughtco-statamic-cookiepanel/health.svg)](https://phpackages.com/packages/thoughtco-statamic-cookiepanel)
```

PHPackages © 2026

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