CookieBot integration into Craft CMS 2.
- Add the
cookiebot
directory into yourcraft/plugins
directory. - Navigate to
Settings -> Plugins
and click the "Install" button. - Navigate to
Settings -> Plugins
and click on settings for Cookiebot
Can be used to render dialog and declaration script on Twig templates
{{ craft.cookiebot.dialogScript()|raw }}
{{ craft.cookiebot.dialogScript()|raw }}
{% set locale = craft.i18n.getCurrentLocale() %}
{{ craft.cookiebot.dialogScript(locale.id)|raw }}
Can be used to check for consent on certain cookie categories like: Preferences, Statistics and Marketing.
{% if craft.cookiebot.hasConsent %}
{# ... #}
{% endif %}
Preferences:
{% if craft.cookiebot.hasPreferencesConsent %}
{# ... #}
{% endif %}
Statistics:
{% if craft.cookiebot.hasStatisticsConsent %}
{# ... #}
{% endif %}
Marketing:
{% if craft.cookiebot.hasMarketingConsent %}
{# ... #}
{% endif %}