PHPackages                             frontpack/cookie-consent - 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. frontpack/cookie-consent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

frontpack/cookie-consent
========================

Cookie consent bar

v0.1.4(4y ago)012BSD-3-ClauseJavaScript

Since Jan 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/frontpack/cookie-consent)[ Packagist](https://packagist.org/packages/frontpack/cookie-consent)[ RSS](/packages/frontpack-cookie-consent/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Frontpack\\Cookie-consent
=========================

[](#frontpackcookie-consent)

Cookie consent bar

[![Buy me a coffee](https://camo.githubusercontent.com/6016f6f11f8d00a9d3cccff14441a50c0326363529ee3b7f22a4615a34745ff7/68747470733a2f2f6275796d65636f666665652e696e746d2e6f72672f696d672f627574746f6e2d70617970616c2d77686974652e706e67)](https://www.paypal.me/janpecha/5eur)

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

[](#installation)

[Download a latest package](https://github.com/frontpack/cookie-consent/releases) or use [Composer](http://getcomposer.org/):

```
composer require frontpack/cookie-consent

```

Usage
-----

[](#usage)

On begin of page:

```
window.dataLayer = window.dataLayer || [];
window.gtag = window.gtag || function () { window.dataLayer.push(arguments); }
const CookieConsent = new FrontpackCookieConsent('storageKey-cc', function (consent) {
	consent.setDefaults({functional: true});
	const status = consent.getGCMValue('analytics');
	gtag('consent', 'default', {
		analytics_storage: status,
		personalization_storage: status,
		ad_storage: status,
		ads_data_redaction: status === 'granted' ? 'false' : 'true',
		wait_for_update: 500
	});
	dataLayer.push({event: 'default_consent'});
	dataLayer.push({event: 'consentSettingsUpdated'});
}, function (consent) {
	const status = consent.getGCMValue('analytics');
	gtag('consent', 'update', {
		analytics_storage: status,
		personalization_storage: status,
		ad_storage: status,
		ads_data_redaction: status === 'granted' ? 'false' : 'true',
		wait_for_update: 500
	});
	dataLayer.push({event: 'consentSettingsUpdated'});
});
```

### Cookie bar

[](#cookie-bar)

HTML:

```

		Description

		Link

			Functional

			Analytics

		Accept
		Dismiss
		Settings
		Save

```

JS (in page footer):

```
const bem = new LucyBem(document);
const cookieBar = new FrontpackCookieBar(bem, cookieConsent);
cookieBar.tryOpen();
```

---

License: [New BSD License](license.md)
Author: Jan Pecha,

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~5 days

Total

5

Last Release

1574d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c980b1511b4a0350442dc23d89c99d4d9a2411b7e765d52c133ccacf616968b?d=identicon)[janpecha](/maintainers/janpecha)

---

Top Contributors

[![janpecha](https://avatars.githubusercontent.com/u/637719?v=4)](https://github.com/janpecha "janpecha (5 commits)")

### Embed Badge

![Health badge](/badges/frontpack-cookie-consent/health.svg)

```
[![Health](https://phpackages.com/badges/frontpack-cookie-consent/health.svg)](https://phpackages.com/packages/frontpack-cookie-consent)
```

###  Alternatives

[immocaster/php-sdk

ImmobilienScout24 PHP-SDK

6437.9k](/packages/immocaster-php-sdk)

PHPackages © 2026

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