Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Consent Mode V2 #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/GTM_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Then you can add the tag and configure it.
4. Click on the _Tag Configuration_ block and select _Leckerli Cookie Banner_ in the _Custom_ section.
5. (Optional) Click on _Tag permissions_ and review them.
6. Set the _leckerli settings_ according to the configuration section below and the [Leckerli README](../README.md). The field must be a valid JSON string and can have multiple lines. You should at least remove not required consent from the permissions array.
7. (Optional) Change the default consent (this is the consent values before the user's consent settings are updated). The default is set to _denied_ for all consents (_ad_storage_, _analytics_storage_, _functionality_storage_, _personalization_storage_, and _security_storage_).
7. (Optional) Change the default consent (this is the consent values before the user's consent settings are updated). The default is set to _denied_ for all consents (_ad_storage_, _analytics_storage_, _ad_user_data_, _ad_personalization_, _functionality_storage_, _personalization_storage_, and _security_storage_).
8. Click on the _Save_ button and optionally choose another tag name.

### (Optional) Create Leckerli trigger event
Expand Down
2 changes: 2 additions & 0 deletions doc/gtm-tag-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const updateConsentState = require('updateConsentState');
const DEFAULT_CONSENT_STATE = {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'denied',
Expand Down
74 changes: 73 additions & 1 deletion doc/gtm-tag-template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ___TEMPLATE_PARAMETERS___
"name": "leckerliSettings",
"displayName": "Leckerli Settings",
"simpleValueType": true,
"defaultValue": "{\"permissions\": [\"ad_storage\", \"analytics_storage\", \"functionality_storage\", \"personalization_storage\", \"security_storage\"] }",
"defaultValue": "{\"permissions\": [\"ad_storage\", \"analytics_storage\", \"ad_user_data\", \"ad_personalization\", \"functionality_storage\", \"personalization_storage\", \"security_storage\"] }",
"lineCount": 8,
"help": "JSON format"
},
Expand Down Expand Up @@ -57,6 +57,14 @@ ___TEMPLATE_PARAMETERS___
"value": "analytics_storage",
"displayValue": "analytics_storage"
},
{
"value": "ad_user_data",
"displayValue": "ad_user_data"
},
{
"value": "ad_personalization",
"displayValue": "ad_personalization"
},
{
"value": "functionality_storage",
"displayValue": "functionality_storage"
Expand Down Expand Up @@ -108,6 +116,8 @@ const updateConsentState = require('updateConsentState');
const DEFAULT_CONSENT_STATE = {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'denied',
Expand Down Expand Up @@ -395,6 +405,68 @@ ___WEB_PERMISSIONS___
}
]
},
{
"type": 3,
"mapKey": [
{
"type": 1,
"string": "consentType"
},
{
"type": 1,
"string": "read"
},
{
"type": 1,
"string": "write"
}
],
"mapValue": [
{
"type": 1,
"string": "ad_user_data"
},
{
"type": 8,
"boolean": true
},
{
"type": 8,
"boolean": true
}
]
},
{
"type": 3,
"mapKey": [
{
"type": 1,
"string": "consentType"
},
{
"type": 1,
"string": "read"
},
{
"type": 1,
"string": "write"
}
],
"mapValue": [
{
"type": 1,
"string": "ad_personalization"
},
{
"type": 8,
"boolean": true
},
{
"type": 8,
"boolean": true
}
]
},
{
"type": 3,
"mapKey": [
Expand Down