Copy the following snippet to top of the <HEAD>
tag.
Change type tags and add cookie categories to your script snippets.
Change <script type="text/javascript">
to
<script type="text/plain" cc="[category]">
.
If you have CORS headers enabled, you should add the following expection <meta http-equiv="Access-Control-Allow-Origin" content="cookiecook.io">
The options
object passed to CC
will overwrite the online settings.
Name | Type | Supported | Description |
---|---|---|---|
privacyUrl | str | any | Link to your privacy notice. If none is given, Cookiecook will provide a privacy statement that applies to most. |
reloadOnUpdate | bool | [true, false] | If false, Cookiecook will not reload the page on consent, and will instead attempt to load the scripts in place. This may cause unwanted behavior in some cases. |
sendTelemetry | bool | [true, false] | Will send anonymous statistics about which categories the user consents to. |
consentModalPosition | str | [lower-right, upper-right, lower-left, upper-left] | Determines where consent modal position is. |
startFullscreenModal | bool | [true, false] | If enabled, it will immediately show the options modal when the user first visits. |
noTheme | bool | [true, false] | Will not load the css. |
themeColor | str | (css color) | Determines the theme color. |
adaptive | bool | [true, false] | If enabled, Cookiecook will adapt to the user's region. |
shortDescription | bool | [true, false] | Whether to use short cookie category descriptions. |
supportedCategories | list | [performance, functionality, targeting, uncategorized] | Which categories to include. Only supports the shown categories. |
includeEssentials | bool | [true, false] | Whether to use include the essentials category in the settings. |
cookieConsentCallback | function | (category) | Is called when user consents to a category. |
cookieRevokeCallback | function | (category) | Is called when the user revokes consent to a category. |
autoFirstParty (experimental) | bool | [true, false] | If set to true, Cookiecook will attempt to automatically manage first party cookies. However, it's not possible to automatically manage 3rd party cookies due to browser limitations. |
cookieChangeCallback | function | (name, previousValue, newValue) | Is called when a first party cookie is changed. |