Skip to content

Commit

Permalink
feat: custom screen call amplitude (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik authored Nov 13, 2023
1 parent 6b10504 commit c78780e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/configurations/destinations/am/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
"attribution",
"eventUploadThreshold",
"eventUploadPeriodMillis",
"trackNewCampaigns"
"trackNewCampaigns",
"userProvidedScreenEventString",
"useUserDefinedScreenEventName"
],
"excludeKeys": [],
"supportedSourceTypes": [
Expand Down Expand Up @@ -84,7 +86,9 @@
"mapDeviceBrand",
"oneTrustCookieCategories",
"userProvidedPageEventString",
"useUserDefinedPageEventName"
"useUserDefinedPageEventName",
"userProvidedScreenEventString",
"useUserDefinedScreenEventName"
],
"web": [
"useNativeSDK",
Expand Down
5 changes: 5 additions & 0 deletions src/configurations/destinations/am/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
39 changes: 39 additions & 0 deletions src/configurations/destinations/am/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
}
]
}
]
},
Expand Down

0 comments on commit c78780e

Please sign in to comment.