CookieBot integration into Craft CMS 3.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
resources/img Initial commit Jun 6, 2018
src Downgraded to PHP 7.0 support Jul 6, 2018
.craftplugin Downgraded to PHP 7.0 support Jul 6, 2018
composer.json Downgraded to PHP 7.0 support Jul 6, 2018

CookieBot for Craft3

CookieBot integration into Craft CMS 3.


This plugin requires Craft CMS 3.0.0-RC1 or later.


  • Install with Composer via: composer require balazscsaba2006/cookiebot
  • Navigate to Settings -> Plugins and click the "Install" button


  • Navigate to Settings -> Plugins and configure settings for Cookiebot

Overriding plugin settings

If you create a config file in your config/ folder called cookiebot.php, you can override the plugin’s settings in the Control Panel. Since that config file is fully multi-environment aware, this is a handy way to have different settings across multiple environments.

Here’s what that config file might look like along with a list of all of the possible values you can override.


    return [
        'domainGroupID' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
        'defaultPreferences' => true,
        'defaultStatistics' => true,
        'defaultMarketing' => false


Can be used to render dialog and declaration script on Twig templates

Render dialog script:

{{ craft.cookiebot.dialogScript()|raw }}

Render declaration script:

{{ craft.cookiebot.dialogScript()|raw }}

Render dialog/declaration script in a certain language:

{{ craft.cookiebot.dialogScript(|raw }}

Can be used to check for consent on certain cookie categories like: Preferences, Statistics and Marketing.

Checking for any consent:

{% if craft.cookiebot.hasConsent %}
    {# ... #}
{% endif %}

Checking for consent on a specific category:


{% if craft.cookiebot.hasPreferencesConsent %}
    {# ... #}
{% endif %}


{% if craft.cookiebot.hasStatisticsConsent %}
    {# ... #}
{% endif %}


{% if craft.cookiebot.hasMarketingConsent %}
    {# ... #}
{% endif %}