From c78780e2be5b3603457ff6c4cd80e027f8a07e04 Mon Sep 17 00:00:00 2001 From: AASHISH MALIK Date: Mon, 13 Nov 2023 13:09:41 +0530 Subject: [PATCH] feat: custom screen call amplitude (#1069) --- .../destinations/am/db-config.json | 8 +++- .../destinations/am/schema.json | 5 +++ .../destinations/am/ui-config.json | 39 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/configurations/destinations/am/db-config.json b/src/configurations/destinations/am/db-config.json index 5b1950dfd..bcbc6bdb2 100644 --- a/src/configurations/destinations/am/db-config.json +++ b/src/configurations/destinations/am/db-config.json @@ -37,7 +37,9 @@ "attribution", "eventUploadThreshold", "eventUploadPeriodMillis", - "trackNewCampaigns" + "trackNewCampaigns", + "userProvidedScreenEventString", + "useUserDefinedScreenEventName" ], "excludeKeys": [], "supportedSourceTypes": [ @@ -84,7 +86,9 @@ "mapDeviceBrand", "oneTrustCookieCategories", "userProvidedPageEventString", - "useUserDefinedPageEventName" + "useUserDefinedPageEventName", + "userProvidedScreenEventString", + "useUserDefinedScreenEventName" ], "web": [ "useNativeSDK", diff --git a/src/configurations/destinations/am/schema.json b/src/configurations/destinations/am/schema.json index acc10ff25..a02e004a6 100644 --- a/src/configurations/destinations/am/schema.json +++ b/src/configurations/destinations/am/schema.json @@ -84,6 +84,11 @@ "mapDeviceBrand": { "type": "boolean", "default": false }, "trackProductsOnce": { "type": "boolean", "default": false }, "trackRevenuePerProduct": { "type": "boolean", "default": false }, + "useUserDefinedScreenEventName": { "type": "boolean", "default": false }, + "userProvidedScreenEventString": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,200})$" + }, "eventFilteringOption": { "type": "string", "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], diff --git a/src/configurations/destinations/am/ui-config.json b/src/configurations/destinations/am/ui-config.json index d7e0dee59..bcb6261af 100644 --- a/src/configurations/destinations/am/ui-config.json +++ b/src/configurations/destinations/am/ui-config.json @@ -176,6 +176,45 @@ } } ] + }, + { + "title": "Screen settings", + "note": "Set how you want to send your screen calls to Amplitude", + "icon": "file", + "fields": [ + { + "type": "checkbox", + "label": "Use Custom Screen Event Name", + "configKey": "useUserDefinedScreenEventName", + "default": false, + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + } + }, + { + "type": "textInput", + "label": "Screen Event Name Format", + "note": "Assign a event name for your screen calls. Text {{ }} will be replaced with event payload value", + "configKey": "userProvidedScreenEventString", + "regex": "^(.{0,200})$", + "regexErrorMessage": "Invalid Screen Event Name", + "placeholder": "e.g: Viewed a {{ name }}", + "secret": false, + "preRequisites": { + "fields": [ + { + "configKey": "useUserDefinedScreenEventName", + "value": true + } + ] + } + } + ] } ] },