Download the PHP package nilsenpaul/complete-cookie-consent without Composer

On this page you can find all versions of the php package nilsenpaul/complete-cookie-consent. 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 complete-cookie-consent

Complete Cookie Consent plugin for Craft CMS 3.x

This plugin will help you comply with EU Cookie law. As that law states, all European visitors of your site should not only be made aware of, but also consent to the cookies your site sets. This plugin will help you obtain consent for one or more cookie groups.

License

This plugin requires a commercial license which can be purchased through the Craft Plugin Store.
The license fee is $29 plus $9 per subsequent year for updates (optional).

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Installation

  1. Install with Composer via composer require nilsenpaul/complete-cookie-consent from your project directory
  2. Install plugin in the Craft Control Panel under Settings > Plugins
  3. Alter the plugin's settings to cater to your site's needs

You can also install Complete Cookie Consent via the Plugin Store in the Craft Control Panel.

Setup

Using the plugin's settings page, you have total control over the appearance and functionality of your cookie consent banner:

Usage

After you've installed the plugin, and activated the cookie consent banner, the banner will be shown on your site. Depending on your setup, an external geolocation API will be used to determine if a cookie banner is needed.

Consent mode (implied/explicit)

The Complete Cookie Consent plugin lets you choose between two consent modes: Implied and Explicit. With implied consent, the cookie banner will only be shown on every visitor's first page load. With explicit consent, the visitor will have to make a choice before the banner disappears.

What should I choose?

This is NOT legal advice. It's hard to find out what rules apply to your website, especially because every European country has its own set of rules (or no rules or enforcement whatsoever). If you want to play safe, go for explicit consent. If you decide to go for implied consent, make sure you create a form on your site for visitors to change their preferences.

Honoring your visitor's cookie preferences

Cookie consent wouldn't be of much use if you wouldn't act upon the preferences of your users. That's why the ccc JavaScript object is set, containing the preferences of the current visitor:

window.addEventListener('ccc.loaded', function(e) {
    console.log(ccc.consentSubmitted)
    # prints true or false. Only true if visitor submitted their preferences

    console.log(ccc.consentImplied)
    # prints true or false. True if consent mode is set to 'implied' and the visitor did not submit their own preferences

    console.log(ccc.consent.[cookieTypeHandle])
    # prints true or false, depending on your visitor's choice (or the default settings, if consent mode is 'implied')
});

You can use these values to load (or prevent loading of) whatever you want.

Cookie Consent variable

The plugin provides a template variable, to get the current visitor's consent info:

{% set consentInfo = craft.ccc.consentInfo %}

{{ consentInfo.consentSubmitted }}{# <-- true or false #}
{{ consentInfo.consent }}{# <-- An array with cookieType handles as keys, and consent status as value #}
{{ consentInfo.cookieTypes }}{# <-- An array containing cookie type config settings, indexed by handle #}

Updating cookie consent preferences with your own form

As of v1.0.1, it's possible to update consent preferences for a visitor with a form like this:

<form method="POST">
    <input type="hidden" name="action" value="complete-cookie-consent/consent/submit" />
    {{ csrfInput() }}

    {% for consentType, consentStatus in craft.ccc.consentInfo.consent %}
        <label for="cookieTypes[consentType]">
            <input type="checkbox" name="cookieTypes[]" value="{{ consentType }}"{% if consentStatus == true %} checked{% endif %} /> {{ consentType }}
        </label>
    {% endfor %}

    <input type="submit" value="Submit" />
</form>

Thank you!

TO-DO


All versions of complete-cookie-consent with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.0.0
geoip2/geoip2 Version ~2.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 nilsenpaul/complete-cookie-consent contains the following files

Loading the files please wait ....