From 3bfc75856dcc769d6200728b7bab780701f6f8d7 Mon Sep 17 00:00:00 2001 From: sandeepdigumarty Date: Mon, 30 Sep 2024 10:52:15 +0530 Subject: [PATCH 1/5] feat(garl): move GARL destination to new form builder --- .../db-config.json | 4 +- .../ui-config.json | 456 ++++++++++-------- 2 files changed, 257 insertions(+), 203 deletions(-) diff --git a/src/configurations/destinations/google_adwords_remarketing_lists/db-config.json b/src/configurations/destinations/google_adwords_remarketing_lists/db-config.json index e35235c44..6d6e64f48 100644 --- a/src/configurations/destinations/google_adwords_remarketing_lists/db-config.json +++ b/src/configurations/destinations/google_adwords_remarketing_lists/db-config.json @@ -37,10 +37,10 @@ "isHashRequired", "typeOfList", "userDataConsent", - "personalizationConsent" + "personalizationConsent", + "audienceId" ], "cloud": [ - "audienceId", "connectionMode", "consentManagement", "oneTrustCookieCategories", diff --git a/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json b/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json index 249c00d71..795fced24 100644 --- a/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json +++ b/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json @@ -1,177 +1,238 @@ { - "uiConfig": [ - { - "title": "Connection Settings", - "fields": [ - { - "type": "textInput", - "label": "List ID", - "value": "audienceId", - "regex": "^(.{1,100})$", - "regexErrorMessage": "Invalid Google remarketing list ID", - "required": true, - "placeholder": "e.g: 7692X49833" - }, - { - "type": "textInput", - "label": "Customer ID", - "value": "customerId", - "regex": "^(.{1,100})$", - "regexErrorMessage": "Invalid Customer ID", - "required": true, - "placeholder": "e.g: 9693X29833" - }, - { - "type": "checkbox", - "label": "Sub Account", - "value": "subAccount", - "required": false, - "default": false - }, - { - "type": "textInput", - "label": "Login Customer ID", - "preRequisiteField": [ - { - "name": "subAccount", - "selectedValue": true - } - ], - "value": "loginCustomerId", - "regex": "^(.{0,100})$", - "required": true, - "footerNote": "If customer ID is from a sub account, then provide the customer ID of manager account" - } - ] - }, - { - "title": "Event Settings", - "fields": [ - { - "type": "singleSelect", - "label": "List Type", - "value": "typeOfList", - "mode": "single", - "options": [ - { - "name": "General", - "value": "General" - }, - { - "name": "User ID", - "value": "userID" - }, - { - "name": "Mobile Device ID", - "value": "mobileDeviceID" - } - ], - "defaultOption": { - "value": "General" + "uiConfig": { + "baseTemplate": [ + { + "title": "Initial setup", + "note": "Review how this destination is set up", + "sections": [ + { + "groups": [ + { + "title": "Connection settings", + "note": "Update your connection settings here", + "icon": "settings", + "fields": [ + { + "type": "textInput", + "label": "Customer ID", + "note": "Enter the Customer ID of you Google remarketing list", + "configKey": "customerId", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "regexErrorMessage": "Invalid Customer ID", + "placeholder": "e.g: 9693X29833" + }, + { + "type": "textInput", + "label": "List Id", + "note": "Enter your Google remarketing list ID", + "configKey": "audienceId", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "regexErrorMessage": "Invalid Google remarketing list ID", + "placeholder": "e.g: 7692X49833", + "preRequisites": { + "fields": [ + { + "configKey": "connectionMode.cloud", + "value": "cloud" + } + ] + } + }, + { + "type": "checkbox", + "label": "Sub Account", + "configKey": "subAccount", + "default": false + }, + { + "type": "textInput", + "label": "Login Customer ID", + "note": "If customer ID is from a sub account, then provide the customer ID of manager account", + "configKey": "loginCustomerId", + "regex": "^(.{0,100})$", + "regexErrorMessage": "Invalid Login Customer ID", + "preRequisites": { + "fields": [ + { + "configKey": "subAccount", + "value": true + } + ] + } + } + ] + } + ] + }, + { + "groups": [ + { + "title": "Connection mode", + "note": [ + "Update how you want to route events from your source to destination. ", + { + "text": "Get help deciding", + "link": "https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/" + } + ], + "icon": "sliders", + "fields": [], + "callout": { + "message": "Cloud mode for this destination will be deprecated soon. Please migrate to Facebook Conversions destination for cloud mode.", + "type": "info" + } + } + ] } - }, - { - "type": "singleSelect", - "label": "Specify the consent for uploaded users for using their data in Google Advertising Purpose", - "value": "userDataConsent", - "options": [ - { - "name": "Unspecified", - "value": "UNSPECIFIED" - }, - { - "name": "Unknown", - "value": "UNKNOWN" - }, - { - "name": "Granted", - "value": "GRANTED" - }, - { - "name": "Denied", - "value": "DENIED" - } - ], - "default": "UNSPECIFIED" - }, - { - "type": "singleSelect", - "label": "Specify the consent for uploaded users regarding Ads Personalization", - "value": "personalizationConsent", - "options": [ - { - "name": "Unspecified", - "value": "UNSPECIFIED" - }, - { - "name": "Unknown", - "value": "UNKNOWN" - }, - { - "name": "Granted", - "value": "GRANTED" - }, - { - "name": "Denied", - "value": "DENIED" - } - ], - "default": "UNSPECIFIED" - }, - { - "type": "checkbox", - "label": "Hash Required", - "value": "isHashRequired", - "default": true - }, - { - "type": "singleSelect", - "label": "Schema Fields", - "preRequisiteField": [ - { - "name": "typeOfList", - "selectedValue": "General" - } - ], - "value": "userSchema", - "mode": "multiple", - "options": [ - { - "name": "Email", - "value": "email" - }, - { - "name": "Phone Number", - "value": "phone" - }, - { - "name": "Address Info", - "value": "addressInfo" - } - ], - "defaultOption": { - "name": "Email", - "value": ["email"] + ] + }, + { + "title": "Configuration settings", + "note": "Manage the settings for your destination", + "sections": [ + { + "title": "Destination settings", + "note": "Configure advanced destination-specific settings here", + "icon": "settings", + "groups": [ + { + "title": "Event Settings", + "note": "Configure event-specific settings here", + "fields": [ + { + "type": "singleSelect", + "label": "List Type", + "note": "Select the type of List", + "configKey": "typeOfList", + "options": [ + { + "label": "General", + "value": "General" + }, + { + "label": "User ID", + "value": "userID" + }, + { + "label": "Mobile Device ID", + "value": "mobileDeviceID" + } + ], + "default": "General" + }, + { + "type": "singleSelect", + "label": "Specify the consent for uploaded users for using their data in Google Advertising Purpose", + "configKey": "userDataConsent", + "options": [ + { + "label": "Unspecified", + "value": "UNSPECIFIED" + }, + { + "label": "Unknown", + "value": "UNKNOWN" + }, + { + "label": "Granted", + "value": "GRANTED" + }, + { + "label": "Denied", + "value": "DENIED" + } + ], + "default": "UNSPECIFIED" + }, + { + "type": "singleSelect", + "label": "Specify the consent for uploaded users regarding Ads Personalization", + "configKey": "personalizationConsent", + "options": [ + { + "label": "Unspecified", + "value": "UNSPECIFIED" + }, + { + "label": "Unknown", + "value": "UNKNOWN" + }, + { + "label": "Granted", + "value": "GRANTED" + }, + { + "label": "Denied", + "value": "DENIED" + } + ], + "default": "UNSPECIFIED" + }, + { + "type": "checkbox", + "label": "Hash Required", + "configKey": "isHashRequired", + "default": true + }, + { + "type": "multiSelect", + "label": "Schema Fields", + "preRequisites": [ + { + "configKey": "typeOfList", + "value": "General" + } + ], + "configKey": "userSchema", + "options": [ + { + "label": "Email", + "value": "email" + }, + { + "label": "Phone Number", + "value": "phone" + }, + { + "label": "Address Info", + "value": "addressInfo" + } + ], + "default": ["email"] + } + ] + } + ] + }, + { + "id": "consentSettings", + "title": "Consent settings", + "note": "Configure consent settings for each provider here", + "icon": "settings", + "groups": [] } - } - ] + ] + } + ], + "sdkTemplate": { + "title": "SDK settings", + "note": "not visible in the ui", + "fields": [] }, - { - "title": "Consent Settings", + "consentSettingsTemplate": { + "title": "Consent settings", + "note": "not visible in the ui", "fields": [ { - "type": "dynamicCustomForm", - "value": "oneTrustCookieCategories", - "label": "OneTrust Consent Category IDs", - "footerNote": "The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", - "customFields": [ + "type": "tagInput", + "label": "OneTrust consent category IDs", + "note": "Input your OneTrust category IDs by pressing 'Enter' after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "configKey": "oneTrustCookieCategories", + "tagKey": "oneTrustCookieCategory", + "placeholder": "e.g: C0001", + "default": [ { - "type": "textInput", - "placeholder": "C0001", - "value": "oneTrustCookieCategory", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", - "label": "Category ID", - "required": false + "oneTrustCookieCategory": "" } ], "preRequisites": { @@ -188,17 +249,15 @@ } }, { - "type": "dynamicCustomForm", - "value": "ketchConsentPurposes", - "label": "Ketch Consent Purpose IDs", - "customFields": [ + "type": "tagInput", + "label": "Ketch consent purpose IDs", + "note": "Input your Ketch consent purpose IDs by pressing 'Enter' after each entry.", + "configKey": "ketchConsentPurposes", + "tagKey": "purpose", + "placeholder": "e.g: marketing", + "default": [ { - "type": "textInput", - "placeholder": "marketing", - "value": "purpose", - "label": "Purpose ID", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", - "required": false + "purpose": "" } ], "preRequisites": { @@ -216,45 +275,41 @@ }, { "type": "dynamicCustomForm", - "value": "consentManagement", - "label": "Consent management settings", - "footerNote": "The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", - "customFields": [ + "configKey": "consentManagement", + "default": [], + "rowFields": [ { "type": "singleSelect", "label": "Consent management provider", - "value": "provider", + "configKey": "provider", "options": [ { - "name": "Custom", + "label": "Custom", "value": "custom" }, { - "name": "Ketch", + "label": "Ketch", "value": "ketch" }, { - "name": "OneTrust", + "label": "OneTrust", "value": "oneTrust" } ], - "defaultOption": { - "name": "OneTrust", - "value": "oneTrust" - }, + "default": "oneTrust", "required": true }, { "type": "singleSelect", "label": "the required consent logic", - "value": "resolutionStrategy", + "configKey": "resolutionStrategy", "options": [ { - "name": "AND", + "label": "AND", "value": "and" }, { - "name": "OR", + "label": "OR", "value": "or" } ], @@ -270,16 +325,15 @@ } }, { - "type": "dynamicCustomForm", - "value": "consents", + "type": "tagInput", "label": "Enter consent category ID’s", - "customFields": [ + "note": "Input your consent category IDs by pressing ‘Enter’ after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "configKey": "consents", + "tagKey": "consent", + "placeholder": "e.g: Marketing", + "default": [ { - "type": "textInput", - "placeholder": "Marketing", - "value": "consent", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", - "required": false + "consent": "" } ] } @@ -295,5 +349,5 @@ } ] } - ] + } } From 48aa33a3c5df2ce708ff3b810396235b373f89ea Mon Sep 17 00:00:00 2001 From: sandeepdigumarty Date: Fri, 25 Oct 2024 11:26:46 +0530 Subject: [PATCH 2/5] feat: added schema json --- .../schema.json | 43 +++++++++++++++++++ .../ui-config.json | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/configurations/destinations/google_adwords_remarketing_lists/schema.json b/src/configurations/destinations/google_adwords_remarketing_lists/schema.json index d38780f7a..789335adc 100644 --- a/src/configurations/destinations/google_adwords_remarketing_lists/schema.json +++ b/src/configurations/destinations/google_adwords_remarketing_lists/schema.json @@ -3,6 +3,49 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { + "isHashRequired": { + "type": "boolean", + "default": true + }, + "audienceId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "customerId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "loginCustomerId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "subAccount": { + "type": "boolean", + "default": false + }, + "userSchema": { + "type": "array", + "items": { + "type": "string", + "enum": ["email", "phone", "addressInfo"] + }, + "default": ["email"] + }, + "typeOfList": { + "type": "string", + "enum": ["General", "userID", "mobileDeviceID"], + "default": "General" + }, + "userDataConsent": { + "type": "string", + "enum": ["UNSPECIFIED", "UNKNOWN", "GRANTED", "DENIED"], + "default": "UNSPECIFIED" + }, + "personalizationConsent": { + "type": "string", + "enum": ["UNSPECIFIED", "UNKNOWN", "GRANTED", "DENIED"], + "default": "UNSPECIFIED" + }, "oneTrustCookieCategories": { "type": "object", "properties": { diff --git a/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json b/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json index 795fced24..0972ac4ff 100644 --- a/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json +++ b/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json @@ -49,7 +49,7 @@ "label": "Login Customer ID", "note": "If customer ID is from a sub account, then provide the customer ID of manager account", "configKey": "loginCustomerId", - "regex": "^(.{0,100})$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", "regexErrorMessage": "Invalid Login Customer ID", "preRequisites": { "fields": [ From 9db427da870efdab16e7d4d4eeb40caad17ddb25 Mon Sep 17 00:00:00 2001 From: sandeepdigumarty Date: Fri, 25 Oct 2024 11:42:16 +0530 Subject: [PATCH 3/5] feat: added schema json --- .../google_adwords_remarketing_lists/schema.json | 1 + .../destinations/google_adwords_remarketing_lists.json | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/configurations/destinations/google_adwords_remarketing_lists/schema.json b/src/configurations/destinations/google_adwords_remarketing_lists/schema.json index 789335adc..d18d7fffd 100644 --- a/src/configurations/destinations/google_adwords_remarketing_lists/schema.json +++ b/src/configurations/destinations/google_adwords_remarketing_lists/schema.json @@ -2,6 +2,7 @@ "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", + "required": ["customerId", "subAccount"], "properties": { "isHashRequired": { "type": "boolean", diff --git a/test/data/validation/destinations/google_adwords_remarketing_lists.json b/test/data/validation/destinations/google_adwords_remarketing_lists.json index 5206e4f66..ef18842cd 100644 --- a/test/data/validation/destinations/google_adwords_remarketing_lists.json +++ b/test/data/validation/destinations/google_adwords_remarketing_lists.json @@ -1,6 +1,8 @@ [ { "config": { + "customerId": "dfashethdetyjetyj", + "subAccount": false, "oneTrustCookieCategories": { "cloud": [ { @@ -52,6 +54,8 @@ }, { "config": { + "customerId": "dfashethdetyjetyj", + "subAccount": false, "oneTrustCookieCategories": { "cloud": [], "warehouse": [ @@ -83,6 +87,8 @@ }, { "config": { + "customerId": "dfashethdetyjetyj", + "subAccount": false, "oneTrustCookieCategories": [ { "oneTrustCookieCategory": "C0001" @@ -105,6 +111,8 @@ }, { "config": { + "customerId": "dfashethdetyjetyj", + "subAccount": false, "oneTrustCookieCategories": { "cloud": [ { @@ -164,6 +172,8 @@ }, { "config": { + "customerId": "dfashethdetyjetyj", + "subAccount": false, "oneTrustCookieCategories": { "cloud": [ "not an object", From b8a7a06c65a201bc8ee682878a79b834baf65a83 Mon Sep 17 00:00:00 2001 From: sandeepdigumarty Date: Mon, 28 Oct 2024 10:41:02 +0530 Subject: [PATCH 4/5] chore: removed redundant callout --- .../google_adwords_remarketing_lists/ui-config.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json b/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json index 0972ac4ff..3acfda234 100644 --- a/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json +++ b/src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json @@ -76,11 +76,7 @@ } ], "icon": "sliders", - "fields": [], - "callout": { - "message": "Cloud mode for this destination will be deprecated soon. Please migrate to Facebook Conversions destination for cloud mode.", - "type": "info" - } + "fields": [] } ] } From 063e8fa3d3c9bb34e85deefbeaa67f2a170871a5 Mon Sep 17 00:00:00 2001 From: sandeepdigumarty Date: Mon, 28 Oct 2024 10:45:15 +0530 Subject: [PATCH 5/5] chore: added tests --- .../google_adwords_remarketing_lists.json | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/test/data/validation/destinations/google_adwords_remarketing_lists.json b/test/data/validation/destinations/google_adwords_remarketing_lists.json index ef18842cd..0880fbd1b 100644 --- a/test/data/validation/destinations/google_adwords_remarketing_lists.json +++ b/test/data/validation/destinations/google_adwords_remarketing_lists.json @@ -85,6 +85,73 @@ }, "result": true }, + { + "config": { + "subAccount": false, + "oneTrustCookieCategories": { + "cloud": [], + "warehouse": [ + { + "oneTrustCookieCategory": "env.ENVIRONMENT_VARIABLE" + } + ], + "shopify": [ + { + "oneTrustCookieCategory": "{{ event.properties.prop1 || 'val' }}" + } + ] + }, + "ketchConsentPurposes": { + "cloud": [], + "warehouse": [ + { + "purpose": "env.ENVIRONMENT_VARIABLE" + } + ], + "shopify": [ + { + "purpose": "{{ event.properties.prop1 || 'val' }}" + } + ] + } + }, + "result": false, + "error": [" must have required property 'customerId'"] + }, + { + "config": { + "customerId": "dfashethdetyjetyj", + "subAccount": "fghdertgh", + "oneTrustCookieCategories": { + "cloud": [], + "warehouse": [ + { + "oneTrustCookieCategory": "env.ENVIRONMENT_VARIABLE" + } + ], + "shopify": [ + { + "oneTrustCookieCategory": "{{ event.properties.prop1 || 'val' }}" + } + ] + }, + "ketchConsentPurposes": { + "cloud": [], + "warehouse": [ + { + "purpose": "env.ENVIRONMENT_VARIABLE" + } + ], + "shopify": [ + { + "purpose": "{{ event.properties.prop1 || 'val' }}" + } + ] + } + }, + "result": false, + "error": ["subAccount must be boolean"] + }, { "config": { "customerId": "dfashethdetyjetyj",