From 064360cace855775902ff35b38f36f1e417e09d9 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti Date: Thu, 10 Oct 2024 00:48:20 +0530 Subject: [PATCH 1/6] feat: onboard tune destination --- .../destinations/tune/db-config.json | 71 ++ .../destinations/tune/schema.json | 658 ++++++++++++++++++ .../destinations/tune/ui-config.json | 391 +++++++++++ test/data/validation/destinations/tune.json | 154 ++++ 4 files changed, 1274 insertions(+) create mode 100644 src/configurations/destinations/tune/db-config.json create mode 100644 src/configurations/destinations/tune/schema.json create mode 100644 src/configurations/destinations/tune/ui-config.json create mode 100644 test/data/validation/destinations/tune.json diff --git a/src/configurations/destinations/tune/db-config.json b/src/configurations/destinations/tune/db-config.json new file mode 100644 index 000000000..efa57c7e6 --- /dev/null +++ b/src/configurations/destinations/tune/db-config.json @@ -0,0 +1,71 @@ +{ + "name": "TUNE", + "displayName": "Tune", + "config": { + "cdkV2Enabled": true, + "transformAtV1": "router", + "saveDestinationResponse": true, + "includeKeys": [ + "url", + "eventName", + "eventsMapping", + "oneTrustCookieCategories", + "blacklistedEvents", + "whitelistedEvents", + "eventFilteringOption", + "consentManagement" + ], + "excludeKeys": [], + "supportedSourceTypes": [ + "android", + "ios", + "unity", + "amp", + "web", + "cloud", + "warehouse", + "reactnative", + "flutter", + "cordova", + "shopify" + ], + "supportedMessageTypes": { "cloud": ["track"] }, + "supportedConnectionModes": { + "android": ["cloud"], + "ios": ["cloud"], + "web": ["cloud"], + "unity": ["cloud"], + "amp": ["cloud"], + "reactnative": ["cloud"], + "flutter": ["cloud"], + "cordova": ["cloud"], + "shopify": ["cloud"], + "cloud": ["cloud"], + "warehouse": ["cloud"] + }, + "destConfig": { + "defaultConfig": [ + "url", + "eventName", + "eventsMapping", + "blacklistedEvents", + "whitelistedEvents", + "eventFilteringOption", + "oneTrustCookieCategories" + ], + "android": ["connectionMode", "consentManagement"], + "ios": ["connectionMode", "consentManagement"], + "web": ["connectionMode", "consentManagement"], + "unity": ["connectionMode", "consentManagement"], + "amp": ["connectionMode", "consentManagement"], + "cloud": ["connectionMode", "consentManagement"], + "warehouse": ["connectionMode", "consentManagement"], + "reactnative": ["connectionMode", "consentManagement"], + "flutter": ["connectionMode", "consentManagement"], + "cordova": ["connectionMode", "consentManagement"], + "shopify": ["connectionMode", "consentManagement"] + }, + "secretKeys": [] + }, + "options": { "isBeta": true } +} diff --git a/src/configurations/destinations/tune/schema.json b/src/configurations/destinations/tune/schema.json new file mode 100644 index 000000000..9e8d00fcd --- /dev/null +++ b/src/configurations/destinations/tune/schema.json @@ -0,0 +1,658 @@ +{ + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "required": [], + "type": "object", + "properties": { + "url": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$|^$" + }, + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "eventsMapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "from": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "to": { + "type": "string", + "enum": [ + "adv_sub", + "adv_sub2", + "adv_sub3", + "adv_sub4", + "adv_sub5", + "adv_unique1", + "adv_unique2", + "adv_unique3", + "adv_unique4", + "adv_unique5", + "aff_id", + "promo_code", + "amount", + "conversion_unique_id", + "goal_id", + "goal_ref", + "offer_id", + "payout", + "revenue", + "security_token", + "status", + "transaction_id", + "" + ] + } + } + } + }, + "eventFilteringOption": { + "type": "string", + "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "default": "disable" + }, + "whitelistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "blacklistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "oneTrustCookieCategories": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "consentManagement": { + "type": "object", + "properties": { + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "shopify": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + } + } + }, + "connectionMode": { + "type": "object", + "properties": { + "android": { + "type": "string", + "enum": ["cloud"] + }, + "ios": { + "type": "string", + "enum": ["cloud"] + }, + "web": { + "type": "string", + "enum": ["cloud"] + }, + "unity": { + "type": "string", + "enum": ["cloud"] + }, + "amp": { + "type": "string", + "enum": ["cloud"] + }, + "reactnative": { + "type": "string", + "enum": ["cloud"] + }, + "flutter": { + "type": "string", + "enum": ["cloud"] + }, + "cordova": { + "type": "string", + "enum": ["cloud"] + }, + "shopify": { + "type": "string", + "enum": ["cloud"] + }, + "cloud": { + "type": "string", + "enum": ["cloud"] + }, + "warehouse": { + "type": "string", + "enum": ["cloud"] + } + } + } + } + } +} diff --git a/src/configurations/destinations/tune/ui-config.json b/src/configurations/destinations/tune/ui-config.json new file mode 100644 index 000000000..bc7c803f0 --- /dev/null +++ b/src/configurations/destinations/tune/ui-config.json @@ -0,0 +1,391 @@ +{ + "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": [] + } + ] + }, + { + "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": [] + } + ] + } + ] + }, + { + "title": "Configuration settings", + "note": "Manage the settings for your destination", + "sections": [ + { + "title": "Other settings", + "note": "Configure advanced RudderStack features here", + "icon": "otherSettings", + "groups": [ + { + "title": "Client-side event filtering", + "note": "Decide what events are allowed (allowlisting) and blocked (denylisting)", + "preRequisites": { + "fields": [ + { + "configKey": "connectionMode.web", + "value": "cloud" + } + ], + "condition": "or" + }, + "fields": [ + { + "type": "singleSelect", + "label": "Choose if you want to turn on events filtering:", + "configKey": "eventFilteringOption", + "note": "You must select either allowlist or denylist to enable events filtering", + "options": [ + { + "label": "No events filtering", + "value": "disable" + }, + { + "label": "Filter via allowlist", + "value": "whitelistedEvents" + }, + { + "label": "Filter via denylist", + "value": "blacklistedEvents" + } + ], + "default": "disable" + }, + { + "type": "tagInput", + "label": "Allowlisted events", + "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to allowlist.", + "configKey": "whitelistedEvents", + "tagKey": "eventName", + "placeholder": "e.g: Anonymous page visit", + "default": [ + { + "eventName": "" + } + ], + "preRequisites": { + "fields": [ + { + "configKey": "eventFilteringOption", + "value": "whitelistedEvents" + } + ] + } + }, + { + "type": "tagInput", + "label": "Denylisted events", + "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to denylist. ", + "configKey": "blacklistedEvents", + "tagKey": "eventName", + "placeholder": "e.g: Anonymous page visit", + "default": [ + { + "eventName": "" + } + ], + "preRequisites": { + "fields": [ + { + "configKey": "eventFilteringOption", + "value": "blacklistedEvents" + } + ] + } + } + ] + } + ] + } + ] + }, + { + "title": "Event mapping", + "note": "Map RudderStack events to Tune events", + "hideEditIcon": true, + "sections": [ + { + "groups": [ + { + "title": "RudderStack Event to Tune Event Mapping", + "fields": [ + { + "type": "redirect", + "redirectGroupKey": "conversionMapping", + "label": "Event and property mappings", + "note": "Map RudderStack events/properties to Tune events/properties" + } + ] + } + ] + } + ] + } + ], + "sdkTemplate": { + "title": "SDK settings", + "note": "not visible in the ui", + "fields": [] + }, + "redirectGroups": { + "conversionMapping": { + "fields": [ + { + "type": "dynamicCustomForm", + "label": "Map RudderStack event to Tune event", + "configKey": "tuneEvents", + "default": [ + { + "rsField": "Purchase Event", + "destField": "purchase", + "eventProperties": [ + { + "from": "advSub", + "to": "adv_sub" + }, + { + "from": "advSub2", + "to": "adv_sub2" + }, + { + "from": "advSub3", + "to": "adv_sub3" + }, + { + "from": "advSub4", + "to": "adv_sub4" + }, + { + "from": "advSub5", + "to": "adv_sub5" + }, + { + "from": "advUnique1", + "to": "adv_unique1" + }, + { + "from": "advUnique2", + "to": "adv_unique2" + }, + { + "from": "advUnique3", + "to": "adv_unique3" + }, + { + "from": "advUnique4", + "to": "adv_unique4" + }, + { + "from": "advUnique5", + "to": "adv_unique5" + }, + { + "from": "affId", + "to": "aff_id" + }, + { + "from": "promoCode", + "to": "promo_code" + }, + { + "from": "amount", + "to": "amount" + }, + { + "from": "conversionUniqueId", + "to": "conversion_unique_id" + }, + { + "from": "goalId", + "to": "goal_id" + }, + { + "from": "goalRef", + "to": "goal_ref" + }, + { + "from": "offerId", + "to": "offer_id" + }, + { + "from": "payout", + "to": "payout" + }, + { + "from": "revenue", + "to": "revenue" + }, + { + "from": "securityToken", + "to": "security_token" + }, + { + "from": "status", + "to": "status" + }, + { + "from": "transactionId", + "to": "transaction_id" + } + ] + } + ], + "rowFields": [ + { + "type": "textInput", + "label": "URL", + "configKey": "url", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$|^$", + "regexErrorMessage": "Invalid URL", + "placeholder": "e.g. https://demo.go2cloud.org/aff_l?offer_id=45&aff_id=1029" + }, + { + "type": "textInput", + "label": "Event name", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "configKey": "eventName", + "placeholder": "e.g: Product Added" + }, + { + "label": "Map Rudder payload property to Tune Field", + "type": "mapping", + "configKey": "eventsMapping", + "columns": [ + { + "type": "textInput", + "key": "from", + "configKey": "rsField", + "label": "Rudder Payload Field", + "placeholder": "e.g: Purchase Event" + }, + { + "type": "singleSelect", + "key": "to", + "label": "Tune Custom Field", + "configKey": "destField", + "placeholder": "e.g: purchase", + "options": [ + { + "name": "adv_sub", + "value": "adv_sub" + }, + { + "name": "adv_sub2", + "value": "adv_sub2" + }, + { + "name": "adv_sub3", + "value": "adv_sub3" + }, + { + "name": "adv_sub4", + "value": "adv_sub4" + }, + { + "name": "adv_sub5", + "value": "adv_sub5" + }, + { + "name": "adv_unique1", + "value": "adv_unique1" + }, + { + "name": "adv_unique2", + "value": "adv_unique2" + }, + { + "name": "adv_unique3", + "value": "adv_unique3" + }, + { + "name": "adv_unique4", + "value": "adv_unique4" + }, + { + "name": "adv_unique5", + "value": "adv_unique5" + }, + { + "name": "aff_id", + "value": "aff_id" + }, + { + "name": "promo_code", + "value": "promo_code" + }, + { + "name": "amount", + "value": "amount" + }, + { + "name": "conversion_unique_id", + "value": "conversion_unique_id" + }, + { + "name": "goal_id", + "value": "goal_id" + }, + { + "name": "goal_ref", + "value": "goal_ref" + }, + { + "name": "offer_id", + "value": "offer_id" + }, + { + "name": "payout", + "value": "payout" + }, + { + "name": "revenue", + "value": "revenue" + }, + { + "name": "security_token", + "value": "security_token" + }, + { + "name": "status", + "value": "status" + }, + { + "name": "transaction_id", + "value": "transaction_id" + } + ] + } + ] + } + ] + } + ] + } + } + } +} diff --git a/test/data/validation/destinations/tune.json b/test/data/validation/destinations/tune.json new file mode 100644 index 000000000..aa33f4291 --- /dev/null +++ b/test/data/validation/destinations/tune.json @@ -0,0 +1,154 @@ +[ + { + "config": { + "connectionMode": { + "web": "cloud" + }, + "consentManagement": {}, + "tuneEvents": [ + { + "url": "https://abc.com", + "eventName": "Product added", + "eventsMapping": [ + { + "from": "Purchase", + "to": "adv_sub5" + } + ] + } + ] + }, + "result": true + }, + { + "config": { + "connectionMode": { + "web": "cloud" + }, + "consentManagement": {}, + "tuneEvents": [ + { + "url": "https://demo.com", + "eventName": "Order completed", + "eventsMapping": [ + { + "from": "Order1", + "to": "adv_unique1" + } + ] + }, + { + "url": "https://abc.com", + "eventName": "Product added", + "eventsMapping": [ + { + "from": "Purchase", + "to": "adv_sub5" + }, + { + "from": "Purchase2", + "to": "revenue" + } + ] + } + ] + }, + "result": true + }, + { + "config": { + "connectionMode": { + "web": "abc" + }, + "consentManagement": {}, + "tuneEvents": [ + { + "url": "https://demo.com", + "eventName": "Product added", + "eventsMapping": [ + { + "from": "Purchase", + "to": "adv_sub1" + } + ] + } + ] + }, + "result": false, + "err": ["connectionMode.web must be equal to one of the allowed values"] + }, + { + "config": { + "connectionMode": { + "web": "device" + }, + "consentManagement": {}, + "tuneEvents": [ + { + "url": "https://demo.com", + "eventName": "Product added", + "eventsMapping": [ + { + "from": "Purchase", + "to": "adv_sub1" + } + ] + } + ] + }, + "result": false, + "err": ["connectionMode.web must be equal to one of the allowed values"] + }, + { + "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", + "config": { + "advertiserId": "12345", + "consentManagement": { + "android": [ + { + "provider": "custom", + "resolutionStrategy": "nor" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0.resolutionStrategy must be equal to one of the allowed values", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config and no resolutionStrategy value", + "config": { + "advertiserId": "12345", + "consentManagement": { + "android": [ + { + "provider": "custom" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0 must have required property 'resolutionStrategy'", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config invalid provider value", + "config": { + "advertiserId": "12345", + "consentManagement": { + "android": [ + { + "provider": "dummyProvider" + } + ] + } + }, + "result": false, + "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] + } +] From 96b2b7f74f8360ee2e054d288ee93b683dca8a02 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti Date: Thu, 10 Oct 2024 17:43:51 +0530 Subject: [PATCH 2/6] chore: updated default mappings --- .../destinations/tune/ui-config.json | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/src/configurations/destinations/tune/ui-config.json b/src/configurations/destinations/tune/ui-config.json index bc7c803f0..61d8fed8f 100644 --- a/src/configurations/destinations/tune/ui-config.json +++ b/src/configurations/destinations/tune/ui-config.json @@ -159,11 +159,27 @@ "type": "dynamicCustomForm", "label": "Map RudderStack event to Tune event", "configKey": "tuneEvents", - "default": [ + "rowFields": [ { - "rsField": "Purchase Event", - "destField": "purchase", - "eventProperties": [ + "type": "textInput", + "label": "URL", + "configKey": "url", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$|^$", + "regexErrorMessage": "Invalid URL", + "placeholder": "e.g. https://demo.go2cloud.org/aff_l?offer_id=45&aff_id=1029" + }, + { + "type": "textInput", + "label": "Event name", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "configKey": "eventName", + "placeholder": "e.g: Product Added" + }, + { + "label": "Map Rudder payload property to Tune Field", + "type": "mapping", + "configKey": "eventsMapping", + "default": [ { "from": "advSub", "to": "adv_sub" @@ -252,29 +268,7 @@ "from": "transactionId", "to": "transaction_id" } - ] - } - ], - "rowFields": [ - { - "type": "textInput", - "label": "URL", - "configKey": "url", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$|^$", - "regexErrorMessage": "Invalid URL", - "placeholder": "e.g. https://demo.go2cloud.org/aff_l?offer_id=45&aff_id=1029" - }, - { - "type": "textInput", - "label": "Event name", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", - "configKey": "eventName", - "placeholder": "e.g: Product Added" - }, - { - "label": "Map Rudder payload property to Tune Field", - "type": "mapping", - "configKey": "eventsMapping", + ], "columns": [ { "type": "textInput", From 507873521c09bd460ab6de49dea1790291a63c2d Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti Date: Mon, 14 Oct 2024 17:03:35 +0530 Subject: [PATCH 3/6] chore: format updated --- .../destinations/tune/db-config.json | 88 ++++-- .../destinations/tune/schema.json | 298 ++++++++++++++++-- .../destinations/tune/ui-config.json | 218 ++++++++----- 3 files changed, 469 insertions(+), 135 deletions(-) diff --git a/src/configurations/destinations/tune/db-config.json b/src/configurations/destinations/tune/db-config.json index efa57c7e6..57c64b524 100644 --- a/src/configurations/destinations/tune/db-config.json +++ b/src/configurations/destinations/tune/db-config.json @@ -10,9 +10,6 @@ "eventName", "eventsMapping", "oneTrustCookieCategories", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", "consentManagement" ], "excludeKeys": [], @@ -44,26 +41,73 @@ "warehouse": ["cloud"] }, "destConfig": { - "defaultConfig": [ - "url", - "eventName", - "eventsMapping", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories" + "defaultConfig": ["url", "eventName", "eventsMapping"], + "android": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" ], - "android": ["connectionMode", "consentManagement"], - "ios": ["connectionMode", "consentManagement"], - "web": ["connectionMode", "consentManagement"], - "unity": ["connectionMode", "consentManagement"], - "amp": ["connectionMode", "consentManagement"], - "cloud": ["connectionMode", "consentManagement"], - "warehouse": ["connectionMode", "consentManagement"], - "reactnative": ["connectionMode", "consentManagement"], - "flutter": ["connectionMode", "consentManagement"], - "cordova": ["connectionMode", "consentManagement"], - "shopify": ["connectionMode", "consentManagement"] + "ios": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "unity": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "amp": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "reactnative": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "flutter": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "cordova": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "web": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "cloud": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "shopify": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "warehouse": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ] }, "secretKeys": [] }, diff --git a/src/configurations/destinations/tune/schema.json b/src/configurations/destinations/tune/schema.json index 9e8d00fcd..dbb24bd3d 100644 --- a/src/configurations/destinations/tune/schema.json +++ b/src/configurations/destinations/tune/schema.json @@ -57,38 +57,139 @@ "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], "default": "disable" }, - "whitelistedEvents": { - "type": "array", - "items": { - "type": "object", - "properties": { - "eventName": { - "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + "oneTrustCookieCategories": { + "type": "object", + "properties": { + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } } - } - } - }, - "blacklistedEvents": { - "type": "array", - "items": { - "type": "object", - "properties": { - "eventName": { - "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } } - } - } - }, - "oneTrustCookieCategories": { - "type": "array", - "items": { - "type": "object", - "properties": { - "oneTrustCookieCategory": { - "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "shopify": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } } } } @@ -604,6 +705,143 @@ } } }, + "ketchConsentPurposes": { + "type": "object", + "properties": { + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "shopify": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + } + }, "connectionMode": { "type": "object", "properties": { diff --git a/src/configurations/destinations/tune/ui-config.json b/src/configurations/destinations/tune/ui-config.json index 61d8fed8f..73227da46 100644 --- a/src/configurations/destinations/tune/ui-config.json +++ b/src/configurations/destinations/tune/ui-config.json @@ -38,89 +38,11 @@ "note": "Manage the settings for your destination", "sections": [ { - "title": "Other settings", - "note": "Configure advanced RudderStack features here", - "icon": "otherSettings", - "groups": [ - { - "title": "Client-side event filtering", - "note": "Decide what events are allowed (allowlisting) and blocked (denylisting)", - "preRequisites": { - "fields": [ - { - "configKey": "connectionMode.web", - "value": "cloud" - } - ], - "condition": "or" - }, - "fields": [ - { - "type": "singleSelect", - "label": "Choose if you want to turn on events filtering:", - "configKey": "eventFilteringOption", - "note": "You must select either allowlist or denylist to enable events filtering", - "options": [ - { - "label": "No events filtering", - "value": "disable" - }, - { - "label": "Filter via allowlist", - "value": "whitelistedEvents" - }, - { - "label": "Filter via denylist", - "value": "blacklistedEvents" - } - ], - "default": "disable" - }, - { - "type": "tagInput", - "label": "Allowlisted events", - "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to allowlist.", - "configKey": "whitelistedEvents", - "tagKey": "eventName", - "placeholder": "e.g: Anonymous page visit", - "default": [ - { - "eventName": "" - } - ], - "preRequisites": { - "fields": [ - { - "configKey": "eventFilteringOption", - "value": "whitelistedEvents" - } - ] - } - }, - { - "type": "tagInput", - "label": "Denylisted events", - "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to denylist. ", - "configKey": "blacklistedEvents", - "tagKey": "eventName", - "placeholder": "e.g: Anonymous page visit", - "default": [ - { - "eventName": "" - } - ], - "preRequisites": { - "fields": [ - { - "configKey": "eventFilteringOption", - "value": "blacklistedEvents" - } - ] - } - } - ] - } - ] + "id": "consentSettings", + "title": "Consent settings", + "note": "Configure consent settings for each provider here", + "icon": "settings", + "groups": [] } ] }, @@ -380,6 +302,136 @@ } ] } + }, + "consentSettingsTemplate": { + "title": "Consent settings", + "note": "not visible in the ui", + "fields": [ + { + "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": [ + { + "oneTrustCookieCategory": "" + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "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": [ + { + "purpose": "" + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "dynamicCustomForm", + "configKey": "consentManagement", + "default": [], + "rowFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "configKey": "provider", + "options": [ + { + "label": "Custom", + "value": "custom" + }, + { + "label": "Ketch", + "value": "ketch" + }, + { + "label": "OneTrust", + "value": "oneTrust" + } + ], + "default": "oneTrust", + "required": true + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "configKey": "resolutionStrategy", + "options": [ + { + "label": "AND", + "value": "and" + }, + { + "label": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "tagInput", + "label": "Enter consent category ID’s", + "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": [ + { + "consent": "" + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } + } + ] } } } From db4e5ce7d8504702e3278683313381c9b6d5a274 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti Date: Tue, 15 Oct 2024 17:44:14 +0530 Subject: [PATCH 4/6] chore: updated Ui --- .../destinations/tune/db-config.json | 9 +- .../destinations/tune/schema.json | 47 +++-- .../destinations/tune/ui-config.json | 170 +++++++++--------- test/data/validation/destinations/tune.json | 135 +++++++++++--- 4 files changed, 224 insertions(+), 137 deletions(-) diff --git a/src/configurations/destinations/tune/db-config.json b/src/configurations/destinations/tune/db-config.json index 57c64b524..1a04ff4eb 100644 --- a/src/configurations/destinations/tune/db-config.json +++ b/src/configurations/destinations/tune/db-config.json @@ -5,13 +5,6 @@ "cdkV2Enabled": true, "transformAtV1": "router", "saveDestinationResponse": true, - "includeKeys": [ - "url", - "eventName", - "eventsMapping", - "oneTrustCookieCategories", - "consentManagement" - ], "excludeKeys": [], "supportedSourceTypes": [ "android", @@ -41,7 +34,7 @@ "warehouse": ["cloud"] }, "destConfig": { - "defaultConfig": ["url", "eventName", "eventsMapping"], + "defaultConfig": ["tuneEvents"], "android": [ "connectionMode", "consentManagement", diff --git a/src/configurations/destinations/tune/schema.json b/src/configurations/destinations/tune/schema.json index dbb24bd3d..fc1293606 100644 --- a/src/configurations/destinations/tune/schema.json +++ b/src/configurations/destinations/tune/schema.json @@ -12,7 +12,7 @@ "type": "string", "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" }, - "eventsMapping": { + "standardMapping": { "type": "array", "items": { "type": "object", @@ -24,16 +24,6 @@ "to": { "type": "string", "enum": [ - "adv_sub", - "adv_sub2", - "adv_sub3", - "adv_sub4", - "adv_sub5", - "adv_unique1", - "adv_unique2", - "adv_unique3", - "adv_unique4", - "adv_unique5", "aff_id", "promo_code", "amount", @@ -52,10 +42,37 @@ } } }, - "eventFilteringOption": { - "type": "string", - "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], - "default": "disable" + "advSubIdMapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "from": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "to": { + "type": "string", + "enum": ["adv_sub", "adv_sub2", "adv_sub3", "adv_sub4", "adv_sub5"] + } + } + } + }, + "advUniqueIdMapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "from": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "to": { + "type": "string", + "enum": ["adv_unique1", "adv_unique2", "adv_unique3", "adv_unique4", "adv_unique5"] + } + } + } }, "oneTrustCookieCategories": { "type": "object", diff --git a/src/configurations/destinations/tune/ui-config.json b/src/configurations/destinations/tune/ui-config.json index 73227da46..d2f7815fa 100644 --- a/src/configurations/destinations/tune/ui-config.json +++ b/src/configurations/destinations/tune/ui-config.json @@ -98,50 +98,10 @@ "placeholder": "e.g: Product Added" }, { - "label": "Map Rudder payload property to Tune Field", + "label": "Map Rudder properties to Tune properties", "type": "mapping", - "configKey": "eventsMapping", + "configKey": "standardMapping", "default": [ - { - "from": "advSub", - "to": "adv_sub" - }, - { - "from": "advSub2", - "to": "adv_sub2" - }, - { - "from": "advSub3", - "to": "adv_sub3" - }, - { - "from": "advSub4", - "to": "adv_sub4" - }, - { - "from": "advSub5", - "to": "adv_sub5" - }, - { - "from": "advUnique1", - "to": "adv_unique1" - }, - { - "from": "advUnique2", - "to": "adv_unique2" - }, - { - "from": "advUnique3", - "to": "adv_unique3" - }, - { - "from": "advUnique4", - "to": "adv_unique4" - }, - { - "from": "advUnique5", - "to": "adv_unique5" - }, { "from": "affId", "to": "aff_id" @@ -195,57 +155,15 @@ { "type": "textInput", "key": "from", - "configKey": "rsField", "label": "Rudder Payload Field", "placeholder": "e.g: Purchase Event" }, { "type": "singleSelect", "key": "to", - "label": "Tune Custom Field", - "configKey": "destField", + "label": "Tune Field", "placeholder": "e.g: purchase", "options": [ - { - "name": "adv_sub", - "value": "adv_sub" - }, - { - "name": "adv_sub2", - "value": "adv_sub2" - }, - { - "name": "adv_sub3", - "value": "adv_sub3" - }, - { - "name": "adv_sub4", - "value": "adv_sub4" - }, - { - "name": "adv_sub5", - "value": "adv_sub5" - }, - { - "name": "adv_unique1", - "value": "adv_unique1" - }, - { - "name": "adv_unique2", - "value": "adv_unique2" - }, - { - "name": "adv_unique3", - "value": "adv_unique3" - }, - { - "name": "adv_unique4", - "value": "adv_unique4" - }, - { - "name": "adv_unique5", - "value": "adv_unique5" - }, { "name": "aff_id", "value": "aff_id" @@ -297,6 +215,88 @@ ] } ] + }, + { + "label": "Map Rudder properties to Tune Advertiser Sub Ids", + "type": "mapping", + "configKey": "advSubIdMapping", + "columns": [ + { + "type": "textInput", + "key": "from", + "label": "Rudder Payload Field", + "placeholder": "e.g: Purchase Event" + }, + { + "type": "singleSelect", + "key": "to", + "label": "Tune Field", + "placeholder": "e.g: purchase", + "options": [ + { + "name": "adv_sub", + "value": "adv_sub" + }, + { + "name": "adv_sub2", + "value": "adv_sub2" + }, + { + "name": "adv_sub3", + "value": "adv_sub3" + }, + { + "name": "adv_sub4", + "value": "adv_sub4" + }, + { + "name": "adv_sub5", + "value": "adv_sub5" + } + ] + } + ] + }, + { + "label": "Map Rudder properties to Tune Advertiser Unique Ids", + "type": "mapping", + "configKey": "advUniqueIdMapping", + "columns": [ + { + "type": "textInput", + "key": "from", + "label": "Rudder Payload Field", + "placeholder": "e.g: Purchase Event" + }, + { + "type": "singleSelect", + "key": "to", + "label": "Tune Field", + "placeholder": "e.g: purchase", + "options": [ + { + "name": "adv_unique1", + "value": "adv_unique1" + }, + { + "name": "adv_unique2", + "value": "adv_unique2" + }, + { + "name": "adv_unique3", + "value": "adv_unique3" + }, + { + "name": "adv_unique4", + "value": "adv_unique4" + }, + { + "name": "adv_unique5", + "value": "adv_unique5" + } + ] + } + ] } ] } diff --git a/test/data/validation/destinations/tune.json b/test/data/validation/destinations/tune.json index aa33f4291..30695bd15 100644 --- a/test/data/validation/destinations/tune.json +++ b/test/data/validation/destinations/tune.json @@ -5,14 +5,32 @@ "web": "cloud" }, "consentManagement": {}, + "oneTrustCookieCategories": {}, + "ketchConsentPurposes": {}, "tuneEvents": [ { - "url": "https://abc.com", - "eventName": "Product added", - "eventsMapping": [ + "url": "https://demo.com", + "eventName": "product added", + "standardMapping": [ + { + "to": "aff_id", + "from": "affId" + }, + { + "to": "transaction_id", + "from": "transactionId" + } + ], + "advSubIdMapping": [ + { + "from": "purchase event", + "to": "adv_sub2" + } + ], + "advUniqueIdMapping": [ { - "from": "Purchase", - "to": "adv_sub5" + "from": "oder completed", + "to": "adv_unique3" } ] } @@ -26,28 +44,54 @@ "web": "cloud" }, "consentManagement": {}, + "oneTrustCookieCategories": {}, + "ketchConsentPurposes": {}, "tuneEvents": [ { "url": "https://demo.com", - "eventName": "Order completed", - "eventsMapping": [ + "eventName": "product added", + "standardMapping": [ { - "from": "Order1", - "to": "adv_unique1" + "to": "aff_id", + "from": "affId" + }, + { + "to": "transaction_id", + "from": "transactionId" + } + ], + "advSubIdMapping": [ + { + "from": "purchase event", + "to": "adv_sub2" + } + ], + "advUniqueIdMapping": [ + { + "from": "oder completed", + "to": "adv_unique3" } ] }, { - "url": "https://abc.com", - "eventName": "Product added", - "eventsMapping": [ + "url": "https://demo11.com", + "eventName": "order completed", + "standardMapping": [ { - "from": "Purchase", - "to": "adv_sub5" - }, + "to": "aff_id", + "from": "affId" + } + ], + "advSubIdMapping": [ { - "from": "Purchase2", - "to": "revenue" + "from": "purchase event", + "to": "adv_sub2" + } + ], + "advUniqueIdMapping": [ + { + "from": "oder completed", + "to": "adv_unique3" } ] } @@ -61,14 +105,32 @@ "web": "abc" }, "consentManagement": {}, + "oneTrustCookieCategories": {}, + "ketchConsentPurposes": {}, "tuneEvents": [ { "url": "https://demo.com", - "eventName": "Product added", - "eventsMapping": [ + "eventName": "product added", + "standardMapping": [ + { + "to": "aff_id", + "from": "affId" + }, + { + "to": "transaction_id", + "from": "transactionId" + } + ], + "advSubIdMapping": [ + { + "from": "purchase event", + "to": "adv_sub2" + } + ], + "advUniqueIdMapping": [ { - "from": "Purchase", - "to": "adv_sub1" + "from": "oder completed", + "to": "adv_unique3" } ] } @@ -83,14 +145,28 @@ "web": "device" }, "consentManagement": {}, + "oneTrustCookieCategories": {}, + "ketchConsentPurposes": {}, "tuneEvents": [ { "url": "https://demo.com", - "eventName": "Product added", - "eventsMapping": [ + "eventName": "product added", + "standardMapping": [ + { + "to": "aff_id", + "from": "affId" + } + ], + "advSubIdMapping": [ { - "from": "Purchase", - "to": "adv_sub1" + "from": "purchase event", + "to": "adv_sub2" + } + ], + "advUniqueIdMapping": [ + { + "from": "oder completed", + "to": "adv_unique3" } ] } @@ -102,7 +178,6 @@ { "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", "config": { - "advertiserId": "12345", "consentManagement": { "android": [ { @@ -121,7 +196,6 @@ { "testTitle": "With consent management custom provider config and no resolutionStrategy value", "config": { - "advertiserId": "12345", "consentManagement": { "android": [ { @@ -130,6 +204,8 @@ ] } }, + "oneTrustCookieCategories": {}, + "ketchConsentPurposes": {}, "result": false, "err": [ "consentManagement.android.0 must have required property 'resolutionStrategy'", @@ -139,14 +215,15 @@ { "testTitle": "With consent management custom provider config invalid provider value", "config": { - "advertiserId": "12345", "consentManagement": { "android": [ { "provider": "dummyProvider" } ] - } + }, + "oneTrustCookieCategories": {}, + "ketchConsentPurposes": {} }, "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] From dd941a66e7f5bbc17e4c92122e023fa0ad944459 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti Date: Tue, 22 Oct 2024 13:08:51 +0530 Subject: [PATCH 5/6] chore: minor fix --- src/configurations/destinations/tune/db-config.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/configurations/destinations/tune/db-config.json b/src/configurations/destinations/tune/db-config.json index 1a04ff4eb..e018d0ac5 100644 --- a/src/configurations/destinations/tune/db-config.json +++ b/src/configurations/destinations/tune/db-config.json @@ -2,8 +2,7 @@ "name": "TUNE", "displayName": "Tune", "config": { - "cdkV2Enabled": true, - "transformAtV1": "router", + "transformAtV1": "processor", "saveDestinationResponse": true, "excludeKeys": [], "supportedSourceTypes": [ From 9dfe9797f6316c336cf54137816329a0e56dfdd7 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti Date: Tue, 22 Oct 2024 13:55:45 +0530 Subject: [PATCH 6/6] chore: minor fix --- src/configurations/destinations/tune/schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/configurations/destinations/tune/schema.json b/src/configurations/destinations/tune/schema.json index fc1293606..1938f3053 100644 --- a/src/configurations/destinations/tune/schema.json +++ b/src/configurations/destinations/tune/schema.json @@ -35,8 +35,7 @@ "revenue", "security_token", "status", - "transaction_id", - "" + "transaction_id" ] } }