From c418173d3713a57210633c403310956b5e6d91c6 Mon Sep 17 00:00:00 2001 From: Bogdan Duda Date: Fri, 8 Nov 2024 20:05:36 +0200 Subject: [PATCH 1/4] Add default consent and CDN region (com/eu) configurable settings * Move uc.js loading to head.html to ensure loading after default consent --- manifest.json | 79 +++++++++++++++++++++++++++++++------ pixel/body.html | 2 +- pixel/head-start.html | 35 +++++++++++++++- pixel/head.html | 17 ++++++++ react/CookieDeclaration.tsx | 3 +- react/typings/global.d.ts | 1 + 6 files changed, 121 insertions(+), 16 deletions(-) create mode 100644 pixel/head.html diff --git a/manifest.json b/manifest.json index e803f94..1676484 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "cookiebot", "vendor": "vtex", - "version": "2.0.8", + "version": "2.1.0", "title": "Cookiebot", "description": "With a few clicks configure and preview your own cookie declaration and consent dialog.", "billingOptions": { @@ -11,9 +11,7 @@ }, "free": true, "type": "free", - "availableCountries": [ - "*" - ] + "availableCountries": ["*"] }, "builders": { "pixel": "0.x", @@ -36,15 +34,70 @@ "gcm": { "title": "Google Consent Mode", "type": "string", - "default": "enabled", - "enum": [ - "enabled", - "disabled" - ], - "enumNames": [ - "enabled", - "disabled" - ] + "enum": ["enabled", "disabled"], + "default": "enabled" + }, + "cbm": { + "title": "Cookie blocking mode", + "description": "Choose between automatic or manual cookie blocking. !!! WARNING !!! Automatic cookie blocking may break your store. Use with caution!", + "type": "string", + "enum": ["auto", "manual"], + "default": "manual" + }, + "cdn": { + "title": "CDN Region", + "description": "Choose the region where the Cookiebot script is hosted. Mind that changing the default region .com may affect functionality if you also employ CSP. Make sure to update your CSP policy accordingly (permit *.cookiebot.eu or *.cookiebot.com).", + "type": "string", + "enum": ["com", "eu"], + "default": "com" + }, + "edc": { + "title": "Enable Default Consent", + "description": "Enable or disable the default consent mode, activating the options below", + "type": "boolean", + "default": false + }, + "defaultConsent": { + "title": "Default Consent", + "type": "object", + "properties": { + "ad_storage": { + "title": "ad_storage", + "description": "Sets consent for storing and processing personal data for advertising purposes", + "type": "boolean", + "default": false + }, + "analytics_storage": { + "title": "analytics_storage", + "description": "Sets consent for storing and processing personal data for analytics purposes", + "type": "boolean", + "default": false + }, + "ad_user_data": { + "title": "ad_user_data", + "description": "Sets consent for sending user data related to advertising to Google", + "type": "boolean", + "default": false + }, + "ad_personalization": { + "title": "ad_personalization", + "description": "Sets consent for personalized advertising", + "type": "boolean", + "default": false + }, + "functionality_storage": { + "title": "functionality_storage", + "description": "Sets consent for storing and processing personal data for functionality purposes", + "type": "boolean", + "default": false + }, + "personalization_storage": { + "title": "personalization_storage", + "description": "Sets consent for storing and processing personal data for personalization purposes", + "type": "boolean", + "default": false + } + } } } }, diff --git a/pixel/body.html b/pixel/body.html index 4780f37..7596e46 100644 --- a/pixel/body.html +++ b/pixel/body.html @@ -1 +1 @@ - + diff --git a/pixel/head-start.html b/pixel/head-start.html index 3c82e58..d56dd13 100644 --- a/pixel/head-start.html +++ b/pixel/head-start.html @@ -1 +1,34 @@ - + + + diff --git a/pixel/head.html b/pixel/head.html new file mode 100644 index 0000000..efd1b0a --- /dev/null +++ b/pixel/head.html @@ -0,0 +1,17 @@ + diff --git a/react/CookieDeclaration.tsx b/react/CookieDeclaration.tsx index c296340..97f58a9 100644 --- a/react/CookieDeclaration.tsx +++ b/react/CookieDeclaration.tsx @@ -9,11 +9,12 @@ const CookieDeclaration: FC = () => { return } const cbid = window.__cookiebot_id + const cdn = window.__cookiebot_cdn const script = document.createElement('script') script.id = 'CookieDeclaration' script.type = 'text/javascript' script.async = true - script.src = `https://consent.cookiebot.com/${cbid}/cd.js` + script.src = `https://consent.cookiebot.${cdn}/${cbid}/cd.js` node.appendChild(script) }, []) diff --git a/react/typings/global.d.ts b/react/typings/global.d.ts index d6ac54b..1311240 100644 --- a/react/typings/global.d.ts +++ b/react/typings/global.d.ts @@ -1,5 +1,6 @@ interface Window extends Window { __cookiebot_id: string + __cookiebot_cdn: string Cookiebot: Cookiebot } From cbe7466387c7151b8f92f9b073ef00ea34f7116f Mon Sep 17 00:00:00 2001 From: Bogdan Duda Date: Fri, 8 Nov 2024 20:11:54 +0200 Subject: [PATCH 2/4] Add version to CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e67280..08c1138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.1.0] - 2024-11-08 +- Admin settings that enable and configure default consent for cookies +- Admin setting that switches Cookiebot CDN between .com and .eu [Cookiebot European CDN solution](https://support.cookiebot.com/hc/en-us/articles/4530208762396-Cookiebot-CMP-European-CDN-solution) + ## [2.0.8] - 2022-08-18 From 57b32beb06f9800cc125f6a6877cf7f04aff0396 Mon Sep 17 00:00:00 2001 From: Bogdan BeeCoded <81679745+bdudabeecoded@users.noreply.github.com> Date: Fri, 8 Nov 2024 22:58:44 +0200 Subject: [PATCH 3/4] Revert version bump --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1676484..6fa1fc4 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "cookiebot", "vendor": "vtex", - "version": "2.1.0", + "version": "2.0.8", "title": "Cookiebot", "description": "With a few clicks configure and preview your own cookie declaration and consent dialog.", "billingOptions": { From ff959fded83689946ac2145178d7cfbac50b01d6 Mon Sep 17 00:00:00 2001 From: Bogdan BeeCoded <81679745+bdudabeecoded@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:14:08 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08c1138..a237826 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [2.1.0] - 2024-11-08 +### Added - Admin settings that enable and configure default consent for cookies - Admin setting that switches Cookiebot CDN between .com and .eu [Cookiebot European CDN solution](https://support.cookiebot.com/hc/en-us/articles/4530208762396-Cookiebot-CMP-European-CDN-solution)