Download the PHP package kaufmanndigital/gdpr-cookieconsent without Composer

On this page you can find all versions of the php package kaufmanndigital/gdpr-cookieconsent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gdpr-cookieconsent

KaufmannDigital.GDPR.CookieConsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.
This is a further development of our previous cookie consent package. Through the individual configuration per service (cookie), this package is a perfect basis for creating GDPR compliant websites.

Versions

This package is available in multiple Version. Here you can check compatibility and maintenance-state. Composer-Version Neos-Compatibility Maintenance
^1.0 < 5.0
^2.0 >= 5.0
^3.0 >= 5.0
^4.0 >= 5.0
^5.0 >= 5.0 🐛 ✨ (⚠️ Note changed rendering and Styling)

Installation

It's easier than you probably think!
Just run composer require kaufmanndigital/gdpr-cookieconsent (or require one of the versions from above)

After the installation it's necessary to run doctrine migrations: ./flow doctrine:migrate

Configuration

Since this package is ready-to-run, you can configure your cookie banner in just a few Steps.

  1. Create a new Cookie-Settings Page (shipped inside the Package) somewhere inside your Site-Tree.
  2. Switch to the newly created page and edit the cookie banner contents to your wishes.
  3. Add cookie-groups and cookies to the banner.

Consent per dimension

If you've configured one or multiple dimensions in Neos and you need to save different consents per dimension(-combination), you can just configure it using Settings.yaml:

This example would save different consents per country for each user. This means, the user will see the CookieConsent again the first time he switches to another country.
It also influences the way the content is stored in the cookie. Instead of a key "default" there are now multiple entries within"consents"` for each dimension(-combination). A short example:

If you configured multiple dimensions in consentDimensions, they get connected here using underscores. Example: deu_de

Exclude special pages (like imprint)

You have 2 options to exclude special pages from displaying the Cookie-Settings. If you have a special NodeType, you want to exclude, you can set it as general rule by Settings.yaml:

Alternatively, you can choose all kind of Document-Nodes in the Backend:

Show banner after first interaction

For example in SEO-aspects it makes sense to show the banner after users first interaction. You can easily configure the Package to behave like this:

Auto-Accept necessary cookies

In some cases, you may need to accept necessary cookies without an user-interaction. For such a case you can easily add the following to your HTML:

This makes the Package to auto-accept necessary cookies without showing the consent-window. The user of course can open the window by hand anyways to adjust the decision.

Accept by Headers

If you are loading site-contents from other websites or in apps, you already have your needed consent. If so, you can configure Headers, which should accept your consents by default.

Here you can use the syntax of fnmatch() for wildcards or similar.

Accept by URL-Params

You can also accept all cookies or necessary ones by URL-parameters. See, how to configure:

In this example, you can accept all cookies by calling every page you want with param ?gdpr=accept-all and accept necessary with param ?gdpr=accept-needed.
You can also define multiple param/value combinations for each case.

React to the user's cookie decision

You can use one of these Methods to react on the user's decision on which Cookies are accepted:

Load JavaScript dynamically

You can paste your JavaScript-Code while adding Cookies to the banner. The package will evaluate the user's decision and merge the required JavaScript dynamically for each user on the fly. You don't have to take care of anything. JavaScript gets loaded completely automatic. Cool, isn't it? 😎
Ah! And don't worry about performance. All JS gets minified and cached for every single visitor individually.

Read cookie-identifiers from cookie

If you are already using another way to include your JavaScript, you can depend on the value of the Choice-Cookie.
It's named KD_GDPR_CC and contains all identifiers of groups and cookies you defined in Backend while configuration. The payload of that cookie could look like this:

If you configured See example.

So just check consents and load the needed JavaScript.
Pro-Tip: If you are using Google Tag Manager to add your JS-Tags, you can define a custom datalayer-variable of type First-Party-Cookie, which can be used as condition inside triggers then.

Google Tag Manager Integration

There are two ways to interact between CookieConsent and Google's Tag-Manager. Also the new "Consent Mode" is supported. We provided a full Guide here. You can use the "old" way (also described in the link above) in alternative Tag-Managers, too.

Add a Re-open link

To create a link for reopening the banner, you only have to place a link with #GDPR-CC-open-settings as target:

After clicking on such a link, the cookie-banner will be loaded via API. Old settings are used as presets.

Custom cookie name

In some usecases it's needed to change the name of the Configuration-Cookie. That can easily be archived by using the following Setting:

Cookie lifetime

For GDPR(DSGVO) - Reasons it could be required, to have the Settings-Cookie (which holds the CookieConsent-Settings) expired after a shorter time-period. This is configurable by days via Settings.yaml:

Versioning

In some cases, it may be necessary to show the cookie-banner to people who have already gave their consent. For example, if a new cookie has been added.
To do this, you only need to edit the version date. You can find it in the inspector of the cookie-settings NodeType:

After the date has been changed, the banner will be shown again to all visitors, who have submitted the cookie banner before this date. Old settings are used as presets.

Invalidating user-decisions after time

Sometimes it is necessary or advantageous to remind the user of his decision and ask him to confirm it again. For this purpose, a TTL for the decision can be set in the backend:

The unit is seconds. After the set time has expired, the banner appears again with the default settings of the last decision, so the user can easily accept the old decision with just one click.
The value 0 (default) disables the repeated display of the banner.

Styling

Custom Banner-Styles

The banner comes with default styling that aims to be GDPR compliant and accessible.

You can customise the banner by either:

  1. Set a theme color (for buttons), the background color, text color and maximum width of the banner via the input fields in the inspector.
  2. Create a CSS-File with your own styling and include it using Settings.yaml:

To get an idea of the CSS-styling and class-names, you can have a look into our SCSS.

Instead of writing out all the selectors in your custom file, it might be enough to just overwrite the relevant custom properties. This example file shows the custom properties that can be used:

⚠️ Please note that colors set in the inspector will overwrite values set in your custom css file. You might need to unset the color values in the inspector first.

Use your own fusion components in the banner

Sometimes adjusting CSS isn't enough, and you just want to use your own button or text components in the banner. Good news: You can by overwriting the rendererof the following components:

Accessing the button labels is as easy as accessing ${props.label}.

Here's an example how to use your own button as the "Accept all" button:

Restrict CORS headers to specific domains

If you are using the cookie banner on multiple domains, you can restrict the CORS headers to specific domains. This is useful if you want to use the same cookie banner on multiple domains, but don't want to allow all domains to access the cookie banner API. To allow access to the cookie banner API only from specific domains, you can configure the allowed domains in the settings:

Roadmap / Planned Features

Sponsors

We would like to thank our sponsors, who supported us financially during the development:

Are you missing a feature in our solution? You want to support the development of this Package? Please don't hesitate to contact us!
Email: [email protected]

Maintainer

This package is maintained by the Neos Agency Kaufmann Digital.
Feel free to send us your questions or requests to [email protected]

Issues and Pull-Requests are welcome!

You got stuck while installing or configuring? You are missing something? You found a bug?
No problem, just create an issue or open a pull request. We'll have a look at it ASAP.

License

Licensed under GPL-3, see LICENSE


All versions of gdpr-cookieconsent with dependencies

PHP Build Version
Package Version
Requires neos/neos Version >=5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kaufmanndigital/gdpr-cookieconsent contains the following files

Loading the files please wait ....