Derive consent mode from geolocation, not banner config
The consent mode is now determined dynamically by the visitor's country and its applicable regulation. The configured consent_mode column is dropped from cookie_banners and added to cookie_consent_records to persist the geo-derived mode at consent-recording time. When no regulation matches, the default is OPT_OUT. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -89,30 +89,6 @@ export const description: INodeProperties[] = [
|
||||
description: 'Number of days before consent expires',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Consent Mode',
|
||||
name: 'consentMode',
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['cookieBanner'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Opt In',
|
||||
value: 'OPT_IN',
|
||||
},
|
||||
{
|
||||
name: 'Opt Out',
|
||||
value: 'OPT_OUT',
|
||||
},
|
||||
],
|
||||
default: 'OPT_IN',
|
||||
description: 'The consent mode for the cookie banner',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Privacy Policy URL',
|
||||
name: 'privacyPolicyUrl',
|
||||
@@ -137,7 +113,6 @@ export async function execute(
|
||||
const origin = this.getNodeParameter('origin', itemIndex) as string;
|
||||
const cookiePolicyUrl = this.getNodeParameter('cookiePolicyUrl', itemIndex) as string;
|
||||
const consentExpiryDays = this.getNodeParameter('consentExpiryDays', itemIndex) as number;
|
||||
const consentMode = this.getNodeParameter('consentMode', itemIndex) as string;
|
||||
const privacyPolicyUrl = this.getNodeParameter('privacyPolicyUrl', itemIndex, '') as string;
|
||||
|
||||
const query = `
|
||||
@@ -152,7 +127,6 @@ export async function execute(
|
||||
privacyPolicyUrl
|
||||
cookiePolicyUrl
|
||||
consentExpiryDays
|
||||
consentMode
|
||||
showBranding
|
||||
defaultLanguage
|
||||
createdAt
|
||||
@@ -169,7 +143,6 @@ export async function execute(
|
||||
origin,
|
||||
cookiePolicyUrl,
|
||||
consentExpiryDays,
|
||||
consentMode,
|
||||
};
|
||||
if (privacyPolicyUrl) input.privacyPolicyUrl = privacyPolicyUrl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user