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

ActivePimcore-bundle[Utility &amp; Helpers](/categories/utility)

docono/cookie-consent-bundle
============================

cookie consent for pimcore

v2.0.3(1y ago)0384↓100%GPL-3.0+PHPPHP &gt;=8.2

Since Aug 23Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (8)Used By (0)

Docono Cookie Consent
=====================

[](#docono-cookie-consent)

setup
-----

[](#setup)

define in the config the consents

```
dcc:
    consents:
        - analytics
        - youtube
        - my-consent

```

include the js:

```
{% do pimcore_inline_script().appendFile(asset(dcc().jsFile())) %}
```

or

```
{{ dcc().jsScript()|raw }}
```

---

there is also a basic styling if needed

```
{% do pimcore_head_link().appendStylesheet(dcc().cssFile()) %}
```

css vars:

```
  --dcc-clr-white: #FBFAF5;
  --dcc-clr-black: #2A363B;
  --dcc-clr-green: #99B898;

  --dcc-body-w: 50rem;
  --dcc-gap: 2rem;
  --dcc-my: 3rem;
  --dcc-mx: auto;

  --dcc-yt-width: 50rem;
  --dcc-yt-ratio: 16/9;

  --dcc-switch-size: 1.5rem;

```

consent dialog
--------------

[](#consent-dialog)

Create your consent dialog whatever you like it. Just ensure:

- the main container has the id "dc-consent"
- the "accept essential" button has the id "accept-essential"
- the "accept selected consents" button has the id "accept-selected"
- the name of the checkbox response with the defined consent

```
{% do dcc().dialog() %}

        {{ 'dcc.dialog.title'|trans }}

            {{ ('dcc.dialog.text'|trans)|raw }}

                {{ ('dcc.consent.essential')|trans }}

            {% for permission in dcc().permissionList() %}

                    {{ ('dcc.consent.' ~ permission)|trans }}

            {% endfor %}

            {{ 'dcc.button.essential'|trans }}
            {{ 'dcc.button.selected'|trans }}

{{ dcc().endDialog()|raw }}
```

JavaScript
----------

[](#javascript)

To prevent any JavaScript from execution, such as google analytics, use the JS functionality: Set the "data-consent" to the required consent name.

```
{% do dcc().js().start() %}

{{ dcc().js().end()|raw }}
```

The "src" attribute will be replaced with "data-src". Is the consent given, the script will be loaded.

or

```
{% do dcc().js().start() %}

    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments)
    }

    gtag('consent', 'default', {ad_storage: 'denied', analytics_storage: 'denied'});
    gtag('set', 'ads_data_redaction', true);
    gtag('set', 'url_passthrough', true);
    gtag('js', new Date());
    gtag('config', 'xxxx');

{{ dcc().js().end()|raw }}
```

The script "type" attribute value will be replaced with "text/plain", which prevents the script of being executed. If the consent is given, the script tag will be executed.

Youtube
-------

[](#youtube)

With the youtube helper, you ensure that no call will be made to youtube from the client browser. If the the consent "youtube" is not accepted, a placeholder with a base64 thumbnail will be shown. Is the thumbnail clicked, a consent prompt for that video will be shown.

### styling

[](#styling)

- container: .dcc-youtube
- play icon: .dcc-youtube\_\_play
- consent prompt: .dcc-youtube\_\_consent
- consent prompt buttons: .consent-youtube\_\_decline, .consent-youtube\_\_accept

### translations

[](#translations)

- dcc.youtube.message
- dcc.youtube.decline
- dcc.youtube.accept

```
{{ dcc().youtube('https://www.youtube-nocookie.com/embed/xxxxxx?controls=0')|raw }}

```

or get html tag with `getHtml(thumbnailQuality='high', attributes=[])`

```
{{ dcc().youtube('https://www.youtube-nocookie.com/embed/xxxxxx?controls=0').getHtml('low', {role: 'video'})|raw }}

```

Slots
-----

[](#slots)

If you want to show any content only if the consent is accepted, then there are slots

```

```

There are also predefined cookie-namespaces with all the necessary cookie names:

- matomo
- google-analytics
- google-tag-manager
- google-ad-sense

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~54 days

Total

7

Last Release

552d ago

Major Versions

v1.0.2 → v2.0.02024-11-06

PHP version history (2 changes)v1.0.0PHP &gt;=8.1

v2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/36825adece1a0ae6cf2c43bc9f09bb3395d6e2c0ff94b3d3bc8e97d554843834?d=identicon)[docono](/maintainers/docono)

---

Top Contributors

[![SQRR](https://avatars.githubusercontent.com/u/1695356?v=4)](https://github.com/SQRR "SQRR (7 commits)")

---

Tags

pimcorecookie-consentPimcore11DccBundle

### Embed Badge

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

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

###  Alternatives

[dachcom-digital/formbuilder

Pimcore FormBuilder - create forms easily!

96269.7k](/packages/dachcom-digital-formbuilder)[instride/data-definitions

Data Definitions allows you to define your DataObject Imports and Exports using a nice GUI and re-run the definitions as often you like.

8117.7k](/packages/instride-data-definitions)[dpfaffenbauer/process-manager

Process Manager helps you to see statuses for long running Processes

3289.3k2](/packages/dpfaffenbauer-process-manager)[youwe/workflow-gui

Workflow Configuration UI for Pimcore

2884.6k](/packages/youwe-workflow-gui)[dachcom-digital/schema

Pimcore Schema

1075.7k](/packages/dachcom-digital-schema)

PHPackages © 2026

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