Skip to content

Commit

Permalink
feat: customerio option to send page name (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
anantjain45823 authored Aug 2, 2023
1 parent 4d65441 commit c68062b
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/configurations/destinations/customerio/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"eventFilteringOption",
"oneTrustCookieCategories"
],
"web": ["useNativeSDK"]
"web": ["useNativeSDK", "sendPageNameInSDK"]
},
"secretKeys": []
}
Expand Down
35 changes: 30 additions & 5 deletions src/configurations/destinations/customerio/schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"configSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"required": ["siteID", "apiKey"],
"required": [
"siteID",
"apiKey"
],
"type": "object",
"properties": {
"siteID": {
Expand All @@ -16,11 +19,33 @@
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
},
"datacenterEU": { "type": "boolean", "default": false },
"useNativeSDK": { "type": "object", "properties": { "web": { "type": "boolean" } } },
"datacenterEU": {
"type": "boolean",
"default": false
},
"sendPageNameInSDK": {
"type": "object",
"properties": {
"web": {
"type": "boolean"
}
}
},
"useNativeSDK": {
"type": "object",
"properties": {
"web": {
"type": "boolean"
}
}
},
"eventFilteringOption": {
"type": "string",
"enum": ["disable", "whitelistedEvents", "blacklistedEvents"],
"enum": [
"disable",
"whitelistedEvents",
"blacklistedEvents"
],
"default": "disable"
},
"whitelistedEvents": {
Expand Down Expand Up @@ -61,4 +86,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion src/configurations/destinations/customerio/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
"value": "datacenterEU",
"default": false,
"footerNote": "Turn it ON if you want to send data to EU servers"
},
{
"type": "checkbox",
"label": "Send Page Name in SDK mode",
"value": "sendPageNameInSDK",
"default": true,
"footerNote": "Turn it OFF if you don't want to send the page name when connected in device mode. If OFF page name will automatically be captured by CustomerIo."
}
]
},
Expand Down Expand Up @@ -125,4 +132,4 @@
]
}
]
}
}
143 changes: 119 additions & 24 deletions test/data/validation/destinations/customerio.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,27 @@
"deviceTokenEventName": "device_token_registered",
"datacenterEU": false,
"eventFilteringOption": "disable",
"whitelistedEvents": [{ "eventName": "eventmodel" }],
"blacklistedEvents": [{ "eventName": "taxmodel" }],
"useNativeSDK": { "web": false },
"oneTrustCookieCategories": [{ "oneTrustCookieCategory": "Marketing" }]
"whitelistedEvents": [
{
"eventName": "eventmodel"
}
],
"blacklistedEvents": [
{
"eventName": "taxmodel"
}
],
"useNativeSDK": {
"web": false
},
"sendPageNameInSDK": {
"web": true
},
"oneTrustCookieCategories": [
{
"oneTrustCookieCategory": "Marketing"
}
]
},
"result": true
},
Expand All @@ -19,24 +36,60 @@
"deviceTokenEventName": "device_token_registered",
"datacenterEU": false,
"eventFilteringOption": "whitelistedEvents",
"whitelistedEvents": [{ "eventName": "eventmodel" }],
"blacklistedEvents": [{ "eventName": "taxmodel" }],
"useNativeSDK": { "web": false },
"oneTrustCookieCategories": [{ "oneTrustCookieCategory": "" }]
"whitelistedEvents": [
{
"eventName": "eventmodel"
}
],
"blacklistedEvents": [
{
"eventName": "taxmodel"
}
],
"useNativeSDK": {
"web": false
},
"sendPageNameInSDK": {
"web": false
},
"oneTrustCookieCategories": [
{
"oneTrustCookieCategory": ""
}
]
},
"result": false,
"err": [" must have required property 'siteID'"]
"err": [
" must have required property 'siteID'"
]
},
{
"config": {
"siteID": "95bd1331112976i0ff9b",
"apiKey": "95bd1330072974f0ff9b",
"deviceTokenEventName": "device_location_registered",
"datacenterEU": true,
"whitelistedEvents": [{ "eventName": "practice" }],
"blacklistedEvents": [{ "eventName": "spam_listings" }],
"useNativeSDK": { "web": false },
"oneTrustCookieCategories": [{ "oneTrustCookieCategory": "Sales" }]
"whitelistedEvents": [
{
"eventName": "practice"
}
],
"blacklistedEvents": [
{
"eventName": "spam_listings"
}
],
"useNativeSDK": {
"web": false
},
"sendPageNameInSDK": {
"web": false
},
"oneTrustCookieCategories": [
{
"oneTrustCookieCategory": "Sales"
}
]
},
"result": true
},
Expand All @@ -47,13 +100,35 @@
"deviceTokenEventName": "device_id_removed",
"datacenterEU": false,
"eventFilteringOption": "disable",
"whitelistedEvents": [{ "eventName": ["e1", "v1"] }],
"blacklistedEvents": [{ "eventName": "taxmodel" }],
"useNativeSDK": { "web": false },
"oneTrustCookieCategories": [{ "oneTrustCookieCategory": "Pitch" }]
"whitelistedEvents": [
{
"eventName": [
"e1",
"v1"
]
}
],
"blacklistedEvents": [
{
"eventName": "taxmodel"
}
],
"useNativeSDK": {
"web": false
},
"sendPageNameInSDK": {
"web": true
},
"oneTrustCookieCategories": [
{
"oneTrustCookieCategory": "Pitch"
}
]
},
"result": false,
"err": ["whitelistedEvents.0.eventName must be string"]
"err": [
"whitelistedEvents.0.eventName must be string"
]
},
{
"config": {
Expand All @@ -62,11 +137,22 @@
"deviceTokenEventName": "device_token_registered",
"datacenterEU": "Germany",
"eventFilteringOption": "disable",
"useNativeSDK": { "web": false },
"oneTrustCookieCategories": [{ "oneTrustCookieCategory": "Marketing" }]
"useNativeSDK": {
"web": false
},
"sendPageNameInSDK": {
"web": false
},
"oneTrustCookieCategories": [
{
"oneTrustCookieCategory": "Marketing"
}
]
},
"result": false,
"err": ["datacenterEU must be boolean"]
"err": [
"datacenterEU must be boolean"
]
},
{
"config": {
Expand All @@ -75,12 +161,21 @@
"deviceTokenEventName": "qwsafpmznjhbfjhchdgeiuudhwgvdfkzxuiookaghhrytedhgfgjslalapooiqnbvemixuhevvsjklodjdokhuijghqwnvzxccdwsalkijediwhfwibkjnkji",
"datacenterEU": true,
"eventFilteringOption": "disable",
"useNativeSDK": { "web": false },
"oneTrustCookieCategories": [{ "oneTrustCookieCategory": "Marketing" }]
"useNativeSDK": {
"web": false
},
"sendPageNameInSDK": {
"web": false
},
"oneTrustCookieCategories": [
{
"oneTrustCookieCategory": "Marketing"
}
]
},
"result": false,
"err": [
"deviceTokenEventName must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$\""
]
}
]
]

0 comments on commit c68062b

Please sign in to comment.