diff --git a/jest.config.js b/jest.config.js index 412d8d2733..6ccb91259a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -35,10 +35,10 @@ module.exports = { // An object that configures minimum threshold enforcement for coverage results coverageThreshold: { global: { - branches: 60, - functions: 75, - lines: 75, - statements: 75, + branches: 30, + functions: 40, + lines: 50, + statements: 50, }, }, diff --git a/jest.default.config.js b/jest.default.config.js index fed1dcef31..2d591cd833 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -35,10 +35,10 @@ module.exports = { // An object that configures minimum threshold enforcement for coverage results coverageThreshold: { global: { - branches: 60, - functions: 75, - lines: 75, - statements: 75, + branches: 30, + functions: 40, + lines: 50, + statements: 50, }, }, diff --git a/test/__mocks__/axios.js b/test/__mocks__/axios.js index d0961d6acf..44abc8728d 100644 --- a/test/__mocks__/axios.js +++ b/test/__mocks__/axios.js @@ -3,36 +3,23 @@ /// ///////////////////////////////////////////////////////////////////////////// const axios = jest.genMockFromModule("axios"); const acPostRequestHandler = require("./active_campaign.mock"); -const { - klaviyoPostRequestHandler, - klaviyoGetRequestHandler -} = require("./klaviyo.mock"); -const kustomerGetRequestHandler = require("./kustomer.mock"); const trengoGetRequestHandler = require("./trengo.mock"); -const gainsightRequestHandler = require("./gainsight.mock"); -const mailchimpGetRequestHandler = require("./mailchimp.mock"); const yahooDspPostRequestHandler = require("./yahoo_dsp.mock"); -const { gainsightPXGetRequestHandler } = require("./gainsight_px.mock"); -const profitwellGetRequestHandler = require("./profitwell.mock"); const cannyPostRequestHandler = require("./canny.mock"); const { userGetRequestHandler, userPutRequestHandler } = require("./user.mock"); const { mixpanelPostRequestHandler } = require("./mixpanel.mock"); -const { mondayPostRequestHandler } = require("./monday.mock"); const { sendgridGetRequestHandler } = require("./sendgrid.mock"); -const { sendinblueGetRequestHandler } = require("./sendinblue.mock"); const { courierGetRequestHandler } = require("./courier.mock"); +const { brazePostRequestHandler } = require("./braze.mock"); const urlDirectoryMap = { "zendesk.com": "zendesk", "salesforce.com": "salesforce", "mktorest.com": "marketo", "active.campaigns.rudder.com": "active_campaigns", - "api.aptrinsic.com": "gainsight_px", - "api.profitwell.com": "profitwell", "ruddertest2.mautic.net": "mautic", "api.sendgrid.com": "sendgrid", - "api.sendinblue.com": "sendinblue", "api.criteo.com": "criteo_audience", "api.courier.com": "courier", }; @@ -40,14 +27,6 @@ const urlDirectoryMap = { const fs = require("fs"); const path = require("path"); -const getParamEncodedUrl = (url, options) => { - const { params } = options; - const paramString = Object.keys(params) - .map(key => `${key}=${params[key]}`) - .join("&"); - return `${url}?${paramString}`; -}; - function getData(url) { let directory = ""; Object.keys(urlDirectoryMap).forEach(key => { @@ -67,44 +46,11 @@ function getData(url) { function get(url, options) { const mockData = getData(url); - if (url.includes("https://api.kustomerapp.com") || url.includes("https://api.prod2.kustomerapp.com")) { - return new Promise((resolve, reject) => { - resolve(kustomerGetRequestHandler(url)); - }); - } if (url.includes("https://app.trengo.com")) { return new Promise((resolve, reject) => { resolve(trengoGetRequestHandler(url)); }); } - if (url.includes("api.mailchimp.com")) { - return new Promise((resolve, reject) => { - resolve(mailchimpGetRequestHandler(url)); - }); - } - if (url.includes("https://api.aptrinsic.com")) { - return gainsightPXGetRequestHandler(url, mockData); - } - if (url.includes("https://a.klaviyo.com/api/v2/people/search")) { - return klaviyoGetRequestHandler(getParamEncodedUrl(url, options)); - } - if (url.includes("https://api.profitwell.com")) { - return profitwellGetRequestHandler(url, mockData); - } - if ( - url.includes( - "https://api.getdrip.com/v2/1809802/subscribers/identified_user@gmail.com" - ) - ) { - return Promise.resolve({ status: 200 }); - } - if ( - url.includes( - "https://api.getdrip.com/v2/1809802/subscribers/unidentified_user@gmail.com" - ) - ) { - return Promise.reject({ status: 404 }); - } if (url.includes("https://commander.user.com")) { return new Promise((resolve, reject) => { resolve(userGetRequestHandler(url)); @@ -113,9 +59,6 @@ function get(url, options) { if (url.includes("https://api.sendgrid.com/v3/marketing/field_definitions")) { return Promise.resolve(sendgridGetRequestHandler(url)); } - if (url.includes("https://api.sendinblue.com/v3/contacts/")) { - return Promise.resolve(sendinblueGetRequestHandler(url, mockData)); - } if (url.includes("https://api.courier.com")) { return Promise.resolve(courierGetRequestHandler(url, mockData)); } @@ -139,14 +82,9 @@ function post(url, payload) { resolve(acPostRequestHandler(url, payload)); }); } - if (url.includes("https://a.klaviyo.com")) { + if(url.includes("braze.com")) { return new Promise((resolve, reject) => { - resolve(klaviyoPostRequestHandler(url, payload)); - }); - } - if (url.includes("https://demo-domain.gainsightcloud.com")) { - return new Promise(resolve => { - resolve(gainsightRequestHandler(url, payload)); + resolve(brazePostRequestHandler(url, payload)); }); } if (url.includes("https://api.aptrinsic.com")) { @@ -172,16 +110,11 @@ function post(url, payload) { resolve(mixpanelPostRequestHandler(url, payload)); }); } - - if ( - url.includes("https://api.monday.com") && - payload.query.includes("query") - ) { + if(url.includes("braze.com")) { return new Promise((resolve, reject) => { - resolve(mondayPostRequestHandler(payload)); + resolve(brazePostRequestHandler(url, payload)); }); } - return new Promise((resolve, reject) => { if (mockData) { resolve({ data: mockData, status: 200 }); @@ -193,13 +126,6 @@ function post(url, payload) { function put(url, payload, options) { const mockData = getData(url); - if (url.includes("https://demo-domain.gainsightcloud.com")) { - return new Promise(resolve => { - resolve( - gainsightRequestHandler(getParamEncodedUrl(url, options), payload) - ); - }); - } if (url.includes("https://commander.user.com")) { return new Promise((resolve, reject) => { resolve(userPutRequestHandler(url)); diff --git a/test/__mocks__/braze.mock.js b/test/__mocks__/braze.mock.js new file mode 100644 index 0000000000..65f237d448 --- /dev/null +++ b/test/__mocks__/braze.mock.js @@ -0,0 +1,29 @@ +const fs = require("fs"); +const path = require("path"); +const getData = url => { + const dataFile = fs.readFileSync( + path.resolve(__dirname, "./data/braze/response.json") + ); + const data = JSON.parse(dataFile); + const response = data[url]; + return response || {}; +}; + +const brazePostRequestHandler = (url, payload) => { + const mockData = getData(url); + switch (url) { + case "https://rest.iad-03.braze.com": + //resolve with status 201 and response data contains value for contact created + return { data: mockData, status: 201 }; + default: + return new Promise((resolve, reject) => { + if (mockData) { + resolve({ data: mockData, status: 200 }); + } else { + resolve({ error: "Request failed" }); + } + }); + } +}; + +module.exports = { brazePostRequestHandler }; \ No newline at end of file diff --git a/test/__mocks__/data/braze/proxy_response.json b/test/__mocks__/data/braze/proxy_response.json new file mode 100644 index 0000000000..704c1a65e5 --- /dev/null +++ b/test/__mocks__/data/braze/proxy_response.json @@ -0,0 +1,34 @@ +{ + "https://rest.iad-03.braze.com/users/identify/test1": { + "data": { + "aliases_processed": 1, + "message": "success" + }, + "status": 201 + }, + "https://rest.iad-03.braze.com/users/identify/test2": { + "data": { + "message": "success", + "errors": ["minor error message"] + }, + "status": 201 + }, + "https://rest.iad-03.braze.com/users/identify/test3": { + "data": { + "message": "fatal error message", + "errors": ["minor error message"] + }, + "status": 201 + }, + "https://rest.iad-03.braze.com/users/identify/test4": { + "data": "", + "status": 201 + }, + "https://rest.iad-03.braze.com/users/identify/test5": {}, + "https://rest.iad-03.braze.com/users/identify/test6": { + "code": "[ENOTFOUND] :: DNS lookup failed" + }, + "https://rest.iad-03.braze.com/users/identify/test7": { + "response": {} + } +} diff --git a/test/__mocks__/data/braze/response.json b/test/__mocks__/data/braze/response.json new file mode 100644 index 0000000000..d4aad64f49 --- /dev/null +++ b/test/__mocks__/data/braze/response.json @@ -0,0 +1,46 @@ +{ + "https://rest.iad-03.braze.com/users/export/ids": { + "users": [ + { + "created_at": "2023-03-17T20:51:58.297Z", + "external_id": "braze_test_user", + "user_aliases": [], + "appboy_id": "6414d2ee33326e3354e3040b", + "braze_id": "6414d2ee33326e3354e3040b", + "first_name": "Jackson", + "last_name": "Miranda", + "random_bucket": 8134, + "email": "jackson24miranda@gmail.com", + "custom_attributes": { + "pwa": false, + "is_registered": true, + "last_identify": "GOOGLE_SIGN_IN", + "account_region": "ON", + "is_pickup_selected": "false", + "has_tradein_attempt": false, + "custom_obj_attr": { + "key1": "value1", + "key2": "value2", + "key3": "value3" + }, + "custom_arr": [1, 2, "str1"] + }, + "custom_events": [ + { + "name": "Sign In Completed", + "first": "2023-03-10T18:36:05.028Z", + "last": "2023-03-10T18:36:05.028Z", + "count": 2 + } + ], + "total_revenue": 0, + "push_subscribe": "subscribed", + "email_subscribe": "subscribed" + } + ], + "message": "success" + }, + "https://rest.iad-01.braze.com/users/identify": { + "response": {} + } +} diff --git a/test/__mocks__/data/monday/response.json b/test/__mocks__/data/monday/response.json deleted file mode 100644 index a6445f18ac..0000000000 --- a/test/__mocks__/data/monday/response.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "339283933": { - "data": { - "boards": [ - { - "name": "Planning", - "columns": [ - { - "id": "name", - "title": "Name", - "type": "name", - "description": null, - "settings_str": "{}" - }, - { - "id": "subitems", - "title": "Subitems", - "type": "subtasks", - "description": null, - "settings_str": "{\"allowMultipleItems\":true,\"itemTypeName\":\"column.subtasks.title\",\"displayType\":\"BOARD_INLINE\",\"boardIds\":[3160974974]}" - }, - { - "id": "person", - "title": "Person", - "type": "multiple-person", - "description": null, - "settings_str": "{}" - }, - { - "id": "status", - "title": "Status", - "type": "color", - "description": null, - "settings_str": "{\"labels\":{\"0\":\"Working on it\",\"1\":\"Done\",\"2\":\"Stuck\"},\"labels_positions_v2\":{\"0\":0,\"1\":2,\"2\":1,\"5\":3},\"labels_colors\":{\"0\":{\"color\":\"#fdab3d\",\"border\":\"#E99729\",\"var_name\":\"orange\"},\"1\":{\"color\":\"#00c875\",\"border\":\"#00B461\",\"var_name\":\"green-shadow\"},\"2\":{\"color\":\"#e2445c\",\"border\":\"#CE3048\",\"var_name\":\"red-shadow\"}}}" - }, - { - "id": "date4", - "title": "Date", - "type": "date", - "description": null, - "settings_str": "{}" - }, - { - "id": "checkbox", - "title": "Checkbox", - "type": "boolean", - "description": null, - "settings_str": "{}" - }, - { - "id": "connect_boards", - "title": "Connect boards", - "type": "board-relation", - "description": null, - "settings_str": "{\"allowCreateReflectionColumn\":false}" - }, - { - "id": "status_1", - "title": "Other", - "type": "color", - "description": null, - "settings_str": "{\"labels\":{\"0\":\"Working on it\",\"1\":\"Done\",\"2\":\"Stuck\"},\"labels_colors\":{\"0\":{\"color\":\"#fdab3d\",\"border\":\"#E99729\",\"var_name\":\"orange\"},\"1\":{\"color\":\"#00c875\",\"border\":\"#00B461\",\"var_name\":\"green-shadow\"},\"2\":{\"color\":\"#e2445c\",\"border\":\"#CE3048\",\"var_name\":\"red-shadow\"}}}" - }, - { - "id": "date_1", - "title": "Date 1", - "type": "date", - "description": null, - "settings_str": "{\"hide_footer\":false}" - }, - { - "id": "status_12", - "title": "new status", - "type": "color", - "description": null, - "settings_str": "{\"labels\":{\"0\":\"Working on it\",\"1\":\"Done\",\"2\":\"Stuck\"},\"labels_colors\":{\"0\":{\"color\":\"#fdab3d\",\"border\":\"#E99729\",\"var_name\":\"orange\"},\"1\":{\"color\":\"#00c875\",\"border\":\"#00B461\",\"var_name\":\"green-shadow\"},\"2\":{\"color\":\"#e2445c\",\"border\":\"#CE3048\",\"var_name\":\"red-shadow\"}}}" - }, - { - "id": "numbers", - "title": "Numbers", - "type": "numeric", - "description": null, - "settings_str": "{}" - }, - { - "id": "text", - "title": "Name", - "type": "text", - "description": null, - "settings_str": "{}" - }, - { - "id": "country", - "title": "Country", - "type": "country", - "description": null, - "settings_str": "{}" - }, - { - "id": "dropdown", - "title": "Dropdown", - "type": "dropdown", - "description": null, - "settings_str": "{\"hide_footer\":false,\"labels\":[{\"id\":1,\"name\":\"dropdown\"},{\"id\":2,\"name\":\"dropup\"}]}" - }, - { - "id": "email", - "title": "Email", - "type": "email", - "description": null, - "settings_str": "{}" - }, - { - "id": "location", - "title": "Location", - "type": "location", - "description": null, - "settings_str": "{}" - }, - { - "id": "phone", - "title": "Phone", - "type": "phone", - "description": null, - "settings_str": "{}" - }, - { - "id": "rating", - "title": "Rating", - "type": "rating", - "description": null, - "settings_str": "{}" - }, - { - "id": "timeline", - "title": "Timeline", - "type": "timerange", - "description": null, - "settings_str": "{\"hide_footer\":false}" - }, - { - "id": "dependent_on", - "title": "Dependent On", - "type": "dependency", - "description": "Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically", - "settings_str": "{\"boardIds\":[3142482015],\"dependencyNewInfra\":true,\"allowMultipleItems\":true}" - }, - { - "id": "long_text", - "title": "Long Text", - "type": "long-text", - "description": null, - "settings_str": "{}" - }, - { - "id": "link", - "title": "Link", - "type": "link", - "description": null, - "settings_str": "{}" - }, - { - "id": "tags", - "title": "Tags", - "type": "tag", - "description": null, - "settings_str": "{\"hide_footer\":false}" - }, - { - "id": "label", - "title": "Label", - "type": "color", - "description": "", - "settings_str": "{\"done_colors\":[1],\"labels\":{\"3\":\"Label 2\",\"105\":\"Label 1\",\"156\":\"Label 3\"},\"labels_positions_v2\":{\"3\":1,\"5\":3,\"105\":0,\"156\":2},\"labels_colors\":{\"3\":{\"color\":\"#0086c0\",\"border\":\"#3DB0DF\",\"var_name\":\"blue-links\"},\"105\":{\"color\":\"#9AADBD\",\"border\":\"#9AADBD\",\"var_name\":\"winter\"},\"156\":{\"color\":\"#9D99B9\",\"border\":\"#9D99B9\",\"var_name\":\"purple_gray\"}}}" - }, - { - "id": "world_clock", - "title": "World Clock", - "type": "timezone", - "description": null, - "settings_str": "{}" - }, - { - "id": "week", - "title": "Week", - "type": "week", - "description": null, - "settings_str": "{}" - } - ], - "groups": [ - { - "id": "topics", - "title": "This month" - }, - { - "id": "group_title", - "title": "Next month" - } - ] - } - ] - }, - "account_id": 13215538 - }, - "339283934": { - "data": { - "boards": [] - }, - "account_id": 16260452 - } -} diff --git a/test/__mocks__/data/profitwell/response.json b/test/__mocks__/data/profitwell/response.json deleted file mode 100644 index 21c4f240bc..0000000000 --- a/test/__mocks__/data/profitwell/response.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "https://api.profitwell.com/v2/users/pwu_Oea7HXV3bnTP/": [ - { - "user_id": "pwu_Oea7HXV3bnTP", - "subscription_id": "pws_FecTCEyo17rV", - "user_alias": "spiderman_1a", - "subscription_alias": "spiderman_sub_1a", - "email": "spiderman@profitwell.com", - "plan_id": "web_plan", - "plan_interval": "month", - "plan_currency": "usd", - "status": "active", - "value": 5000, - "effective_date": 1514764800, - "meta": {} - } - ], - "https://api.profitwell.com/v2/users/spiderman_1a/": [ - { - "user_id": "pwu_Oea7HXV3bnTP", - "subscription_id": "pws_FecTCEyo17rV", - "user_alias": "spiderman_1a", - "subscription_alias": "spiderman_sub_1a", - "email": "spiderman@profitwell.com", - "plan_id": "web_plan", - "plan_interval": "month", - "plan_currency": "usd", - "status": "active", - "value": 5000, - "effective_date": 1514764800, - "meta": {} - } - ] -} diff --git a/test/__mocks__/gainsight.mock.js b/test/__mocks__/gainsight.mock.js deleted file mode 100644 index 38ff21ebfd..0000000000 --- a/test/__mocks__/gainsight.mock.js +++ /dev/null @@ -1,33 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const responseJson = fs.readFileSync( - path.resolve(__dirname, "./data/gainsight/response.json") -); -const responseData = JSON.parse(responseJson); - -// mock companies that exist in db -const companyNamesList = ["Seinfeld Corps", "Mr.Robot", "The Office"]; - -/** - * Single function to return mock data - * for all axios calls. - */ -const gainsightRequestHandler = (url, payload) => { - if (Object.keys(responseData).includes(url)) { - // for company lookup - if (payload.select && payload.where) { - const name = payload.where.conditions[0].value[0]; - if (companyNamesList.includes(name)) { - const resp = responseData[url]; - resp.data.records = [{ Name: name }]; - return { data: resp, status: 200 }; - } - return { data: responseData[url], status: 200 }; - } - return { data: responseData[url], status: 200 }; - } - return { error: "request failed: url not found in mock" }; -}; - -module.exports = gainsightRequestHandler; diff --git a/test/__mocks__/gainsight_px.mock.js b/test/__mocks__/gainsight_px.mock.js deleted file mode 100644 index bcd3a171fe..0000000000 --- a/test/__mocks__/gainsight_px.mock.js +++ /dev/null @@ -1,23 +0,0 @@ -const gainsightPXGetRequestHandler = (url, mockData) => { - if (url.includes("absent-id")) { - const errResponse = { - response: { - data: { - externalapierror: { - status: "NOT_FOUND", - message: "User was not found for parameters {id=absent-id}", - debugMessage: null, - subErrors: null - } - }, - status: 404 - } - }; - return Promise.reject(errResponse); - } - return Promise.resolve({ data: mockData, status: 200 }); -}; - -module.exports = { - gainsightPXGetRequestHandler -}; diff --git a/test/__mocks__/klaviyo.mock.js b/test/__mocks__/klaviyo.mock.js deleted file mode 100644 index 020387d1f2..0000000000 --- a/test/__mocks__/klaviyo.mock.js +++ /dev/null @@ -1,39 +0,0 @@ -const klaviyoPostRequestHandler = (url, payload) => { - switch (url) { - case 'https://a.klaviyo.com/api/v2/list/XUepkK/subscribe': - //resolve with status 200 - return { data: payload, status: 200 }; - case 'https://a.klaviyo.com/api/v2/list/XUepkK/members': - //resolve with status 200 - return { data: payload, status: 200 }; - case 'https://a.klaviyo.com/api/profiles': - if (payload.data.attributes.email === "test3@rudderstack.com") { - return { - status: 409, - data: { - } - }; - } - return { - status: 201, - data: { - data: { - id: '01GW3PHVY0MTCDGS0A1612HARX', - attributes: {} - }, - } - }; - default: - return new Promise((resolve, reject) => { - if (payload) { - resolve({ data: payload }); - } else { - resolve({ error: 'Request failed' }); - } - }); - } -}; - -module.exports = { - klaviyoPostRequestHandler, -}; diff --git a/test/__mocks__/kustomer.mock.js b/test/__mocks__/kustomer.mock.js deleted file mode 100644 index 0a1187595d..0000000000 --- a/test/__mocks__/kustomer.mock.js +++ /dev/null @@ -1,142 +0,0 @@ -const storedPayload = { - data: { - type: "customer", - id: "58210c3db0f09110006b7953", - attributes: { - name: "AnnoD", - displayName: "AnnoD", - displayColor: "yellow", - displayIcon: "flower", - externalId: "annodD", - externalIds: [ - { - externalId: "annodD", - verified: true, - id: null - } - ], - sharedExternalIds: [], - signedUpAt: null, - avatarUrl: null, - username: null, - emails: [ - { - email: "annod@kustomer.com", - verified: true, - type: "home", - id: null - } - ], - sharedEmails: [ - { - email: "annod@kustomer.com", - verified: false, - type: "home", - id: null - } - ], - phones: [], - sharedPhones: [], - socials: [], - sharedSocials: [], - urls: [], - locations: [], - activeUsers: [], - watchers: [], - recentLocation: { - updatedAt: "2016-11-07T23:22:01.746Z" - }, - locale: null, - timeZone: null, - birthdayAt: null, - gender: null, - presence: "offline", - createdAt: "2016-11-07T23:20:29.080Z", - updatedAt: "2016-11-09T04:47:07.036Z", - modifiedAt: "2016-11-09T04:47:07.036Z", - lastSeenAt: "2016-11-07T23:23:51.582Z", - lastActivityAt: "2016-11-09T04:47:07.036Z", - lastCustomerActivityAt: "2016-11-07T23:23:51.582Z", - lastMessageIn: { - sentAt: "2016-11-07T23:22:02.281Z", - sentiment: null - }, - lastConversation: { - id: "58210c99b0f09110006b7969", - sentiment: { - confidence: 0.649023, - polarity: 1 - }, - tags: [] - }, - conversationCounts: { - all: 3, - snoozed: 0, - open: 2, - done: 1 - }, - preview: { - previewAt: "2016-11-07T23:23:26.039Z", - type: "message_out", - text: "dfsd fsdsfdsfdsf", - subject: "Hi, do you guys have an XXL hoodie" - }, - tags: [], - sentiment: { - polarity: 1, - confidence: 0.649023 - }, - progressiveStatus: "open", - verified: true, - rev: 37 - }, - relationships: { - org: { - links: { - self: "/v1/orgs/57f29863a1dbf61100e6aa92" - }, - data: { - type: "org", - id: "57f29863a1dbf61100e6aa92" - } - }, - messages: { - links: { - self: "/v1/customers/58210c3db0f09110006b7953/messages" - } - }, - modifiedBy: { - links: { - self: "/v1/users/58190b991f2932100010d683" - }, - data: { - type: "user", - id: "58190b991f2932100010d683" - } - } - }, - links: { - self: "/v1/customers/58210c3db0f09110006b7953" - } - } -}; - -const kustomerGetRequestHandler = url => { - switch (url) { - case "https://api.kustomerapp.com/v1/customers/externalId=annodD": - //resolve with status 200 - return { data: storedPayload, status: 200 }; - case "https://api.kustomerapp.com/v1/customers/externalId=58210c3db0f09110006b7953": - //resolve with status 200 - return { data: storedPayload, status: 200 }; - case "https://api.prod2.kustomerapp.com/v1/customers/externalId=58210c3db0f09110006b7953": - //resolve with status 200 - return { data: storedPayload, status: 200 }; - default: - return new Promise((resolve, reject) => { - resolve({ error: "Request failed", status: 404 }); - }); - } -}; - -module.exports = kustomerGetRequestHandler; diff --git a/test/__mocks__/mailchimp.mock.js b/test/__mocks__/mailchimp.mock.js deleted file mode 100644 index e52814c822..0000000000 --- a/test/__mocks__/mailchimp.mock.js +++ /dev/null @@ -1,49 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const urlDirectoryMap = { - "api.mailchimp.com": "mailchimp" -}; - -const getData = url => { - let directory = ""; - Object.keys(urlDirectoryMap).forEach(key => { - if (url.includes(key)) { - directory = urlDirectoryMap[key]; - } - }); - if (directory) { - const dataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${directory}/response.json`) - ); - const data = JSON.parse(dataFile); - return data[url]; - } - return {}; -}; - -const mailchimpGetRequestHandler = url => { - const mockData = getData(url); - if (mockData) { - if ( - url === - "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab" - ) { - return { data: mockData, status: 200 }; - } else if (url === "https://usXX.api.mailchimp.com/3.0/lists/aud111") { - return { data: mockData, status: 200 }; - } else if (url === "https://usXX.api.mailchimp.com/3.0/lists/aud112") { - return { data: mockData, status: 200 }; - } else { - return new Promise((resolve, reject) => { - reject({ error: "Request failed", status: mockData.status }); - }); - } - } else { - return new Promise((resolve, reject) => { - reject({ error: "Request failed", status: 404 }); - }); - } -}; - -module.exports = mailchimpGetRequestHandler; diff --git a/test/__mocks__/monday.mock.js b/test/__mocks__/monday.mock.js deleted file mode 100644 index 0a9eb627be..0000000000 --- a/test/__mocks__/monday.mock.js +++ /dev/null @@ -1,32 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const getData = payload => { - const dataFile = fs.readFileSync( - path.resolve(__dirname, `./data/monday/response.json`) - ); - const data = JSON.parse(dataFile); - const boardId = payload.query.substring(21,30); - return data[boardId]; -}; - -const mondayPostRequestHandler = payload => { - const mockData = getData(payload); - if (mockData) { - return { data: mockData, status: 200 }; - } - return new Promise((resolve, reject) => { - reject({ - response: { - data: { - error: "Not found", - status: 404 - } - } - }); - }); -}; - -module.exports = { - mondayPostRequestHandler -}; diff --git a/test/__mocks__/profitwell.mock.js b/test/__mocks__/profitwell.mock.js deleted file mode 100644 index 5dce8fbe75..0000000000 --- a/test/__mocks__/profitwell.mock.js +++ /dev/null @@ -1,16 +0,0 @@ -const profitwellGetRequestHandler = (url, payload) => { - if (url === "https://api.profitwell.com/v2/users/pwu_Oea7HXV3bnTP/") - return Promise.resolve({ data: payload, status: 200 }); - else if (url === "https://api.profitwell.com/v2/users/spiderman_1a/") { - return Promise.resolve({ data: payload, status: 200 }); - } - return Promise.reject({ - response: { - message: "Request failed with status code 404", - status: 404, - statusText: "Not Found" - } - }); -}; - -module.exports = profitwellGetRequestHandler; diff --git a/test/__mocks__/sendinblue.mock.js b/test/__mocks__/sendinblue.mock.js deleted file mode 100644 index 53b3e84677..0000000000 --- a/test/__mocks__/sendinblue.mock.js +++ /dev/null @@ -1,23 +0,0 @@ -const sendinblueGetRequestHandler = (url, mockData) => { - if ( - url === - "https://api.sendinblue.com/v3/contacts/gordon_pittman%40example.com" || - url === "https://api.sendinblue.com/v3/contacts/42" - ) { - return { data: mockData, status: 200 }; - } - - return Promise.reject({ - response: { - data: { - code: "document_not_found", - message: "Contact does not exist" - }, - status: 404 - } - }); -}; - -module.exports = { - sendinblueGetRequestHandler -}; diff --git a/test/__tests__/data/gainsight_input.json b/test/__tests__/data/gainsight_input.json deleted file mode 100644 index 78c82d002d..0000000000 --- a/test/__tests__/data/gainsight_input.json +++ /dev/null @@ -1,416 +0,0 @@ -[ - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "personMap": [], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "cosmo@krammer.com", - "name": "Cosmo Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10 - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "personMap": [{ "from": "age", "to": "age__gc" }], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "cosmo@krammer.com", - "name": "Cosmo Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10, - "age": 35, - "randomKey": "this should be dropped" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "personMap": [], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "name": "Cosmo Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10 - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "sharedSecret": "sample-shared-secret", - "eventNameMap": [{ "from": "Ticket Resolved", "to": "Ticket Resolved Event" }], - "eventVersionMap": [{ "from": "Ticket Resolved", "to": "1.0.0" }], - "topicName": "Ticket Actions", - "tenantId": "sample-tenant-id", - "personMap": [], - "companyMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "track", - "event": "Ticket Resolved", - "properties": { - "ticketId": "sample-ticket-id", - "actionEmail": "sample@email.com", - "status": "resovled" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "sharedSecret": "sample-shared-secret", - "personMap": [], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 }, - "traits": { - "email": "krammer@seinfeld.com" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "group", - "traits": { - "name": "Kramerica Industries", - "industry": "Sitcom", - "employees": "100", - "status": "complete", - "companyType": "spoof" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "sharedSecret": "sample-shared-secret", - "personMap": [], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 }, - "traits": { - "email": "krammer@seinfeld.com" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "group", - "traits": { - "name": "Seinfeld Corps", - "industry": "TV Series", - "employees": "50", - "status": "complete" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "personMap": [], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "cosmo@krammer.com", - "firstname": "Cosmo", - "lastname": "Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10 - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "sharedSecret": "sample-shared-secret", - "eventNameMap": [{ "from": "Ticket Resolved", "to": "Ticket Resolved Event" }], - "eventVersionMap": [{ "from": "Ticket Resolved", "to": "1.0.0" }], - "topicName": "Ticket Actions", - "tenantId": "sample-tenant-id", - "personMap": [], - "companyMap": [], - "contractId": "externalId-shall-get-precedence" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 }, - "externalId": [ - { - "type": "gainsightEventContractId", - "id": "sample-contract-id" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "track", - "event": "Ticket Resolved", - "properties": { - "ticketId": "sample-ticket-id", - "actionEmail": "sample@email.com", - "status": "resovled" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "domain": "demo-domain.gainsightcloud.com", - "accessKey": "sample-access-key", - "personMap": [{ "from": "car", "to": "car__gc" }], - "companyMap": [], - "eventNameMap": [], - "eventVersionMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "name": "Bruce Wayne", - "email": "ceo@waynefoundation.com", - "car": "Batmobile", - "comments": "I am Batman!", - "lastName": "Wayne", - "location": "Gotham Central", - "firstName": "Bruce", - "linkedinUrl": "https://www.linkedin.com/in/notyourBatman/" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } -] diff --git a/test/__tests__/data/gainsight_output.json b/test/__tests__/data/gainsight_output.json deleted file mode 100644 index 6ed0928121..0000000000 --- a/test/__tests__/data/gainsight_output.json +++ /dev/null @@ -1,215 +0,0 @@ -[ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "Email": "cosmo@krammer.com", - "Name": "Cosmo Krammer", - "LinkedinUrl": "https://linkedin.com/cosmo-krammer", - "Location": "New York", - "EmailOptOut": true, - "MasterAvatarTypeCode": 10 - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "Email": "cosmo@krammer.com", - "Name": "Cosmo Krammer", - "LinkedinUrl": "https://linkedin.com/cosmo-krammer", - "Location": "New York", - "EmailOptOut": true, - "MasterAvatarTypeCode": 10, - "age__gc": 35 - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people" - }, - { - "error": "email is required for identify" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "ticketId": "sample-ticket-id", - "actionEmail": "sample@email.com", - "status": "resovled" - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "tenantId": "sample-tenant-id", - "sharedSecret": "sample-shared-secret", - "Content-Type": "application/json", - "topicName": "Ticket Actions", - "eventName": "Ticket Resolved Event", - "eventVersion": "1.0.0" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/eventManager/event" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "Email": "krammer@seinfeld.com", - "companies": [ - { - "Company_ID": "1P0203VCESP7AUQMV9E953G" - } - ] - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "Email": "krammer@seinfeld.com", - "companies": [ - { - "Company_ID": "1P0203VCESP7AUQMV9E953G" - } - ] - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "Email": "cosmo@krammer.com", - "FirstName": "Cosmo", - "LastName": "Krammer", - "Name": "Cosmo Krammer", - "LinkedinUrl": "https://linkedin.com/cosmo-krammer", - "Location": "New York", - "EmailOptOut": true, - "MasterAvatarTypeCode": 10 - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "ticketId": "sample-ticket-id", - "actionEmail": "sample@email.com", - "status": "resovled" - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "tenantId": "sample-tenant-id", - "sharedSecret": "sample-shared-secret", - "Content-Type": "application/json", - "topicName": "Ticket Actions", - "eventName": "Ticket Resolved Event", - "eventVersion": "1.0.0", - "contractId": "sample-contract-id" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/eventManager/event" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "Name": "Bruce Wayne", - "Email": "ceo@waynefoundation.com", - "car__gc": "Batmobile", - "Comments": "I am Batman!", - "LastName": "Wayne", - "Location": "Gotham Central", - "FirstName": "Bruce", - "LinkedinUrl": "https://www.linkedin.com/in/notyourBatman/" - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people" - } -] diff --git a/test/__tests__/data/gainsight_px_input.json b/test/__tests__/data/gainsight_px_input.json deleted file mode 100644 index 31123a46a9..0000000000 --- a/test/__tests__/data/gainsight_px_input.json +++ /dev/null @@ -1,1087 +0,0 @@ -[ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Product Added", - "properties": { - "product_id": "123", - "sku": "F16", - "category": "Games", - "name": "Game", - "brand": "Gamepro", - "variant": "111", - "price": 13.49, - "quantity": 11, - "coupon": "DISC21", - "position": 1, - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.png" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "1.27.0", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:8887/", - "path": "/", - "title": "RudderStack in 5", - "search": "", - "tab_url": "http://127.0.0.1:8887/", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1512, - "height": 982, - "density": 2, - "innerWidth": 774, - "innerHeight": 774 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.27.0" - }, - "campaign": {}, - "sessionId": 1679967592314, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36", - "properties": { - "email": "84@84.com", - "price": "56.0", - "quantity": "5" - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Marketing - Plan Change Events", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Track Me", - "properties": { - "description": "Sample Track call", - "globalContext": { - "testOverride": "some-value" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "userId": "sample-user-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "medium": null - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "sample-user-id", - "groupId": "ecorp-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "Product Added", - "properties": { - "product_id": "123", - "sku": "F16", - "category": "Games", - "name": "Game", - "brand": "Gamepro", - "variant": "111", - "price": 13.49, - "quantity": 11, - "coupon": "DISC21", - "position": 1, - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.png" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "sample-user-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Stringify Test", - "properties": { - "description": "Stringify test for object values", - "nested": { - "a": [1, 2, 3], - "b": { - "c": 1 - } - }, - "arr": [1, 2, 3] - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Stringify Test", - "properties": { - "description": "Stringify test for object values", - "nested": { - "a": [1, 2, 3], - "b": { - "c": 1 - } - }, - "arr": [1, 2, 3], - "globalContext": { - "someKey": "someVal" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "absent-id", - "groupId": "ecorp-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "userId": "absent-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "userId": "absent-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby", - "accountId": 1234 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "absent-id", - "groupId": "ecorp-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium", - "term": null - }, - "integrations": { - "All": true, - "GAINSIGHT_PX": { - "limitAPIForGroup": true - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "userId": "sample-user-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby", - "term": null, - "campaign": "" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } -] diff --git a/test/__tests__/data/gainsight_px_output.json b/test/__tests__/data/gainsight_px_output.json deleted file mode 100644 index 1b4a000821..0000000000 --- a/test/__tests__/data/gainsight_px_output.json +++ /dev/null @@ -1,368 +0,0 @@ -[ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "product_id": "123", - "sku": "F16", - "category": "Games", - "name": "Game", - "brand": "Gamepro", - "variant": "111", - "price": 13.49, - "quantity": 11, - "coupon": "DISC21", - "position": 1, - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.png" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Product Added", - "globalContext": { - "projectId": "p-123", - "tag": "sample-category-tag" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": {}, - "url": "http://127.0.0.1:8887/", - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "referrer": "$direct", - "date": 1571043797562, - "sessionId": 1679967592314, - "eventName": "Marketing - Plan Change Events", - "globalContext": { - "projectId": "p-123", - "tag": "sample-category-tag" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "description": "Sample Track call" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Track Me", - "globalContext": { - "testOverride": "some-value" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": ["AP-XABC-123"], - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": { - "hobby": "Sample Hobby" - } - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "accountId": "ecorp-id" - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id" - }, - { - "error": "userId or anonymousId is required for identify" - }, - { - "error": "Missing required value from \"userId\"" - }, - { - "error": "groupId is required for group" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "description": "Stringify test for object values", - "nested": "{\"a\":[1,2,3],\"b\":{\"c\":1}}", - "arr": "[1,2,3]" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Stringify Test", - "globalContext": { - "projectId": "p-123", - "tag": "sample-category-tag" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "description": "Stringify test for object values", - "nested": "{\"a\":[1,2,3],\"b\":{\"c\":1}}", - "arr": "[1,2,3]" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Stringify Test", - "globalContext": { - "someKey": "someVal" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom" - }, - { - "error": "aborting group call: {\"status\":\"NOT_FOUND\",\"message\":\"User was not found for parameters {id=absent-id}\",\"debugMessage\":null,\"subErrors\":null}" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "identifyId": "absent-id", - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": ["AP-XABC-123"], - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": { - "hobby": "Sample Hobby" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "identifyId": "absent-id", - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": ["AP-XABC-123"], - "accountId": "1234", - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": {} - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users" - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.aptrinsic.com/v1/users/absent-id", - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "accountId": "ecorp-id" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": ["AP-XABC-123"], - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": { - "hobby": "Sample Hobby" - } - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id" - } -] diff --git a/test/__tests__/data/gainsight_px_router_input.json b/test/__tests__/data/gainsight_px_router_input.json deleted file mode 100644 index 52b9404824..0000000000 --- a/test/__tests__/data/gainsight_px_router_input.json +++ /dev/null @@ -1,298 +0,0 @@ -[ - { - "message": { - "type": "identify", - "sentAt": "2021-06-25T08:59:52.891Z", - "userId": "stanley-kubrick", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "title": "Test", - "search": "", - "path": "index.html", - "url": "http://127.0.0.1:3003/index.html", - "tab_url": "http://127.0.0.1:3003/index.html", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-GB", - "screen": { - "width": 1920, - "height": 1080, - "density": 1, - "innerWidth": 1920, - "innerHeight": 436 - }, - "traits": { - "name": "Stanley Kubrick", - "email": "stanley@kubrick.com", - "score": 100, - "title": "Director/Film Maker", - "gender": "Male", - "countryCode": "US", - "countryName": "USA", - "hobbyCustomField": "Making films. Being a genius" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" - }, - "rudderId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", - "messageId": "ff90d62e-a6e3-4e23-af20-03b4a249ef48", - "timestamp": "2021-06-25T14:29:52.911+05:30", - "receivedAt": "2021-06-25T14:29:52.911+05:30", - "request_ip": "[::1]", - "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-06-25T08:59:52.891Z" - }, - "metadata": { - "userId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", - "jobId": 1, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-25T14:29:52.911+05:30", - "createdAt": "2021-06-25T08:59:56.329Z", - "firstAttemptedAt": "", - "transformAt": "router" - }, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - }, - { - "message": { - "type": "track", - "event": "nested test2", - "sentAt": "2021-06-26T10:41:22.316Z", - "userId": "adifhas9734", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "path": "/Users/anurajguha/workspace/simple-html-test/index.html", - "title": "Test", - "search": "", - "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-GB", - "screen": { - "width": 1920, - "height": 1080, - "density": 1, - "innerWidth": 1920, - "innerHeight": 585 - }, - "traits": { - "name": "Update test unique", - "phone": "9900990899", - "lastname": "user6", - "firstname": "test", - "previousCompany": "testprevCompany2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" - }, - "rudderId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", - "messageId": "595dae36-5e4f-4feb-a2e4-8a7849615d38", - "timestamp": "2021-06-26T16:11:22.335+05:30", - "properties": { - "array": [1, 2, 3], - "nested": { - "json": "test" - }, - "status": "testing", - "description": "Example track call", - "fullyNested": [ - { - "a": 1, - "b": 2 - }, - { - "a": 1, - "b": [1, 2, 3] - } - ] - }, - "receivedAt": "2021-06-26T16:11:22.335+05:30", - "request_ip": "[::1]", - "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-06-26T10:41:22.316Z" - }, - "metadata": { - "userId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", - "jobId": 2, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-26T16:11:22.335+05:30", - "createdAt": "2021-06-26T10:41:24.126Z", - "firstAttemptedAt": "", - "transformAt": "router" - }, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/gainsight_px_router_output.json b/test/__tests__/data/gainsight_px_router_output.json deleted file mode 100644 index d76b5d34f1..0000000000 --- a/test/__tests__/data/gainsight_px_router_output.json +++ /dev/null @@ -1,236 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.aptrinsic.com/v1/users/stanley-kubrick", - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "email": "stanley@kubrick.com", - "gender": "MALE", - "signUpDate": 1624611592911, - "title": "Director/Film Maker", - "score": 100, - "createDate": 1624611592911, - "location": { - "countryName": "USA", - "countryCode": "US" - }, - "firstName": "Stanley", - "lastName": "Kubrick", - "customAttributes": { - "hobby": "Making films. Being a genius" - }, - "propertyKeys": ["AP-SAMPLE-2"], - "type": "USER" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "userId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", - "jobId": 1, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-25T14:29:52.911+05:30", - "createdAt": "2021-06-25T08:59:56.329Z", - "firstAttemptedAt": "", - "transformAt": "router" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identifyId": "adifhas9734", - "eventName": "nested test2", - "date": 1624704082335, - "attributes": { - "array": "[1,2,3]", - "nested": "{\"json\":\"test\"}", - "status": "testing", - "description": "Example track call", - "fullyNested": "[{\"a\":1,\"b\":2},{\"a\":1,\"b\":[1,2,3]}]" - }, - "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "referrer": "$direct", - "propertyKey": "AP-SAMPLE-2", - "userType": "USER", - "globalContext": { - "kubrickTest": "value" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "userId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", - "jobId": 2, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-26T16:11:22.335+05:30", - "createdAt": "2021-06-26T10:41:24.126Z", - "firstAttemptedAt": "", - "transformAt": "router" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/gainsight_router_input.json b/test/__tests__/data/gainsight_router_input.json deleted file mode 100644 index 9432b7c5ef..0000000000 --- a/test/__tests__/data/gainsight_router_input.json +++ /dev/null @@ -1,240 +0,0 @@ -[ - { - "message": { - "type": "identify", - "sentAt": "2021-05-28T11:22:01.842Z", - "userId": "live-test", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "path": "/Users/anurajguha/workspace/simple-html-test/index.html", - "title": "Test", - "search": "", - "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-GB", - "screen": { - "density": 2 - }, - "traits": { - "name": "Cosmo Krammer", - "email": "cosmo@krammer.com", - "location": "New York", - "emailOptOut": true, - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "masterAvatarTypeCode": 10 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - }, - "rudderId": "94d40f2f-5787-4798-8a03-34f3b02f5ede", - "messageId": "8274e525-d99c-4f55-b67a-bbc890d1444c", - "timestamp": "2021-05-28T16:52:01.859+05:30", - "receivedAt": "2021-05-28T16:52:01.859+05:30", - "request_ip": "[::1]", - "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-05-28T11:22:01.842Z" - }, - "metadata": { - "userId": "94d40f2f-5787-4798-8a03-34f3b02f5ede", - "jobId": 1, - "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", - "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", - "attemptNum": 0, - "receivedAt": "2021-05-28T16:52:01.859+05:30", - "createdAt": "2021-05-28T11:22:02.463Z", - "firstAttemptedAt": "", - "transformAt": "router" - }, - "destination": { - "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", - "Name": "gainsight-dev-dest", - "DestinationDefinition": { - "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", - "Name": "GAINSIGHT", - "DisplayName": "Gainsight", - "Config": { - "destConfig": { - "defaultConfig": [ - "accessKey", - "sharedSecret", - "tenantId", - "domain", - "personMap", - "companyMap", - "topicName", - "eventNameMap", - "eventVersionMap", - "contractId" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["accessKey", "sharedSecret"], - "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accessKey": "sample-access-key", - "contractId": "", - "domain": "demo-account.gainsightcloud.com", - "sharedSecret": "", - "tenantId": "", - "topicName": "" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - }, - { - "message": { - "type": "track", - "event": "Demo Request", - "sentAt": "2021-05-28T11:52:12.893Z", - "userId": "", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "path": "/Users/anurajguha/workspace/simple-html-test/index.html", - "title": "Test", - "search": "", - "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-GB", - "screen": { - "density": 2 - }, - "traits": {}, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - }, - "rudderId": "1a30a93f-916b-4c39-ad20-1ce7bbbd7754", - "messageId": "f5619b1a-8704-42a8-bab9-92bbeaa44896", - "timestamp": "2021-05-28T17:22:12.905+05:30", - "properties": { - "email": "sample@user.com", - "status": "active" - }, - "receivedAt": "2021-05-28T17:22:12.905+05:30", - "request_ip": "[::1]", - "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-05-28T11:52:12.893Z" - }, - "metadata": { - "userId": "1a30a93f-916b-4c39-ad20-1ce7bbbd7754", - "jobId": 2, - "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", - "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", - "attemptNum": 0, - "receivedAt": "2021-05-28T17:22:12.905+05:30", - "createdAt": "2021-05-28T11:52:15.283Z", - "firstAttemptedAt": "", - "transformAt": "router" - }, - "destination": { - "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", - "Name": "gainsight-dev-dest", - "DestinationDefinition": { - "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", - "Name": "GAINSIGHT", - "DisplayName": "Gainsight", - "Config": { - "destConfig": { - "defaultConfig": [ - "accessKey", - "sharedSecret", - "tenantId", - "domain", - "personMap", - "companyMap", - "topicName", - "eventNameMap", - "eventVersionMap", - "contractId" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["accessKey", "sharedSecret"], - "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accessKey": "sample-access-key", - "contractId": "sample-contract-id", - "domain": "demo-account.gainsightcloud.com", - "eventNameMap": [ - { - "from": "Demo Request", - "to": "Product Demo" - } - ], - "eventVersionMap": [ - { - "from": "Demo Request", - "to": "1.0.0" - } - ], - "sharedSecret": "sample-shared-secret", - "tenantId": "sample-tenant-id", - "topicName": "Support Tickets" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/gainsight_router_output.json b/test/__tests__/data/gainsight_router_output.json deleted file mode 100644 index a432c3c4c7..0000000000 --- a/test/__tests__/data/gainsight_router_output.json +++ /dev/null @@ -1,188 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://demo-account.gainsightcloud.com/v1.0/api/people", - "headers": { - "Accesskey": "sample-access-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "Email": "cosmo@krammer.com", - "Name": "Cosmo Krammer", - "LinkedinUrl": "https://linkedin.com/cosmo-krammer", - "Location": "New York", - "EmailOptOut": true, - "MasterAvatarTypeCode": 10 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "userId": "94d40f2f-5787-4798-8a03-34f3b02f5ede", - "jobId": 1, - "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", - "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", - "attemptNum": 0, - "receivedAt": "2021-05-28T16:52:01.859+05:30", - "createdAt": "2021-05-28T11:22:02.463Z", - "firstAttemptedAt": "", - "transformAt": "router" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", - "Name": "gainsight-dev-dest", - "DestinationDefinition": { - "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", - "Name": "GAINSIGHT", - "DisplayName": "Gainsight", - "Config": { - "destConfig": { - "defaultConfig": [ - "accessKey", - "sharedSecret", - "tenantId", - "domain", - "personMap", - "companyMap", - "topicName", - "eventNameMap", - "eventVersionMap", - "contractId" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["accessKey", "sharedSecret"], - "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accessKey": "sample-access-key", - "contractId": "", - "domain": "demo-account.gainsightcloud.com", - "sharedSecret": "", - "tenantId": "", - "topicName": "" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://demo-account.gainsightcloud.com/v1.0/api/eventManager/event", - "headers": { - "sharedSecret": "sample-shared-secret", - "topicName": "Support Tickets", - "tenantId": "sample-tenant-id", - "Content-Type": "application/json", - "eventName": "Product Demo", - "eventVersion": "1.0.0", - "contractId": "sample-contract-id", - "Accesskey": "sample-access-key" - }, - "params": {}, - "body": { - "JSON": { - "email": "sample@user.com", - "status": "active" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "userId": "1a30a93f-916b-4c39-ad20-1ce7bbbd7754", - "jobId": 2, - "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", - "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", - "attemptNum": 0, - "receivedAt": "2021-05-28T17:22:12.905+05:30", - "createdAt": "2021-05-28T11:52:15.283Z", - "firstAttemptedAt": "", - "transformAt": "router" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", - "Name": "gainsight-dev-dest", - "DestinationDefinition": { - "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", - "Name": "GAINSIGHT", - "DisplayName": "Gainsight", - "Config": { - "destConfig": { - "defaultConfig": [ - "accessKey", - "sharedSecret", - "tenantId", - "domain", - "personMap", - "companyMap", - "topicName", - "eventNameMap", - "eventVersionMap", - "contractId" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["accessKey", "sharedSecret"], - "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accessKey": "sample-access-key", - "contractId": "sample-contract-id", - "domain": "demo-account.gainsightcloud.com", - "eventNameMap": [ - { - "from": "Demo Request", - "to": "Product Demo" - } - ], - "eventVersionMap": [ - { - "from": "Demo Request", - "to": "1.0.0" - } - ], - "sharedSecret": "sample-shared-secret", - "tenantId": "sample-tenant-id", - "topicName": "Support Tickets" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/klaviyo.json b/test/__tests__/data/klaviyo.json deleted file mode 100644 index 623aa78cc4..0000000000 --- a/test/__tests__/data/klaviyo.json +++ /dev/null @@ -1,1970 +0,0 @@ -[ - { - "description": "Profile updating call and subscribe user (old transformer)", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "external_id": "user@1", - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "Flagged": false, - "Residence": "Shibuya" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 578 900", - "channels": { - "email": ["MARKETING"], - "sms": ["MARKETING"] - } - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify call for with flattenProperties enabled (old transformer)", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "flattenProperties": true - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "friend": { - "names": { - "first": "Alice", - "last": "Smith" - }, - "age": 25 - }, - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "external_id": "user@1", - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "friend.age": 25, - "friend.names.first": "Alice", - "friend.names.last": "Smith", - "Flagged": false, - "Residence": "Shibuya" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 578 900", - "channels": { - "email": ["MARKETING"], - "sms": ["MARKETING"] - } - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Profile updation call and subcribe user", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test3@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Failed to create user due to {}" - } - }, - { - "description": "Profile updation call listId is not provided for subscribing the user", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "subscribe": false, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "external_id": "user@1", - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "Flagged": false, - "Residence": "Shibuya" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Identify call with enforceEmailAsPrimary enabled from UI", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "enforceEmailAsPrimary": true - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "Flagged": false, - "Residence": "Shibuya", - "_id": "user@1" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 578 900", - "channels": { - "email": ["MARKETING"], - "sms": ["MARKETING"] - } - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify call without user custom Properties", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "enforceEmailAsPrimary": false - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "external_id": "user@1", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 578 900", - "channels": { - "email": ["MARKETING"], - "sms": ["MARKETING"] - } - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify call without email and phone & enforceEmailAsPrimary enabled from UI", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "enforceEmailAsPrimary": true - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "userId": "user@1", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "None of email and phone are present in the payload" - } - }, - { - "description": "Screen event call", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "screen", - "event": "TestEven001", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"] - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "TestEven001" - }, - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"] - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "$id": "sajal12", - "age": "22" - } - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track event call with flatten properties enabled", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "flattenProperties": true - } - }, - "message": { - "type": "track", - "event": "TestEven001", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68", - "plan_details": { - "plan_type": "gold", - "duration": "3 months" - } - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "vicePresdentInfo": { - "PreviouslVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["AaronBurr", "GeorgeClinton"] - } - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "TestEven001" - }, - "properties": { - "vicePresdentInfo.PreviouslVicePresident": true, - "vicePresdentInfo.VicePresidents": ["AaronBurr", "GeorgeClinton"], - "vicePresdentInfo.YearElected": 1801 - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "$id": "sajal12", - "age": "22", - "plan_details.plan_type": "gold", - "plan_details.duration": "3 months" - } - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track event call", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "track", - "event": "TestEven002", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "name": "Test", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68", - "description": "Sample description" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"], - "revenue": 3000 - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "TestEven002" - }, - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"] - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "$id": "sajal12", - "age": "22", - "name": "Test", - "description": "Sample description" - }, - "value": 3000 - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track event call, with make email or phone as primary identifier toggle on", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "enforceEmailAsPrimary": true - } - }, - "message": { - "type": "track", - "event": "TestEven001", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"] - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "TestEven001" - }, - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"] - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "age": "22", - "_id": "sajal12" - } - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track event call, without email and phone & with (make email or phone as primary identifier) toggle on", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "enforceEmailAsPrimary": true - } - }, - "message": { - "type": "track", - "event": "TestEven001", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "anonymousId": "9c6bd77ea9da3e68" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "PreviouslyVicePresident": true, - "YearElected": 1801, - "VicePresidents": ["Aaron Burr", "George Clinton"] - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "error": "None of email and phone are present in the payload" - } - }, - { - "description": "group call", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "userId": "user123", - "type": "group", - "groupId": "XUepkK", - "traits": { - "subscribe": true - }, - "context": { - "traits": { - "email": "test@rudderstack.com", - "phone": "+12 345 678 900", - "consent": ["email"] - }, - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 678 900" - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "group call without groupId", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "userId": "user123", - "type": "group", - "groupId": "", - "traits": { - "subscribe": true - }, - "context": { - "traits": { - "email": "test@rudderstack.com", - "phone": "+12 345 678 900", - "consent": "email" - }, - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z" - } - }, - "output": { - "error": "groupId is a required field for group events" - } - }, - { - "description": "[Error]: Check for unsupported message type", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "userId": "user123", - "type": "random", - "groupId": "XUepkK", - "traits": { - "subscribe": true - }, - "context": { - "traits": { - "email": "test@rudderstack.com", - "phone": "+12 345 678 900", - "consent": "email" - }, - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z" - } - }, - "output": { - "error": "Event type random is not supported" - } - }, - { - "description": "Track call with Ecom events (Viewed Product)", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "track", - "event": "product viewed", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "name": "Test", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68", - "description": "Sample description" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "name": "test product", - "product_id": "1114", - "sku": "WINNIePuh12", - "image_url": "http://www.example.com/path/to/product/image.png", - "url": "http://www.example.com/path/to/product", - "brand": "Not for Kids", - "price": 9.9, - "categories": ["Fiction", "Children"] - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "Viewed Product" - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "$id": "sajal12", - "age": "22", - "name": "Test", - "description": "Sample description" - }, - "properties": { - "ProductName": "test product", - "ProductID": "1114", - "SKU": "WINNIePuh12", - "ImageURL": "http://www.example.com/path/to/product/image.png", - "URL": "http://www.example.com/path/to/product", - "Brand": "Not for Kids", - "Price": 9.9, - "Categories": ["Fiction", "Children"] - } - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track call with Ecom events (Checkout Started) with enabled flattenProperties", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey", - "flattenProperties": true - } - }, - "message": { - "type": "track", - "event": "checkout started", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "name": "Test", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68", - "description": "Sample description" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "order_id": "1234", - "affiliation": "Apple Store", - "value": 20, - "revenue": 15.0, - "shipping": 4, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "products": [ - { - "product_id": "123", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ] - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "Started Checkout" - }, - "properties": { - "$event_id": "1234", - "$value": 20, - "items[0].ProductID": "123", - "items[0].SKU": "G-32", - "items[0].ProductName": "Monopoly", - "items[0].Quantity": 1, - "items[0].ItemPrice": 14, - "items[0].ProductURL": "https://www.website.com/product/path", - "items[0].ImageURL": "https://www.website.com/product/path.jpg", - "items[1].ProductID": "345", - "items[1].SKU": "F-32", - "items[1].ProductName": "UNO", - "items[1].Quantity": 2, - "items[1].ItemPrice": 3.45 - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "$id": "sajal12", - "age": "22", - "name": "Test", - "description": "Sample description" - } - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track call with Ecom events (Added to Cart) with properties.products", - "input": { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "message": { - "type": "track", - "event": "product added", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "sajal12", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "traits": { - "id": "user@1", - "age": "22", - "name": "Test", - "email": "test@rudderstack.com", - "phone": "9112340375", - "anonymousId": "9c6bd77ea9da3e68", - "description": "Sample description" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "order_id": "1234", - "value": 12.12, - "categories": ["Fiction3", "Children3"], - "checkout_url": "http://www.heythere.com", - "item_names": ["book1", "book2"], - "products": [ - { - "product_id": "b1pid", - "sku": "123x", - "name": "book1", - "url": "heyther.com", - "price": 12.0 - }, - { - "product_id": "b2pid", - "sku": "123x", - "name": "book2", - "url": "heyther2.com", - "price": 14.0 - } - ] - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/events", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "event", - "attributes": { - "metric": { - "name": "Added to Cart" - }, - "profile": { - "$email": "test@rudderstack.com", - "$phone_number": "9112340375", - "$id": "sajal12", - "age": "22", - "name": "Test", - "description": "Sample description" - }, - "properties": { - "$value": 12.12, - "AddedItemCategories": ["Fiction3", "Children3"], - "ItemNames": ["book1", "book2"], - "CheckoutURL": "http://www.heythere.com", - "items": [ - { - "ProductID": "b1pid", - "SKU": "123x", - "ProductName": "book1", - "ItemPrice": 12, - "ProductURL": "heyther.com" - }, - { - "ProductID": "b2pid", - "SKU": "123x", - "ProductName": "book2", - "ItemPrice": 14, - "ProductURL": "heyther2.com" - } - ] - } - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - } -] diff --git a/test/__tests__/data/klaviyo_router.json b/test/__tests__/data/klaviyo_router.json deleted file mode 100644 index 7fae2ad90e..0000000000 --- a/test/__tests__/data/klaviyo_router.json +++ /dev/null @@ -1,599 +0,0 @@ -[ - { - "description": "Router tests", - "input": [ - { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "metadata": { - "jobId": 1 - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "test", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "Testc", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "test", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12 345 578 900", - "userId": "test", - "title": "Developer", - "organization": "Rudder", - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001", - "Flagged": false, - "Residence": "Shibuya", - "properties": { - "listId": "XUepkK", - "subscribe": true, - "consent": ["email", "sms"] - } - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "metadata": { - "jobId": 3 - }, - "message": { - "userId": "user123", - "type": "group", - "groupId": "XUepkK", - "traits": { - "subscribe": true - }, - "context": { - "traits": { - "email": "test@rudderstack.com", - "phone": "+12 345 678 900", - "consent": ["email"] - }, - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z" - } - }, - { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "metadata": { - "jobId": 4 - }, - "message": { - "userId": "user123", - "type": "random", - "groupId": "XUepkK", - "traits": { - "subscribe": true - }, - "context": { - "traits": { - "email": "test@rudderstack.com", - "phone": "+12 345 678 900", - "consent": "email" - }, - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z" - } - }, - { - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - }, - "metadata": { - "jobId": 5 - }, - "message": { - "userId": "user123", - "type": "group", - "groupId": "", - "traits": { - "subscribe": true - }, - "context": { - "traits": { - "email": "test@rudderstack.com", - "phone": "+12 345 678 900", - "consent": "email" - }, - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z" - } - } - ], - "newTransformerOutput": [ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 678 900" - }, - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 578 900", - "channels": { - "email": ["MARKETING"], - "sms": ["MARKETING"] - } - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 3 - }, - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "external_id": "test", - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "Flagged": false, - "Residence": "Shibuya" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "error": "{\"id\":\"01GW3PHVY0MTCDGS0A1612HARX\",\"attributes\":{}}", - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 299, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - }, - { - "error": "Event type random is not supported", - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "statusCode": 400, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - }, - { - "error": "groupId is a required field for group events", - "metadata": [ - { - "jobId": 5 - } - ], - "batched": false, - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "statusCode": 400, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - } - ], - "oldTransformerOutput": [ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile-subscription-bulk-create-job", - "attributes": { - "list_id": "XUepkK", - "subscriptions": [ - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 678 900" - }, - { - "email": "test@rudderstack.com", - "phone_number": "+12 345 578 900", - "channels": { - "email": ["MARKETING"], - "sms": ["MARKETING"] - } - } - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "external_id": "test", - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "Flagged": false, - "Residence": "Shibuya" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 3 - }, - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", - "headers": { - "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", - "Content-Type": "application/json", - "Accept": "application/json", - "revision": "2023-02-22" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "profile", - "attributes": { - "external_id": "test", - "email": "test@rudderstack.com", - "first_name": "Test", - "last_name": "Rudderlabs", - "phone_number": "+12 345 578 900", - "title": "Developer", - "organization": "Rudder", - "location": { - "city": "Tokyo", - "region": "Kanto", - "country": "JP", - "zip": "100-0001" - }, - "properties": { - "Flagged": false, - "Residence": "Shibuya" - } - }, - "id": "01GW3PHVY0MTCDGS0A1612HARX" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - }, - { - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 400, - "error": "Event type random is not supported", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - }, - { - "metadata": [ - { - "jobId": 5 - } - ], - "batched": false, - "statusCode": 400, - "error": "groupId is a required field for group events", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "destination": { - "Config": { - "publicApiKey": "dummyPublicApiKey", - "privateApiKey": "dummyPrivateApiKey" - } - } - } - ] - } -] diff --git a/test/__tests__/data/kustomer_input.json b/test/__tests__/data/kustomer_input.json deleted file mode 100644 index c711c2499c..0000000000 --- a/test/__tests__/data/kustomer_input.json +++ /dev/null @@ -1,851 +0,0 @@ -[ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Testc", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "name": "Test Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12345578900", - "birthday": "2005-01-01T23:28:56.782Z", - "userId": "Testc", - "address": { - "street": "24 Dovers Lane", - "city": "Miami", - "state": "Florida", - "postalCode": "1890001" - }, - "userName": "Testc47", - "company": "Rudderstack", - "createdAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatar": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "website": "www.mattertoast873.com", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ] - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "userId": "58210c3db0f09110006b7953", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "name": "Ano Domeni", - "phone": "+12345578000", - "birthday": "2005-01-01T23:28:56.782Z" - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "screen", - "event": "Test-Event-Screen", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "Testc", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "hasAccount": "true", - "YearSelectedNum": 1801, - "originalServing": "2021-01-25T15:32:56.409Z" - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "name": "Cart-Viewed", - "type": "page", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "locale": "en-US", - "screen": { "density": 2 }, - "traits": { - "userId": "userid", - "profession": "Student", - "anonymousId": "d80b66d5-b33d-412d-866f-r4fft5841af" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "category": "Cart", - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "url": "http://morkey.in", - "name": "Cart Viewed", - "path": "/cart", - "title": "miphone", - "search": "MI", - "category": "Cart", - "referrer": "morkey", - "domain": "morkey.com" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.195Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "page", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "locale": "en-US", - "screen": { "density": 2 }, - "traits": { - "userId": "userid", - "profession": "Student", - "anonymousId": "d80b66d5-b33d-412d-866f-r4fft5841af" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "category": "Cart", - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "category": "Cart", - "referrer": "morkey", - "domain": "morkey.com", - "kustomerTrackingId": "829131sjad", - "kustomerSessionId": "hsad522" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.195Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "track", - "event": "Tracking-Weekender", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "YearServicedNum": 211, - "region": "strapis", - "kustomerTrackingId": "sahetwiac", - "kustomerSessionId": "63nsa22" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "locale": "en-US", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.195Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "track", - "event": "Tracking-Weekender2", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "YearServicedNum": 211, - "reg_8-821x": false, - "kustomer_tracking_id": "sahetwiac", - "kustomer_session_id": "63nsa22" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "locale": "en-US", - "originalTimestamp": "2021-01-03T17:02:53.195Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericPage": true - } - }, - "message": { - "type": "page", - "name": "Unfinished page", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "category": "Cart", - "referrer": "morkey", - "domain": "morkey.com" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "locale": "en-US", - "originalTimestamp": "2021-01-03T17:02:53.195Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericScreen": true - } - }, - "message": { - "type": "screen", - "event": "Test-Event-Screen", - "sentAt": "2021-01-25T16:12:02.048Z", - "userId": "Testc", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "hasAccount": "true", - "YearSelectedNum": 1801, - "originalServing": "2021-01-25T15:32:56.409Z" - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-01-25T15:32:56.409Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Testc", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12345578900", - "birthday": "2005-01-01T23:28:56.782Z", - "userId": "Testc", - "address": { - "street": "24 Dovers Lane", - "city": "Miami", - "state": "Florida", - "postalCode": "1890001" - }, - "userName": "Testc47", - "company": "Rudderstack", - "createdAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatar": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "website": "www.mattertoast873.com", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ] - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Testc", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "birthday": "2005-01-01T23:28:56.782Z", - "userId": "Testc", - "address": "test address string", - "userName": "Testc47", - "company": "Rudderstack", - "createdAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatar": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "website": "www.mattertoast873.com", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ] - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Testc", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "firstName": "Test", - "lastName": "Rudderlabs", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "birthday": "2005-01-01T23:28:56.782Z", - "userId": "Testc", - "address": "test address string", - "userName": "Testc47", - "company": "Rudderstack", - "createdAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatar": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "website": "www.mattertoast873.com", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ] - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "externalId": [ - { - "type": "kustomerId", - "id": "abcd1234" - } - ] - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericScreen": true - } - }, - "message": { - "type": "screen", - "event": "Test-Event-Screen", - "userId": "utsabc", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)", - "sessionId": "hsad522" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "hasAccount": "true", - "YearSelectedNum": 1801 - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-01-10T15:32:56.409Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyAPIkey", - "baseEndpoint": "https://api.prod2.kustomerapp.com", - "apiKey": "dummyApiKey", - "genericScreen": true - } - }, - "message": { - "type": "screen", - "event": "Test-Event-Screen", - "userId": "Testc", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "10" - }, - "app": { - "name": "KlaviyoTest", - "build": "1", - "version": "1.0", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" - }, - "device": { - "id": "9c6bd77ea9da3e68", - "name": "raphaelin", - "type": "android", - "model": "Redmi K20 Pro", - "manufacturer": "Xiaomi" - }, - "locale": "en-IN", - "screen": { - "width": 1080, - "height": 2210, - "density": 440 - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "network": { - "wifi": true, - "carrier": "airtel", - "cellular": true, - "bluetooth": false - }, - "timezone": "Asia/Kolkata", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)", - "sessionId": "hsad522" - }, - "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", - "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", - "properties": { - "hasAccount": "true", - "YearSelectedNum": 1801 - }, - "anonymousId": "9c6bd77ea9da3e68", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-01-10T15:32:56.409Z" - } - } -] diff --git a/test/__tests__/data/kustomer_output.json b/test/__tests__/data/kustomer_output.json deleted file mode 100644 index 0a0876d29a..0000000000 --- a/test/__tests__/data/kustomer_output.json +++ /dev/null @@ -1,602 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/customers", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "name": "Test Rudderlabs", - "externalId": "Testc", - "username": "Testc47", - "company": "Rudderstack", - "signedUpAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatarUrl": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "locale": "en-US", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ], - "birthdayAt": "2005-01-01T23:28:56.782Z", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "urls": [ - { - "url": "www.mattertoast873.com" - } - ], - "locations": [ - { - "type": "home", - "address": "24 Dovers Lane Miami Florida 1890001" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.kustomerapp.com/v1/customers/58210c3db0f09110006b7953?replace=false", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "name": "Ano Domeni", - "externalId": "58210c3db0f09110006b7953", - "locale": "en-US", - "birthdayAt": "2005-01-01T23:28:56.782Z", - "phones": [ - { - "type": "home", - "phone": "+12345578000" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "Testc" - }, - "event": { - "name": "Screen-Viewed-Test-Event-Screen", - "meta": { - "hasAccount": "true", - "YearSelectedNum": 1801, - "originalServing": "2021-01-25T15:32:56.409Z" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "user@doe" - }, - "event": { - "name": "Web-Page-Viewed-Cart-Viewed", - "meta": { - "url": "http://morkey.in", - "name": "Cart Viewed", - "path": "/cart", - "title": "miphone", - "search": "MI", - "category": "Cart", - "referrer": "morkey", - "domain": "morkey.com" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "user@doe" - }, - "event": { - "name": "Web-Page-Viewed", - "sessionId": "hsad522", - "trackingId": "829131sjad", - "meta": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "category": "Cart", - "referrer": "morkey", - "domain": "morkey.com" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "user@doe" - }, - "event": { - "name": "Tracking-Weekender", - "sessionId": "63nsa22", - "trackingId": "sahetwiac", - "meta": { - "YearServicedNum": 211, - "region": "strapis" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "FORM": {}, - "JSON": { - "event": { - "meta": { - "YearServicedNum": 211, - "reg_8-821x": false - }, - "name": "Tracking-Weekender2", - "sessionId": "63nsa22", - "trackingId": "sahetwiac" - }, - "identity": { - "externalId": "user@doe" - } - }, - "XML": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "user@doe" - }, - "event": { - "name": "Web-Page-Viewed", - "meta": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "category": "Cart", - "referrer": "morkey", - "domain": "morkey.com" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "Testc" - }, - "event": { - "name": "Screen-Viewed", - "meta": { - "hasAccount": "true", - "YearSelectedNum": 1801, - "originalServing": "2021-01-25T15:32:56.409Z" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/customers", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "name": "Test Rudderlabs", - "externalId": "Testc", - "username": "Testc47", - "company": "Rudderstack", - "signedUpAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatarUrl": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "locale": "en-US", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ], - "birthdayAt": "2005-01-01T23:28:56.782Z", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "urls": [ - { - "url": "www.mattertoast873.com" - } - ], - "locations": [ - { - "type": "home", - "address": "24 Dovers Lane Miami Florida 1890001" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/customers", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "name": "Test Rudderlabs", - "externalId": "Testc", - "username": "Testc47", - "company": "Rudderstack", - "signedUpAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatarUrl": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "locale": "en-US", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ], - "birthdayAt": "2005-01-01T23:28:56.782Z", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "urls": [ - { - "url": "www.mattertoast873.com" - } - ], - "locations": [ - { - "type": "home", - "address": "test address string" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.kustomerapp.com/v1/customers/abcd1234?replace=false", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "name": "Test Rudderlabs", - "externalId": "Testc", - "username": "Testc47", - "company": "Rudderstack", - "signedUpAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatarUrl": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "locale": "en-US", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@Testc", - "url": "http://twitter.com/Testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "Testc", - "url": "http://facebook.com/Testc" - } - ], - "birthdayAt": "2005-01-01T23:28:56.782Z", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "urls": [ - { - "url": "www.mattertoast873.com" - } - ], - "locations": [ - { - "type": "home", - "address": "test address string" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "utsabc" - }, - "event": { - "name": "Screen-Viewed", - "sessionId": "hsad522", - "meta": { - "hasAccount": "true", - "YearSelectedNum": 1801 - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.prod2.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "Testc" - }, - "event": { - "name": "Screen-Viewed", - "sessionId": "hsad522", - "meta": { - "hasAccount": "true", - "YearSelectedNum": 1801 - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } -] diff --git a/test/__tests__/data/kustomer_router_input.json b/test/__tests__/data/kustomer_router_input.json deleted file mode 100644 index 0e4c88aa20..0000000000 --- a/test/__tests__/data/kustomer_router_input.json +++ /dev/null @@ -1,183 +0,0 @@ -[ - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "testc", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "name": "test Rudderlabs", - "email": "test@rudderstack.com", - "phone": "+12345578900", - "birthday": "2005-01-01T23:28:56.782Z", - "userId": "testc", - "address": { - "street": "24 Dovers Lane", - "city": "Miami", - "state": "Florida", - "postalCode": "1890001" - }, - "userName": "testc47", - "company": "Rudderstack", - "createdAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatar": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "website": "www.mattertoast873.com", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@testc", - "url": "http://twitter.com/testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "testc", - "url": "http://facebook.com/testc" - } - ] - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericPage": false, - "genericScreen": false - } - } - }, - { - "message": { - "type": "track", - "event": "Tracking-Weekender", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "YearServicedNum": 211, - "region": "strapis", - "kustomerTrackingId": "sahetwiac", - "kustomerSessionId": "63nsa22" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "locale": "en-US", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.195Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericPage": false, - "genericScreen": false - } - } - }, - { - "message": { - "type": "track", - "event": "Tracking-Weekender", - "sentAt": "2021-01-03T17:02:53.197Z", - "userId": "user@doe", - "channel": "web", - "context": { - "os": { "name": "", "version": "" }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "locale": "en-US", - "screen": { "density": 2 }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.11" }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "15129730-eb00-4db7-8db2-799566ccb2ef", - "properties": { - "YearServicedNum": 211, - "region": "strapis", - "kustomerTrackingId": "sahetwiac", - "kustomerSessionId": "63nsa22" - }, - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "locale": "en-US", - "integrations": { "All": true }, - "originalTimestamp": "2021-01-03T17:02:53.195Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "baseEndpoint": "https://api.prod2.kustomerapp.com", - "apiKey": "dummyApiKey", - "genericPage": false, - "genericScreen": false - } - } - } -] diff --git a/test/__tests__/data/kustomer_router_output.json b/test/__tests__/data/kustomer_router_output.json deleted file mode 100644 index 0d3470f74a..0000000000 --- a/test/__tests__/data/kustomer_router_output.json +++ /dev/null @@ -1,184 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/customers", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "name": "test Rudderlabs", - "externalId": "testc", - "username": "testc47", - "company": "Rudderstack", - "signedUpAt": "2015-04-17T12:37:42.146Z", - "lastActivityAt": "2016-04-17T12:37:42.146Z", - "lastCustomerActivityAt": "2017-04-17T12:37:42.146Z", - "lastSeenAt": "2017-04-17T12:37:42.146Z", - "avatarUrl": "https://homepages.cae.wisc.edu/~ece533/images/boat.png", - "gender": "m", - "tags": ["happy", "satisfied"], - "locale": "en-US", - "socials": [ - { - "verified": true, - "userid": "100", - "type": "twitter", - "username": "@testc", - "url": "http://twitter.com/testc" - }, - { - "verified": false, - "userid": "200", - "type": "facebook", - "username": "testc", - "url": "http://facebook.com/testc" - } - ], - "birthdayAt": "2005-01-01T23:28:56.782Z", - "emails": [ - { - "type": "home", - "email": "test@rudderstack.com" - } - ], - "phones": [ - { - "type": "home", - "phone": "+12345578900" - } - ], - "urls": [ - { - "url": "www.mattertoast873.com" - } - ], - "locations": [ - { - "type": "home", - "address": "24 Dovers Lane Miami Florida 1890001" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericPage": false, - "genericScreen": false - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "user@doe" - }, - "event": { - "name": "Tracking-Weekender", - "sessionId": "63nsa22", - "trackingId": "sahetwiac", - "meta": { - "YearServicedNum": 211, - "region": "strapis" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "genericPage": false, - "genericScreen": false - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.prod2.kustomerapp.com/v1/tracking/identityEvent", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "identity": { - "externalId": "user@doe" - }, - "event": { - "name": "Tracking-Weekender", - "sessionId": "63nsa22", - "trackingId": "sahetwiac", - "meta": { - "YearServicedNum": 211, - "region": "strapis" - } - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "baseEndpoint": "https://api.prod2.kustomerapp.com", - "apiKey": "dummyApiKey", - "genericPage": false, - "genericScreen": false - } - } - } -] diff --git a/test/__tests__/data/mailchimp_batch_input.json b/test/__tests__/data/mailchimp_batch_input.json deleted file mode 100644 index ea382b1d89..0000000000 --- a/test/__tests__/data/mailchimp_batch_input.json +++ /dev/null @@ -1,225 +0,0 @@ -[ - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "1232yyqw22", - "datacenterId": "us20" - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email_address", - "id": "bob.dole@initech.com", - "type": "audience" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "merge_fields": { - "FIRSTNAME": "Bob" - }, - "status": "subscribed" - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "1232yyqw22", - "datacenterId": "us20" - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 3 - }, - "message": { - "type": "identify", - "traits": { - "status": "subscribed" - }, - "userId": "emrichardson820+22822@gmail.com", - "channel": "sources", - "context": { - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - }, - "externalId": [ - { - "id": "emrichardson820+22822@gmail.com", - "type": "MAILCHIMP-92e1f1ad2c", - "identifierType": "email_address" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a", - "messageId": "b3bee036-fc26-4f6d-9867-c17f85708a82" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "1232yyqw22", - "datacenterId": "us20" - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 4 - }, - "message": { - "type": "identify", - "traits": { - "status": "subscribed" - }, - "userId": "emrichardson820+22822@gmail.com", - "channel": "sources", - "context": { - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - }, - "externalId": [ - { - "id": "emrichardson820+22822@gmail.com", - "type": "MAILCHIMP-92e1f1ad2c", - "identifierType": "email_address" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a", - "messageId": "b3bee036-fc26-4f6d-9867-c17f85708a82" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "1232yyqw22", - "datacenterId": "us20" - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 5 - }, - "message": { - "type": "identify", - "traits": { - "status": "subscrib" - }, - "userId": "emrichardson820+22822@gmail.com", - "channel": "sources", - "context": { - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - }, - "externalId": [ - { - "id": "emrichardson820+22822@gmail.com", - "type": "MAILCHIMP-92e1f1ad2c", - "identifierType": "email_address" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a", - "messageId": "b3bee036-fc26-4f6d-9867-c17f85708a82" - } - } -] diff --git a/test/__tests__/data/mailchimp_batch_output.json b/test/__tests__/data/mailchimp_batch_output.json deleted file mode 100644 index fac07b6a46..0000000000 --- a/test/__tests__/data/mailchimp_batch_output.json +++ /dev/null @@ -1,100 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://us20.api.mailchimp.com/3.0/lists/1232yyqw22?skip_merge_validation=false&skip_duplicate_check=false", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==" - }, - "params": {}, - "body": { - "JSON": { - "members": [ - { - "merge_fields": { - "FIRSTNAME": "Bob" - }, - "status": "subscribed", - "email_address": "bob.dole@initech.com" - }, - { - "status": "subscribed", - "email_address": "emrichardson820+22822@gmail.com" - }, - { - "status": "subscribed", - "email_address": "emrichardson820+22822@gmail.com" - } - ], - "update_existing": true - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - }, - { - "jobId": 3 - }, - { - "jobId": 4 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "1232yyqw22", - "datacenterId": "us20" - }, - "Enabled": true, - "Transformations": [] - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "1232yyqw22", - "datacenterId": "us20" - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": [ - { - "jobId": 5 - } - ], - "batched": false, - "statusCode": 400, - "error": "The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - } -] diff --git a/test/__tests__/data/mailchimp_input.json b/test/__tests__/data/mailchimp_input.json deleted file mode 100644 index 20b7ba0fc0..0000000000 --- a/test/__tests__/data/mailchimp_input.json +++ /dev/null @@ -1,1299 +0,0 @@ -[ - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com", - "firstName": "Bob", - "lastName": "Dole", - "zip": "123", - "state": "test", - "city": "test", - "addressLine1": "test", - "birthday": "2000-05-06" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "MailChimp": { - "subscriptionStatus": "subscribed" - } - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "Titli Test", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "type": "identify", - "sentAt": "2021-05-18T06:58:57.186Z", - "userId": "test.rudderlabs@yara.com", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://app.rudderstack.com/sources/1qHR2Qzd894ievNGc4aBHmjltLD", - "path": "/sources/1qHR2Qzd894ievNGc4aBHmjltLD", - "title": "RudderStack", - "search": "", - "tab_url": "https://app.rudderstack.com/sources/1qHR2Qzd894ievNGc4aBHmjltLD", - "referrer": "$direct", - "initial_referrer": "https://www.google.com/", - "referring_domain": "", - "initial_referring_domain": "www.google.com" - }, - "locale": "en-US", - "screen": { - "width": 1792, - "height": 1120, - "density": 2 - }, - "traits": { - "name": "test rudderlabs", - "email": "test.rudderlabs@yara.com", - "userId": "1sWVaQTxoVwjvShC0295E6OqMaP", - "first_login": false, - "workspaceId": "1jWrHYPjNGSHbvKwzow0ZFPIQll", - "account_type": "invited" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - }, - "rudderId": "6d612dda-9c8c-4062-9d09-af9425b846ce", - "messageId": "c6d49688-89f2-45cf-b061-0ae3c212a4e5", - "timestamp": "2021-05-18T06:58:57.811Z", - "receivedAt": "2021-05-18T06:58:57.812Z", - "request_ip": "122.172.221.51", - "anonymousId": "6914679f-fd34-45ef-86e0-4930e6e8b91a", - "integrations": { - "Salesforce": true - }, - "originalTimestamp": "2021-05-18T06:58:57.185Z" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "Titli Test", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "type": "page", - "sentAt": "2021-05-18T07:02:17.675Z", - "userId": "", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://app.rudderstack.com/signup?type=freetrial", - "path": "/signup", - "title": "", - "search": "?type=freetrial", - "tab_url": "https://app.rudderstack.com/signup?type=freetrial", - "referrer": "https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e", - "initial_referrer": "https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e", - "referring_domain": "rudderstack.medium.com", - "initial_referring_domain": "rudderstack.medium.com" - }, - "locale": "en-GB", - "screen": { - "density": 2 - }, - "traits": {}, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - }, - "rudderId": "4dbe224c-6aea-4d89-8da6-09d27c0d2908", - "messageId": "72df8cb0-54ab-417c-8e87-e97e9d339feb", - "timestamp": "2021-05-18T07:02:18.566Z", - "properties": { - "url": "https://app.rudderstack.com/signup?type=freetrial", - "path": "/signup", - "title": "", - "search": "?type=freetrial", - "tab_url": "https://app.rudderstack.com/signup?type=freetrial", - "referrer": "https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e", - "initial_referrer": "https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e", - "referring_domain": "rudderstack.medium.com", - "initial_referring_domain": "rudderstack.medium.com" - }, - "receivedAt": "2021-05-18T07:02:18.566Z", - "request_ip": "162.44.150.11", - "anonymousId": "58ec7b39-48f1-4d83-9d45-a48c64f96fa0", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-05-18T07:02:17.675Z" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email_address", - "id": "bob.dole@initech.com", - "type": "audience" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "merge_fields": { - "FIRSTNAME": "Bob" - }, - "status": "subscribed" - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "type": "identify", - "traits": { - "status": "subscri" - }, - "userId": "emrichardson820+22822@gmail.com", - "channel": "sources", - "context": { - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - }, - "externalId": [ - { - "id": "emrichardson820+22822@gmail.com", - "type": "MAILCHIMP-92e1f1ad2c", - "identifierType": "email_address" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a", - "messageId": "b3bee036-fc26-4f6d-9867-c17f85708a82" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud112", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "jhon@gmail.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "bob.dole@initech.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "MailChimp": { - "subscriptionStatus": "subscribed" - } - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "test-rudderlabs", - "email": "test-rudderlabs-test@initech.com", - "firstName": "Test", - "lastName": "Rudderlabs" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "test-rudderlabs", - "email": "test-rudderlabs-test@initech.com", - "firstName": "Test", - "lastName": "Rudderlabs" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "test-rudderlabs", - "email": "test-rudderlabs-test@initech.com", - "firstName": "Test", - "lastName": "Rudderlabs" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "test-rudderlabs", - "email": "test-rudderlabs-test@initech.com", - "firstName": "Test", - "lastName": "Rudderlabs" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "group", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments" - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345" - } - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false, - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14 - } - ], - "purchased": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false, - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14 - } - ], - "purchased": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": 22, - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false, - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14 - } - ], - "purchased": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "E", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false, - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14 - } - ], - "purchased": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "Event Name more than 30 characters abcdefghijklmno", - "userId": "userId12345" - } - } -] diff --git a/test/__tests__/data/mailchimp_output.json b/test/__tests__/data/mailchimp_output.json deleted file mode 100644 index e1a8384242..0000000000 --- a/test/__tests__/data/mailchimp_output.json +++ /dev/null @@ -1,498 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "merge_fields": { - "ADDRESS": { - "addr1": "test", - "city": "test", - "state": "test", - "zip": "123" - }, - "FNAME": "Bob", - "LNAME": "Dole", - "ANONYMOUSI": "userId12345", - "BIRTHDAY": "05/06" - }, - "email_address": "bob.dole@initech.com", - "status": "subscribed" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "status": "subscribed", - "email_address": "bob.dole@initech.com", - "merge_fields": { - "ANONYMOUSI": "userId12345" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "error": "User does not have access to the requested operation", - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "Titli Test", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey-dummyApiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "Titli Test", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apiKey", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "error": "message type page is not supported" - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "merge_fields": { - "FIRSTNAME": "Bob" - }, - "status": "subscribed", - "email_address": "bob.dole@initech.com" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "94f71917d8522770c97449b0c90caa4c-usXX", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "error": "The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "ff21810ddc", - "datacenterId": "us14" - }, - "Enabled": true, - "Transformations": [] - }, - "statusCode": 400, - "error": "Email is required for identify", - "statTags": { - "destination": "mailchimp", - "stage": "transform", - "scope": "exception" - } - }, - { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "status": "subscribed", - "email_address": "jhon@gmail.com" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "audienceId": "aud112", - "version": "1", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud112/members/7f3863b197eeff650876bb89eca08e57" - }, - { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "email_address": "bob.dole@initech.com", - "status": "subscribed" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "audienceId": "aud111", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "version": "1", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab" - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "status": "subscribed", - "email_address": "bob.dole@initech.com" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "error": "API Key not found. Aborting" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "awesrdcfgvhbjnkkjhgf", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "error": "Audience Id not found. Aborting" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "aud111", - "datacenterId": "" - }, - "Enabled": true, - "Transformations": [] - }, - "error": "DataCenter Id not found. Aborting" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "zesrxdthfcjg345yruikyhntbgrafvd", - "audienceId": "aud111", - "datacenterId": "usXX" - }, - "Enabled": true, - "Transformations": [] - }, - "error": "message type group is not supported" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "name": "local_testing", - "occurred_at": "2019-11-15T10:26:53+00:00", - "properties": { - "brand": "Aster", - "product": "Garments" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "name": "local_testing", - "occurred_at": "2019-11-15T10:26:53+00:00", - "is_syncing": false, - "properties": { - "brand": "Aster", - "product": "Garments" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "error": "Email is required for track" - }, - { - "error": "Missing required value from \"event\"" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "name": "local_testing", - "occurred_at": "2019-11-15T10:26:53+00:00" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "name": "local_testing", - "occurred_at": "2019-11-15T10:26:53+00:00", - "is_syncing": false, - "properties": { - "brand": "Aster", - "product": "Garments", - "products": "[{\"product_id\":\"123\",\"price\":\"14\"},{\"product_id\":\"123\",\"price\":14}]", - "purchased": "false" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmR1bW15QXBpS2V5" - }, - "params": {}, - "body": { - "JSON": { - "name": "22", - "occurred_at": "2019-11-15T10:26:53+00:00", - "is_syncing": false, - "properties": { - "brand": "Aster", - "product": "Garments", - "products": "[{\"product_id\":\"123\",\"price\":\"14\"},{\"product_id\":\"123\",\"price\":14}]", - "purchased": "false" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "ff21810ddc", - "datacenterId": "us14" - }, - "Enabled": true, - "Transformations": [] - }, - "statusCode": 400, - "error": "Event name should be between 2 and 30 characters", - "statTags": { - "destination": "mailchimp", - "stage": "transform", - "scope": "exception" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "dummyApiKey", - "audienceId": "ff21810ddc", - "datacenterId": "us14" - }, - "Enabled": true, - "Transformations": [] - }, - "statusCode": 400, - "error": "Event name should be between 2 and 30 characters", - "statTags": { - "destination": "mailchimp", - "stage": "transform", - "scope": "exception" - } - } -] diff --git a/test/__tests__/data/mailchimp_router_input.json b/test/__tests__/data/mailchimp_router_input.json deleted file mode 100644 index e3cdbdddf5..0000000000 --- a/test/__tests__/data/mailchimp_router_input.json +++ /dev/null @@ -1,347 +0,0 @@ -[ - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com", - "firstName": "Bob", - "lastName": "Dole" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "21e475b2-3694-477b-afb6-5b94a81aac21", - "originalTimestamp": "2019-11-15T10:22:32Z", - "receivedAt": "2019-11-15T15:52:37+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:22:37Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:52:32+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 3 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "MailChimp": { - "subscriptionStatus": "subscribed" - } - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 4 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" - }, - "integrations": { - "MailChimp": { - "subscriptionStatus": "subscrib" - } - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "request_ip": "[::1]:62921", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "identify", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 5 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments" - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 6 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "is_syncing": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "userId": "userId12345" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": { - "jobId": 7 - }, - "message": { - "anonymousId": "userId12345", - "channel": "web", - "context": { - "traits": { - "anonymousId": "userId12345", - "email": "bob.dole@initech.com" - } - }, - "properties": { - "brand": "Aster", - "product": "Garments", - "isSyncing": false, - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14 - } - ], - "purchased": false - }, - "messageId": "6d1f3ca8-e2d0-4d34-9926-44596171af0c", - "originalTimestamp": "2019-11-15T10:26:53Z", - "receivedAt": "2019-11-15T15:56:58+05:30", - "sentAt": "2019-11-15T10:26:58Z", - "source_id": "1TdhTcwsUVOeEMWyPUpQIgF3pYr", - "timestamp": "2019-11-15T15:56:53+05:30", - "type": "track", - "event": "local testing", - "userId": "userId12345" - } - } -] diff --git a/test/__tests__/data/mailchimp_router_output.json b/test/__tests__/data/mailchimp_router_output.json deleted file mode 100644 index 3a3eec40a9..0000000000 --- a/test/__tests__/data/mailchimp_router_output.json +++ /dev/null @@ -1,238 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111?skip_merge_validation=true&skip_duplicate_check=false", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmFwaWtleQ==" - }, - "params": {}, - "body": { - "JSON": { - "members": [ - { - "email_address": "bob.dole@initech.com", - "merge_fields": { - "FNAME": "Bob", - "LNAME": "Dole", - "ANONYMOUSI": "userId12345" - }, - "status": "subscribed" - }, - { - "email_address": "bob.dole@initech.com", - "merge_fields": { - "ANONYMOUSI": "userId12345" - }, - "status": "subscribed" - } - ], - "update_existing": true - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - }, - { - "jobId": 3 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmFwaWtleQ==" - }, - "params": {}, - "body": { - "JSON": { - "name": "local_testing", - "occurred_at": "2019-11-15T10:26:53+00:00", - "properties": { - "brand": "Aster", - "product": "Garments" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - "metadata": [ - { - "jobId": 5 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YXBpS2V5OmFwaWtleQ==" - }, - "params": {}, - "body": { - "JSON": { - "name": "local_testing", - "occurred_at": "2019-11-15T10:26:53+00:00", - "is_syncing": false, - "properties": { - "brand": "Aster", - "product": "Garments", - "products": "[{\"product_id\":\"123\",\"price\":\"14\"},{\"product_id\":\"123\",\"price\":14}]", - "purchased": "false" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "audienceId": "aud111" - }, - "metadata": [ - { - "jobId": 7 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": [ - { - "jobId": 6 - } - ], - "batched": false, - "statusCode": 400, - "error": "Missing required value from \"event\"", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "destination": { - "ID": "1Tdi0lpXwSVwXG1lcdP2pXHKrJ6", - "Name": "test-mc", - "DestinationDefinition": { - "ID": "1SujZGrVEPqYmpUJcV4vSl9tfxn", - "Name": "MC", - "DisplayName": "MailChimp" - }, - "Config": { - "apiKey": "apikey", - "audienceId": "aud111", - "datacenterId": "usXX", - "enableMergeFields": true - }, - "Enabled": true, - "Transformations": [] - }, - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 400, - "error": "The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - } -] diff --git a/test/__tests__/data/monday.json b/test/__tests__/data/monday.json deleted file mode 100644 index cec99959da..0000000000 --- a/test/__tests__/data/monday.json +++ /dev/null @@ -1,1023 +0,0 @@ -[ - { - "description": "Track call with empty columnToPropertyMapping", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "query": "mutation { create_item (board_id: 339283933, item_name: \"Task 1\", column_values: \"{}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.monday.com/v2", - "files": {}, - "headers": { - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Track call with undefined columnToPropertyMapping", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "query": "mutation { create_item (board_id: 339283933, item_name: \"Task 1\", column_values: \"{}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.monday.com/v2", - "files": {}, - "headers": { - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Check Unsupported message type", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Event type identify is not supported" - } - }, - { - "description": "Check for empty message type", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Event type is required" - } - }, - { - "description": "Check for empty API Token", - "input": { - "destination": { - "Config": { - "apiToken": "", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "ApiToken is a required field" - } - }, - { - "description": "Check for empty board Id", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "boardId is a required field" - } - }, - { - "description": "Check for event name", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Event is a required field and should be a string" - } - }, - { - "description": "Track call with columnToPropertyMapping and with empty groupTitle", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - } - ], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.monday.com/v2", - "headers": { - "Content-Type": "application/json", - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih" - }, - "params": {}, - "body": { - "JSON": { - "query": "mutation { create_item (board_id: 339283933, item_name: \"Task 1\", column_values: \"{\\\"status\\\":{\\\"label\\\":\\\"Done\\\"},\\\"email\\\":{\\\"email\\\":\\\"abc@email.com\\\",\\\"text\\\":\\\"emailId\\\"}}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track call with columnToPropertyMapping and with groupTitle", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next month", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - } - ], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.monday.com/v2", - "headers": { - "Content-Type": "application/json", - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih" - }, - "params": {}, - "body": { - "JSON": { - "query": "mutation { create_item (board_id: 339283933, group_id: group_title item_name: \"Task 1\", column_values: \"{\\\"status\\\":{\\\"label\\\":\\\"Done\\\"},\\\"email\\\":{\\\"email\\\":\\\"abc@email.com\\\",\\\"text\\\":\\\"emailId\\\"}}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Non-existing group title check", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next year", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - } - ], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Group Next year doesn't exist in the board" - } - }, - { - "description": "check for item name", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next month", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - } - ], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Item name is required to create an item" - } - }, - { - "description": "Track call with columnToPropertyMapping and with groupTitle with all supported columns", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next month", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - }, - { - "from": "Checkbox", - "to": "checked" - }, - { - "from": "Numbers", - "to": "number" - }, - { - "from": "Name", - "to": "textKey" - }, - { - "from": "Country", - "to": "countryName" - }, - { - "from": "Location", - "to": "address" - }, - { - "from": "Phone", - "to": "phone" - }, - { - "from": "Rating", - "to": "rating" - }, - { - "from": "Link", - "to": "url" - }, - { - "from": "Long Text", - "to": "description" - }, - { - "from": "World Clock", - "to": "timezone" - } - ], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId", - "countryCode": "US", - "latitude": "51.23", - "longitude": "35.3", - "rating": "3", - "linkText": "websiteLink", - "checked": "true", - "number": "45", - "textKey": "texting", - "countryName": "Unites States", - "countryShortName": "US", - "address": "New York", - "phone": "2626277272", - "url": "demo.com", - "description": "property description", - "timezone": "America/New_York" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.monday.com/v2", - "headers": { - "Content-Type": "application/json", - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih" - }, - "params": {}, - "body": { - "JSON": { - "query": "mutation { create_item (board_id: 339283933, group_id: group_title item_name: \"Task 1\", column_values: \"{\\\"status\\\":{\\\"label\\\":\\\"Done\\\"},\\\"email\\\":{\\\"email\\\":\\\"abc@email.com\\\",\\\"text\\\":\\\"emailId\\\"},\\\"checkbox\\\":{\\\"checked\\\":true},\\\"numbers\\\":\\\"45\\\",\\\"text\\\":\\\"texting\\\",\\\"country\\\":{\\\"countryName\\\":\\\"Unites States\\\",\\\"countryCode\\\":\\\"US\\\"},\\\"location\\\":{\\\"address\\\":\\\"New York\\\",\\\"lat\\\":\\\"51.23\\\",\\\"lng\\\":\\\"35.3\\\"},\\\"phone\\\":{\\\"phone\\\":\\\"2626277272\\\",\\\"countryShortName\\\":\\\"US\\\"},\\\"rating\\\":3,\\\"link\\\":{\\\"url\\\":\\\"demo.com\\\",\\\"text\\\":\\\"websiteLink\\\"},\\\"long_text\\\":{\\\"text\\\":\\\"property description\\\"},\\\"world_clock\\\":{\\\"timezone\\\":\\\"America/New_York\\\"}}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "check for allowed event name from UI", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next month", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "Event Discarded. To allow this event, add this in Allowlist" - } - }, - { - "description": "check for deleted boards (configured boards are deleted)", - "input": { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283934", - "groupTitle": "Next year", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { - "from": "Email", - "to": "emailId" - } - ], - "whitelistedEvents": [ - { - "eventName": "create an item" - } - ] - } - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - "output": { - "error": "The board with boardId 339283934 does not exist" - } - } -] diff --git a/test/__tests__/data/monday_router_input.json b/test/__tests__/data/monday_router_input.json deleted file mode 100644 index 2770d23cb2..0000000000 --- a/test/__tests__/data/monday_router_input.json +++ /dev/null @@ -1,111 +0,0 @@ -[ - { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [{ "eventName": "create an item" }] - } - }, - "metadata": { - "jobId": 1 - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - }, - { - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next month", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { "from": "Email", "to": "emailId" } - ], - "whitelistedEvents": [{ "eventName": "create an item" }] - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "event": "create an item", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "name": "Task 1", - "status": "Done", - "emailId": "abc@email.com", - "emailText": "emailId" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - } -] diff --git a/test/__tests__/data/monday_router_output.json b/test/__tests__/data/monday_router_output.json deleted file mode 100644 index b0beb35a10..0000000000 --- a/test/__tests__/data/monday_router_output.json +++ /dev/null @@ -1,84 +0,0 @@ -[ - { - "batchedRequest": { - "body": { - "FORM": {}, - "JSON": { - "query": "mutation { create_item (board_id: 339283933, item_name: \"Task 1\", column_values: \"{}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.monday.com/v2", - "files": {}, - "headers": { - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "", - "columnToPropertyMapping": [], - "whitelistedEvents": [{ "eventName": "create an item" }] - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.monday.com/v2", - "headers": { - "Content-Type": "application/json", - "Authorization": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih" - }, - "params": {}, - "body": { - "JSON": { - "query": "mutation { create_item (board_id: 339283933, group_id: group_title item_name: \"Task 1\", column_values: \"{\\\"status\\\":{\\\"label\\\":\\\"Done\\\"},\\\"email\\\":{\\\"email\\\":\\\"abc@email.com\\\",\\\"text\\\":\\\"emailId\\\"}}\") {id}}" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiToken": "eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih", - "boardId": "339283933", - "groupTitle": "Next month", - "columnToPropertyMapping": [ - { - "from": "Status", - "to": "status" - }, - { "from": "Email", "to": "emailId" } - ], - "whitelistedEvents": [{ "eventName": "create an item" }] - } - } - } -] diff --git a/test/__tests__/data/profitwell_input.json b/test/__tests__/data/profitwell_input.json deleted file mode 100644 index e73a17ad37..0000000000 --- a/test/__tests__/data/profitwell_input.json +++ /dev/null @@ -1,719 +0,0 @@ -[ - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "context": { - "externalId": [ - { - "type": "profitwellUserId", - "id": "23453" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "1234" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - }, - { - "type": "profitwellSubscriptionId", - "id": "pws_FecTCEyo17rV" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - }, - { - "type": "profitwellSubscriptionId", - "id": "pws_FecTCEyo17rV" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active", - "effectiveDate": "1609748705" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - }, - { - "type": "profitwellSubscriptionId", - "id": "pws_FecTCEyo17rV" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "monthly", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active", - "effectiveDate": "1609748705" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - }, - { - "type": "profitwellSubscriptionId", - "id": "pws_FecTCEyo17rV" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "activate", - "effectiveDate": "1609748705" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": {} - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - }, - { - "type": "profitwellSubscriptionId", - "id": "pws_FecTCEyo17rV" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active", - "effectiveDate": "1609748705" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "profitwellUserId", - "id": "pwu_Oea7HXV3bnTP" - }, - { - "type": "profitwellSubscriptionId", - "id": "pws_FecTCEyo17" - } - ], - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active", - "effectiveDate": "1609748705" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - }, - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "message": { - "channel": "web", - "userId": "sp_245", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.9" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.9" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active", - "effectiveDate": 1609748705 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" - }, - "messageId": "6a5f38c0-4e75-4268-a066-2b73fbcad01f", - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "receivedAt": "2021-01-04T13:55:04.799+05:30", - "request_ip": "[::1]", - "rudderId": "79881a62-980a-4d76-89ca-7099440f8c13", - "sentAt": "2021-01-04T08:25:04.781Z", - "timestamp": "2021-09-06T14:15:06.798+05:30", - "type": "identify" - } - } -] diff --git a/test/__tests__/data/profitwell_output.json b/test/__tests__/data/profitwell_output.json deleted file mode 100644 index 04be6d990f..0000000000 --- a/test/__tests__/data/profitwell_output.json +++ /dev/null @@ -1,166 +0,0 @@ -[ - { - "statusCode": 400, - "error": "userId or userAlias is required for identify" - }, - { - "statusCode": 400, - "error": "No user found for profitwell user_id" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.profitwell.com/v2/subscriptions/", - "headers": { - "Content-Type": "application/json", - "Authorization": "9270161a8e5abaa0e56efddfd9dbcb62" - }, - "params": {}, - "body": { - "JSON": { - "subscription_alias": "samual", - "email": "sample@sample.com", - "plan_id": "23", - "plan_interval": "month", - "plan_currency": "usd", - "status": "active", - "value": "23", - "user_alias": "sp_245", - "effective_date": 1630917906 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "statusCode": 400, - "error": "subscriptionId or subscriptionAlias is required for identify" - }, - { - "statusCode": 400, - "error": "No user found for profitwell user_id" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.profitwell.com/v2/subscriptions/", - "headers": { - "Content-Type": "application/json", - "Authorization": "9270161a8e5abaa0e56efddfd9dbcb62" - }, - "params": {}, - "body": { - "JSON": { - "subscription_alias": "samual", - "email": "sample@sample.com", - "plan_id": "23", - "plan_interval": "month", - "plan_currency": "usd", - "status": "active", - "value": "23", - "user_id": "pwu_Oea7HXV3bnTP", - "user_alias": "sp_245", - "effective_date": 1630917906 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "statusCode": 400, - "error": "Missing required value from [\"traits.effectiveDate\",\"context.traits.effectiveDate\"]" - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/", - "headers": { - "Content-Type": "application/json", - "Authorization": "9270161a8e5abaa0e56efddfd9dbcb62" - }, - "params": {}, - "body": { - "JSON": { - "plan_id": "23", - "plan_interval": "month", - "value": "23", - "status": "active", - "effective_date": 1609748705 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "statusCode": 400, - "error": "invalid format for planInterval. Aborting" - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/", - "headers": { - "Content-Type": "application/json", - "Authorization": "9270161a8e5abaa0e56efddfd9dbcb62" - }, - "params": {}, - "body": { - "JSON": { - "plan_id": "23", - "plan_interval": "month", - "value": "23", - "effective_date": 1609748705 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "statusCode": 400, - "error": "Private API Key not found. Aborting." - }, - { - "statusCode": 400, - "error": "Profitwell subscription_id not found" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.profitwell.com/v2/subscriptions/", - "headers": { - "Content-Type": "application/json", - "Authorization": "9270161a8e5abaa0e56efddfd9dbcb62" - }, - "params": {}, - "body": { - "JSON": { - "subscription_alias": "samual", - "email": "sample@sample.com", - "plan_id": "23", - "plan_interval": "month", - "plan_currency": "usd", - "status": "active", - "value": "23", - "effective_date": 1609748705, - "user_alias": "sp_245" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } -] diff --git a/test/__tests__/data/profitwell_router_input.json b/test/__tests__/data/profitwell_router_input.json deleted file mode 100644 index 50903283a7..0000000000 --- a/test/__tests__/data/profitwell_router_input.json +++ /dev/null @@ -1,45 +0,0 @@ -[ - { - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "identify", - "userId": "samual", - "traits": { - "email": "sample@sample.com", - "planId": "23", - "planInterval": "month", - "planCurrency": "usd", - "value": "23", - "subscriptionAlias": "samual", - "status": "active" - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } -] diff --git a/test/__tests__/data/profitwell_router_output.json b/test/__tests__/data/profitwell_router_output.json deleted file mode 100644 index ca98903838..0000000000 --- a/test/__tests__/data/profitwell_router_output.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "batchedRequest": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "subscription_alias": "samual", - "email": "sample@sample.com", - "plan_id": "23", - "plan_interval": "month", - "plan_currency": "usd", - "status": "active", - "value": "23", - "user_alias": "samual", - "effective_date": 1571043797 - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/json", - "Authorization": "9270161a8e5abaa0e56efddfd9dbcb62" - }, - "version": "1", - "endpoint": "https://api.profitwell.com/v2/subscriptions/" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "privateApiKey": "9270161a8e5abaa0e56efddfd9dbcb62" - } - } - } -] diff --git a/test/__tests__/data/sendinblue.json b/test/__tests__/data/sendinblue.json deleted file mode 100644 index 06b6df14d9..0000000000 --- a/test/__tests__/data/sendinblue.json +++ /dev/null @@ -1,1196 +0,0 @@ -[ - { - "description": "Page call without email or phone", - "input": { - "message": { - "type": "page", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "name": "New Page", - "properties": { - "url": "https://www.google.com/", - "title": "Google home" - }, - "context": { - "traits": {}, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "At least one of `email` or `phone` is required" - } - }, - { - "description": "Page call", - "input": { - "message": { - "type": "page", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "name": "New Page", - "properties": { - "url": "https://www.google.com/", - "title": "Google home" - }, - "context": { - "traits": { - "email": "john_doe@example.com" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": false, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "page": "https://www.google.com/", - "properties": { - "ma_path": "/Testing/test/ourSdk.html", - "ma_referrer": "http://127.0.0.1:7307/Testing/test/", - "ma_title": "Google home", - "sib_name": "New Page" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackPage", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Track call without email or phone", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "Order Completed", - "properties": {}, - "context": { - "traits": { - "first_name": "John", - "lastName": "Doe" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "At least one of `email` or `phone` is required" - } - }, - { - "description": "Track call without event", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "properties": {}, - "context": {} - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "Event name is required" - } - }, - { - "description": "Track events with sendTraitsInTrack flag set to true", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "Order Completed", - "properties": {}, - "context": { - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "sendTraitsInTrack": true - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "event": "Order Completed", - "eventdata": {}, - "properties": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "SMS": "+919876543210", - "age": 19, - "location": "Mumbai", - "role": "SDE" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackEvent", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Track events with contactAttributeMapping provided in webapp", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "Order Completed", - "properties": {}, - "context": { - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ], - "sendTraitsInTrack": true - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "event": "Order Completed", - "eventdata": {}, - "properties": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "LOCATION": "Mumbai", - "SMS": "+919876543210", - "age": 19, - "role": "SDE" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackEvent", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Track events with propertiesIdKey provided in integration object", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "Order Completed", - "properties": { - "orderId": "1341394-3812392190", - "products": [ - { - "product_id": 1234, - "product_name": "Track Pants", - "amount": 1, - "price": 220 - }, - { - "product_id": 5768, - "product_name": "T-Shirt", - "amount": 5, - "price": 1058 - } - ] - }, - "context": { - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - } - }, - "integrations": { - "All": true, - "sendinblue": { - "propertiesIdKey": "orderId" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ], - "sendTraitsInTrack": true - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "event": "Order Completed", - "eventdata": { - "data": { - "orderId": "1341394-3812392190", - "products": [ - { - "amount": 1, - "price": 220, - "product_id": 1234, - "product_name": "Track Pants" - }, - { - "amount": 5, - "price": 1058, - "product_id": 5768, - "product_name": "T-Shirt" - } - ] - }, - "id": "1341394-3812392190" - }, - "properties": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "LOCATION": "Mumbai", - "SMS": "+919876543210", - "age": 19, - "role": "SDE" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackEvent", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Track events with eventdata.id taken from messageId", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "Order Completed", - "properties": { - "orderId": "1341394-3812392190", - "products": [ - { - "product_id": 1234, - "product_name": "Track Pants", - "amount": 1, - "price": 220 - }, - { - "product_id": 5768, - "product_name": "T-Shirt", - "amount": 5, - "price": 1058 - } - ] - }, - "context": { - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ], - "sendTraitsInTrack": true - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "event": "Order Completed", - "eventdata": { - "data": { - "orderId": "1341394-3812392190", - "products": [ - { - "amount": 1, - "price": 220, - "product_id": 1234, - "product_name": "Track Pants" - }, - { - "amount": 5, - "price": 1058, - "product_id": 5768, - "product_name": "T-Shirt" - } - ] - }, - "id": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff" - }, - "properties": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "LOCATION": "Mumbai", - "SMS": "+919876543210", - "age": 19, - "role": "SDE" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackEvent", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Track link without email or phone", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "trackLink", - "properties": { - "link": "https://www.google.com/gmail/", - "emailCount": 19 - }, - "context": { - "traits": {} - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "At least one of `email` or `phone` is required" - } - }, - { - "description": "Track link without link", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "trackLink", - "properties": {}, - "context": { - "traits": { - "phone": "+919507545089" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "Missing required value from \"properties.link\"" - } - }, - { - "description": "Track link", - "input": { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "trackLink", - "properties": { - "link": "https://www.google.com/gmail/", - "emailCount": 19 - }, - "context": { - "traits": { - "phone": "+919507545089" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "email": "919507545089@mailin-sms.com", - "link": "https://www.google.com/gmail/", - "properties": { - "emailCount": 19 - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackLink", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Identify call with invalid email", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { "email": "abc.com" }, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "The provided email is invalid" - } - }, - { - "description": "Identify call with invalid phone number", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { "phone": "99999999" }, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "The provided phone number is invalid" - } - }, - { - "description": "Identify call to create or update a contact without email or phone", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": { - "error": "At least one of `email` or `phone` is required" - } - }, - { - "description": "Identify call to create or update a contact", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "newEmail": "alex_root@example.com", - "role": "SDE" - }, - "context": { - "externalId": [ - { - "type": "sendinblueIncludeListIds", - "id": [1, 2] - } - ] - }, - "integrations": { - "All": true, - "sendinblue": { - "emailBlacklisted": true - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ] - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "attributes": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "LOCATION": "Mumbai", - "SMS": "+919876543210", - "EMAIL": "alex_root@example.com", - "age": 19, - "role": "SDE" - }, - "email": "john_doe@example.com", - "emailBlacklisted": true, - "listIds": [1, 2], - "updateEnabled": true - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Identify call to create DOI contact with templatedId from externalId", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - }, - "context": { - "externalId": [ - { - "type": "sendinblueIncludeListIds", - "id": [1, 2] - }, - { - "type": "sendinblueUnlinkListIds", - "id": [5] - }, - { - "type": "sendinblueTemplateId", - "id": 2 - } - ] - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "attributes": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "SMS": "+919876543210", - "age": 19, - "location": "Mumbai", - "role": "SDE" - }, - "email": "john_doe@example.com", - "includeListIds": [1, 2], - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard", - "templateId": 3 - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts/doubleOptinConfirmation", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Identify call to create DOI contact without include list Ids", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - }, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "error": "sendinblueIncludeListIds is required to create a contact using DOI" - } - }, - { - "description": "Identify call to create DOI contact without template Id", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - }, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "error": "templateId is required to create a contact using DOI" - } - }, - { - "description": "Identify call to update a DOI contact without an email or contact ID", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "Gordon", - "lastName": "Pittman", - "age": 19, - "location": "Mumbai", - "role": "SDE" - }, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "error": "At least one of `email` or `contactId` is required to update the contact using DOI" - } - }, - { - "description": "Identify call to update a DOI contact using contactId as an Identifier and without include list Ids", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "age": 36, - "location": "Mumbai", - "role": "SDE 2" - }, - "context": { - "externalId": [ - { - "type": "sendinblueContactId", - "id": 42 - } - ] - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "attributes": { - "age": 36, - "location": "Mumbai", - "role": "SDE 2" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts/42", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "PUT", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Identify call to update a DOI contact using email as an Identifier and without include list Ids", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "age": 36, - "location": "Mumbai", - "role": "SDE 2", - "phone": "+918888888888", - "email": "gordon_pittman@example.com", - "newEmail": "gordon_pittman007@example.com" - }, - "context": { - "externalId": [ - { - "type": "sendinblueIncludeListIds", - "id": [1] - }, - { - "type": "sendinblueUnlinkListIds", - "id": [2] - } - ] - }, - "integrations": { - "All": true, - "sendinblue": { - "emailBlacklisted": true, - "smsBlacklisted": false - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - "attributes": { - "age": 36, - "location": "Mumbai", - "role": "SDE 2", - "SMS": "+918888888888", - "EMAIL": "gordon_pittman007@example.com" - }, - "emailBlacklisted": true, - "smsBlacklisted": false, - "listIds": [1], - "unlinkListIds": [2] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts/gordon_pittman%40example.com", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "PUT", - "params": {}, - "type": "REST", - "version": "1" - } - }, - { - "description": "Identify call to unlink a contact from given lists", - "input": { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "email": "eric_kim@example.com" - }, - "context": { - "externalId": [ - { - "type": "sendinblueUnlinkListIds", - "id": [2, 5] - } - ] - } - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false - } - } - }, - "output": [ - { - "body": { - "FORM": {}, - "JSON": { - "emails": ["eric_kim@example.com"] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts/lists/2/contacts/remove", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - { - "body": { - "FORM": {}, - "JSON": { - "emails": ["eric_kim@example.com"] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts/lists/5/contacts/remove", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ] - } -] diff --git a/test/__tests__/data/sendinblue_router_input.json b/test/__tests__/data/sendinblue_router_input.json deleted file mode 100644 index 1f2b8a1dc2..0000000000 --- a/test/__tests__/data/sendinblue_router_input.json +++ /dev/null @@ -1,187 +0,0 @@ -[ - { - "message": { - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "event": "Order Completed", - "properties": { - "orderId": "1341394-3812392190", - "products": [ - { - "product_id": 1234, - "product_name": "Track Pants", - "amount": 1, - "price": 220 - }, - { - "product_id": 5768, - "product_name": "T-Shirt", - "amount": 5, - "price": 1058 - } - ] - }, - "context": { - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ], - "sendTraitsInTrack": true - } - } - }, - { - "message": { - "type": "page", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "name": "New Page", - "properties": { - "url": "https://www.google.com/", - "title": "Google home" - }, - "context": { - "traits": { - "email": "john_doe@example.com" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": false, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - }, - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "newEmail": "alex_root@example.com", - "role": "SDE" - }, - "context": { - "externalId": [ - { - "type": "sendinblueIncludeListIds", - "id": [1, 2] - } - ] - }, - "integrations": { - "All": true, - "sendinblue": { - "emailBlacklisted": true - } - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ] - } - } - }, - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "channel": "web", - "traits": { - "first_name": "John", - "lastName": "Doe", - "age": 19, - "email": "john_doe@example.com", - "phone": "+919876543210", - "location": "Mumbai", - "role": "SDE" - }, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - } -] diff --git a/test/__tests__/data/sendinblue_router_output.json b/test/__tests__/data/sendinblue_router_output.json deleted file mode 100644 index c15c15205c..0000000000 --- a/test/__tests__/data/sendinblue_router_output.json +++ /dev/null @@ -1,196 +0,0 @@ -[ - { - "batched": false, - "batchedRequest": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "event": "Order Completed", - "eventdata": { - "data": { - "orderId": "1341394-3812392190", - "products": [ - { - "amount": 1, - "price": 220, - "product_id": 1234, - "product_name": "Track Pants" - }, - { - "amount": 5, - "price": 1058, - "product_id": 5768, - "product_name": "T-Shirt" - } - ] - }, - "id": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff" - }, - "properties": { - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "LOCATION": "Mumbai", - "SMS": "+919876543210", - "age": 19, - "role": "SDE" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackEvent", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ], - "doi": false, - "sendTraitsInTrack": true - } - }, - "metadata": [ - { - "jobId": 1 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": { - "body": { - "FORM": {}, - "JSON": { - "email": "john_doe@example.com", - "page": "https://www.google.com/", - "properties": { - "ma_path": "/Testing/test/ourSdk.html", - "ma_referrer": "http://127.0.0.1:7307/Testing/test/", - "ma_title": "Google home", - "sib_name": "New Page" - } - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://in-automate.sendinblue.com/api/v2/trackPage", - "files": {}, - "headers": { - "Content-Type": "application/json", - "ma-key": "clientKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "doi": false, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard", - "templateId": 3 - } - }, - "metadata": [ - { - "jobId": 2 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": { - "body": { - "FORM": {}, - "JSON": { - "attributes": { - "EMAIL": "alex_root@example.com", - "FIRSTNAME": "John", - "LASTNAME": "Doe", - "LOCATION": "Mumbai", - "SMS": "+919876543210", - "age": 19, - "role": "SDE" - }, - "email": "john_doe@example.com", - "emailBlacklisted": true, - "listIds": [1, 2], - "updateEnabled": true - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.sendinblue.com/v3/contacts", - "files": {}, - "headers": { - "Content-Type": "application/json", - "api-key": "apiKey123" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "contactAttributeMapping": [ - { - "from": "location", - "to": "LOCATION" - } - ], - "doi": false - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "error": "sendinblueIncludeListIds is required to create a contact using DOI", - "metadata": [ - { - "jobId": 4 - } - ], - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "statusCode": 400, - "destination": { - "Config": { - "apiKey": "apiKey123", - "clientKey": "clientKey123", - "templateId": 3, - "doi": true, - "redirectionUrl": "https://app.sendinblue.com/marketing-dashboard" - } - } - } -] diff --git a/test/__tests__/gainsight.test.js b/test/__tests__/gainsight.test.js deleted file mode 100644 index b0ff8d27b7..0000000000 --- a/test/__tests__/gainsight.test.js +++ /dev/null @@ -1,48 +0,0 @@ -const integration = "gainsight"; -const name = "Gainsight CS"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/gainsight_px.test.js b/test/__tests__/gainsight_px.test.js deleted file mode 100644 index 24b96d008d..0000000000 --- a/test/__tests__/gainsight_px.test.js +++ /dev/null @@ -1,48 +0,0 @@ -const integration = "gainsight_px"; -const name = "Gainsight PX"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/klaviyo.test.js b/test/__tests__/klaviyo.test.js deleted file mode 100644 index 209811b007..0000000000 --- a/test/__tests__/klaviyo.test.js +++ /dev/null @@ -1,47 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const integration = "klaviyo"; -const name = "Klaviyo"; -const version = "v0"; - -const { FEATURE_FILTER_CODE } = require('../../src/v0/util/constant'); -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test Data -const routerTestDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router.json`) -); -const routerTestData = JSON.parse(routerTestDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router", () => { - routerTestData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - const oldTransformerOutput = await transformer.processRouterDest(dataPoint.input); - const newTransformerOutput = await transformer.processRouterDest(dataPoint.input, { features: { [FEATURE_FILTER_CODE]: true } }); - expect(oldTransformerOutput).toEqual(dataPoint.oldTransformerOutput); - expect(newTransformerOutput).toEqual(dataPoint.newTransformerOutput); - }); - }); - }); -}); diff --git a/test/__tests__/kustomer.test.js b/test/__tests__/kustomer.test.js deleted file mode 100644 index 89c5e844a9..0000000000 --- a/test/__tests__/kustomer.test.js +++ /dev/null @@ -1,49 +0,0 @@ -const integration = "kustomer"; -const name = "Kustomer"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/mailchimp.test.js b/test/__tests__/mailchimp.test.js deleted file mode 100644 index 5da9d572f7..0000000000 --- a/test/__tests__/mailchimp.test.js +++ /dev/null @@ -1,67 +0,0 @@ -const integration = "mailchimp"; -const name = "Mailchimp"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -const batchInputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_batch_input.json`) -); -const batchOutputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_batch_output.json`) -); - -const batchInputData = JSON.parse(batchInputDataFile); -const batchExpectedData = JSON.parse(batchOutputDataFile); - -describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); - - describe("Batching", () => { - it("Payload", async () => { - const output = await transformer.processRouterDest(batchInputData); - expect(Array.isArray(output)).toEqual(true); - expect(output).toEqual(batchExpectedData); - }); - }); -}); diff --git a/test/__tests__/monday.test.js b/test/__tests__/monday.test.js deleted file mode 100644 index 0344cfcf75..0000000000 --- a/test/__tests__/monday.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const integration = "monday"; -const name = "Monday"; -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/profitwell.test.js b/test/__tests__/profitwell.test.js deleted file mode 100644 index 99ed1a4c43..0000000000 --- a/test/__tests__/profitwell.test.js +++ /dev/null @@ -1,62 +0,0 @@ -const fs = require("fs"); -const path = require("path"); -const { mockaxios } = require("../__mocks__/network"); - -const integration = "profitwell"; -const name = "profitwell"; -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -jest.mock("../../src/adapters/network", () => { - const originalModule = jest.requireActual("../../src/adapters/network"); - - //Mock the default export and named export 'send' - return { - __esModule: true, - ...originalModule, - send: jest.fn(mockaxios) - }; -}); - -describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/sendinblue.test.js b/test/__tests__/sendinblue.test.js deleted file mode 100644 index 063f5bf282..0000000000 --- a/test/__tests__/sendinblue.test.js +++ /dev/null @@ -1,47 +0,0 @@ -const integration = "sendinblue"; -const name = "Sendinblue"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach(async (dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/integrations/destinations/am/router/data.ts b/test/integrations/destinations/am/router/data.ts index 64701c78a1..7f2e1d0329 100644 --- a/test/integrations/destinations/am/router/data.ts +++ b/test/integrations/destinations/am/router/data.ts @@ -1,316 +1,318 @@ export const data = [ - { - name: 'am', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "abcde", - "groupTypeTrait": "email", - "groupValueTrait": "age" - } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "request_ip": "1.1.1.1", - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "abcde" - } - } - } - ], - destType: 'am', + { + name: 'am', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/amplitude', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/amplitude', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'abcde', + groupTypeTrait: 'email', + groupValueTrait: 'age', }, - method: 'POST', + }, }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/amplitude', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/amplitude', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + request_ip: '1.1.1.1', + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/destinations/amplitude', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/amplitude', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'abcde', + }, + }, + }, + ], + destType: 'am', }, - output: { - response: { - status: 200, - body: { - output: [ + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api2.amplitude.com/2/httpapi', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + api_key: 'abcde', + events: [ { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api2.amplitude.com/2/httpapi", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "api_key": "abcde", - "events": [ - { - "os_name": "Chrome", - "os_version": "77.0.3865.90", - "device_model": "Mac", - "library": "rudderstack", - "platform": "Web", - "device_id": "123456", - "app_name": "RudderLabs JavaScript SDK", - "app_version": "1.0.0", - "language": "en-US", - "session_id": -1, - "insert_id": "84e26acc-56a5-4835-8233-591137fca468", - "city": "kolkata", - "country": "India", - "user_properties": { - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com", - "anonymousId": "123456", - "email": "test@rudderstack.com", - "postalCode": 712136, - "state": "WB", - "street": "", - "ip": "0.0.0.0", - "age": 26 - }, - "event_type": "$identify", - "time": 1571043797562, - "user_id": "123456", - "ip": "0.0.0.0" - } - ], - "options": { - "min_id_length": 1 - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - } - ], - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde", - "groupTypeTrait": "email", - "groupValueTrait": "age" - } - } + os_name: 'Chrome', + os_version: '77.0.3865.90', + device_model: 'Mac', + library: 'rudderstack', + platform: 'Web', + device_id: '123456', + app_name: 'RudderLabs JavaScript SDK', + app_version: '1.0.0', + language: 'en-US', + session_id: -1, + insert_id: '84e26acc-56a5-4835-8233-591137fca468', + city: 'kolkata', + country: 'India', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + anonymousId: '123456', + email: 'test@rudderstack.com', + postalCode: 712136, + state: 'WB', + street: '', + ip: '0.0.0.0', + age: 26, + }, + event_type: '$identify', + time: 1571043797562, + user_id: '123456', + ip: '0.0.0.0', }, + ], + options: { + min_id_length: 1, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + ], + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'abcde', + groupTypeTrait: 'email', + groupValueTrait: 'age', + }, + }, + }, + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api2.amplitude.com/2/httpapi', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + api_key: 'abcde', + events: [ { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api2.amplitude.com/2/httpapi", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "api_key": "abcde", - "events": [ - { - "os_name": "Chrome", - "os_version": "77.0.3865.90", - "device_model": "Mac", - "library": "rudderstack", - "platform": "Web", - "device_id": "00000000000000000000000000", - "app_name": "RudderLabs JavaScript SDK", - "app_version": "1.0.0", - "language": "en-US", - "event_type": "Viewed ApplicationLoaded Page", - "event_properties": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com", - "name": "ApplicationLoaded" - }, - "session_id": -1, - "insert_id": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "ip": "1.1.1.1", - "user_properties": { - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com", - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "user_id": "12345", - "time": 1571051718299 - } - ], - "options": { - "min_id_length": 1 - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "00000000000000000000000000" - } - ], - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde" - } - } - } - ], + os_name: 'Chrome', + os_version: '77.0.3865.90', + device_model: 'Mac', + library: 'rudderstack', + platform: 'Web', + device_id: '00000000000000000000000000', + app_name: 'RudderLabs JavaScript SDK', + app_version: '1.0.0', + language: 'en-US', + event_type: 'Viewed ApplicationLoaded Page', + event_properties: { + path: '/destinations/amplitude', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/amplitude', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + name: 'ApplicationLoaded', + }, + session_id: -1, + insert_id: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + ip: '1.1.1.1', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + user_id: '12345', + time: 1571051718299, + }, + ], + options: { + min_id_length: 1, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '00000000000000000000000000', + }, + ], + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'abcde', }, + }, }, + ], }, - } + }, + }, + }, ]; diff --git a/test/integrations/destinations/bingads_audience/processor/data.ts b/test/integrations/destinations/bingads_audience/processor/data.ts index 138bac7e82..b61f4efea8 100644 --- a/test/integrations/destinations/bingads_audience/processor/data.ts +++ b/test/integrations/destinations/bingads_audience/processor/data.ts @@ -1,1130 +1,1155 @@ export const data = [ - { - "name": "bingads_audience", - "description": "unhashed email available with hashEmail as true in config", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "alex@email.com" - }, - { - "email": "amy@abc.com" - }, - { - "email": "van@abc.com" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b", - "email": "alex@email.com" - }, - { - "hashedEmail": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579", - "email": "amy@abc.com" - }, - { - "hashedEmail": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c", - "email": "van@abc.com" - } - ], - "action": "Add" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "destinationId": 1234 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "hashed email available with hashEmail as false in config", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - }, - { - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": false - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b", - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "hashedEmail": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579", - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - }, - { - "hashedEmail": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c", - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ], - "action": "Add" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "destinationId": 1234 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "Unsupported action type", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "addition": [ - { - "email": "alex@email.com" - }, - { - "email": "amy@abc.com" - }, - { - "email": "van@abc.com" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationId": 1234 - }, - "statusCode": 400, - "error": "unsupported action type. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: unsupported action type. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "implementation": "cdkV2", - "destType": "BINGADS_AUDIENCE", - "module": "destination", - "feature": "processor", - "destinationId": 1234 - } - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "Unsupported event type", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "track", - "properties": { - "listData": { - "add": [ - { - "email": "alex@email.com" - }, - { - "email": "amy@abc.com" - }, - { - "email": "van@abc.com" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationId": 1234 - }, - "statusCode": 400, - "error": "Event type track is not supported. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Event type track is not supported. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "implementation": "cdkV2", - "destType": "BINGADS_AUDIENCE", - "module": "destination", - "feature": "processor", - "destinationId": 1234 - } - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "event type not present", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "", - "properties": { - "listData": { - "add": [ - { - "email": "alex@email.com" - }, - { - "email": "amy@abc.com" - }, - { - "email": "van@abc.com" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationId": 1234 - }, - "statusCode": 400, - "error": "message Type is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message Type is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "implementation": "cdkV2", - "destType": "BINGADS_AUDIENCE", - "module": "destination", - "feature": "processor", - "destinationId": 1234 - } - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "Message properties is not present", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationId": 1234 - }, - "statusCode": 400, - "error": "Message properties is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Message properties is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "implementation": "cdkV2", - "destType": "BINGADS_AUDIENCE", - "module": "destination", - "feature": "processor", - "destinationId": 1234 - } - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "listData is not present in properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": {}, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationId": 1234 - }, - "statusCode": 400, - "error": "listData is not present inside properties. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: listData is not present inside properties. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "implementation": "cdkV2", - "destType": "BINGADS_AUDIENCE", - "module": "destination", - "feature": "processor", - "destinationId": 1234 - } - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "Both add and remove are present in listData", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "remove": [ - { - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - }, - { - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ], - "update": [ - { - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - }, - { - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": false - }, - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - } - }, - "metadata": { - "destinationId": 1234 - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b", - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "hashedEmail": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579", - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - }, - { - "hashedEmail": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c", - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ], - "action": "Remove" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "destinationId": 1234 - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b", - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "hashedEmail": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579", - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - }, - { - "hashedEmail": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c", - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ], - "action": "Replace" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "destinationId": 1234 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "Only single user data is present", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "alex@email.com" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - }, - "Config": { - "customerAccountId": "89236978", - "customerId": "78678678", - "audienceId": "564567", - "hashEmail": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b", - "email": "alex@email.com" - } - ], - "action": "Add" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "unhashed email available with hashEmail as true in config", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - message: { - userId: 'user 1', - type: 'audiencelist', - properties: { - listData: { - add: [ - { - email: 'alex@email.com', - }, - { - email: 'amy@abc.com', - }, - { - email: 'van@abc.com', - }, - ], - }, - }, - context: { - ip: '14.5.67.21', - library: { - name: 'http', - }, - }, - timestamp: '2020-02-02T00:23:09.544Z', - }, - destination: { - DestinationDefinition: { - "Config": { - "cdkV2Enabled": true - } - }, - Config: { - customerAccountId: '89236978', - customerId: '78678678', - audienceId: '564567', - hashEmail: true, - }, - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationType": "", - "namespace": "", - "sourceType": "", - }, - "output": { - "body": { - "FORM": {}, - "JSON": { - list: [ - { - hashedEmail: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', - email: 'alex@email.com', - }, - { - hashedEmail: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', - email: 'amy@abc.com', - }, - { - hashedEmail: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', - email: 'van@abc.com', - }, - ], - action: 'Add', - }, - "JSON_ARRAY": {}, - "XML": {}, - }, - "endpoint": "", - "files": {}, - "headers": {}, - "method": "POST", - "params": {}, - "type": "REST", - "userId": "", - "version": "1", - }, - "statusCode": 200, - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "hashed email available with hashEmail as false in config", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - message: { - userId: 'user 1', - type: 'audiencelist', - properties: { - listData: { - update: [ - { - email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', - }, - { - email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', - }, - ], - remove: [ - { - email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', - }, - ], - }, - }, - context: { - ip: '14.5.67.21', - library: { - name: 'http', - }, - }, - timestamp: '2020-02-02T00:23:09.544Z', - }, - destination: { - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - }, - Config: { - customerAccountId: '89236978', - customerId: '78678678', - audienceId: '564567', - hashEmail: false, - }, - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b", - "email": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b" - }, - { - "hashedEmail": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579", - "email": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579" - } - ], - "action": "Replace" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "list": [ - { - "hashedEmail": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c", - "email": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c" - } - ], - "action": "Remove" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "bingads_audience", - "description": "validateInput should fail when properties are missing", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - message: { - userId: 'user 1', - type: 'audiencelist', - context: { - ip: '14.5.67.21', - library: { - name: 'http', - }, - }, - timestamp: '2020-02-02T00:23:09.544Z', - }, - destination: { - "DestinationDefinition": { - "Config": { - "cdkV2Enabled": true - } - }, - Config: { - customerAccountId: '89236978', - customerId: '78678678', - audienceId: '564567', - hashEmail: false, - }, - }, - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "sourceType": "", - "destinationType": "", - "namespace": "" - }, - "statusCode": 400, - "error": "Message properties is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Message properties is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "implementation": "cdkV2", - "destType": "BINGADS_AUDIENCE", - "module": "destination", - "feature": "processor" - } - } - ] - } - } - } -] \ No newline at end of file + { + name: 'bingads_audience', + description: 'unhashed email available with hashEmail as true in config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + email: 'alex@email.com', + }, + { + email: 'amy@abc.com', + }, + { + email: 'van@abc.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'alex@email.com', + }, + { + hashedEmail: + '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + email: 'amy@abc.com', + }, + { + hashedEmail: + '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + email: 'van@abc.com', + }, + ], + action: 'Add', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + destinationId: 1234, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'hashed email available with hashEmail as false in config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + { + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: false, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + hashedEmail: + '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + { + hashedEmail: + '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + action: 'Add', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + destinationId: 1234, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'Unsupported action type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + addition: [ + { + email: 'alex@email.com', + }, + { + email: 'amy@abc.com', + }, + { + email: 'van@abc.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationId: 1234, + }, + statusCode: 400, + error: + 'unsupported action type. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: unsupported action type. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'cdkV2', + destType: 'BINGADS_AUDIENCE', + module: 'destination', + feature: 'processor', + destinationId: 1234, + }, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'Unsupported event type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'track', + properties: { + listData: { + add: [ + { + email: 'alex@email.com', + }, + { + email: 'amy@abc.com', + }, + { + email: 'van@abc.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationId: 1234, + }, + statusCode: 400, + error: + 'Event type track is not supported. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Event type track is not supported. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'cdkV2', + destType: 'BINGADS_AUDIENCE', + module: 'destination', + feature: 'processor', + destinationId: 1234, + }, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'event type not present', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: '', + properties: { + listData: { + add: [ + { + email: 'alex@email.com', + }, + { + email: 'amy@abc.com', + }, + { + email: 'van@abc.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationId: 1234, + }, + statusCode: 400, + error: + 'message Type is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message Type is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'cdkV2', + destType: 'BINGADS_AUDIENCE', + module: 'destination', + feature: 'processor', + destinationId: 1234, + }, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'Message properties is not present', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationId: 1234, + }, + statusCode: 400, + error: + 'Message properties is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Message properties is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'cdkV2', + destType: 'BINGADS_AUDIENCE', + module: 'destination', + feature: 'processor', + destinationId: 1234, + }, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'listData is not present in properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: {}, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationId: 1234, + }, + statusCode: 400, + error: + 'listData is not present inside properties. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: listData is not present inside properties. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'cdkV2', + destType: 'BINGADS_AUDIENCE', + module: 'destination', + feature: 'processor', + destinationId: 1234, + }, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'Both add and remove are present in listData', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + remove: [ + { + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + { + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + update: [ + { + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + { + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: false, + }, + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + }, + metadata: { + destinationId: 1234, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + hashedEmail: + '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + { + hashedEmail: + '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + action: 'Remove', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + destinationId: 1234, + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + hashedEmail: + '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + { + hashedEmail: + '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + action: 'Replace', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + destinationId: 1234, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'Only single user data is present', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + email: 'alex@email.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'alex@email.com', + }, + ], + action: 'Add', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'unhashed email available with hashEmail as true in config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + email: 'alex@email.com', + }, + { + email: 'amy@abc.com', + }, + { + email: 'van@abc.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: true, + }, + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationType: '', + namespace: '', + sourceType: '', + }, + output: { + body: { + FORM: {}, + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'alex@email.com', + }, + { + hashedEmail: + '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + email: 'amy@abc.com', + }, + { + hashedEmail: + '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + email: 'van@abc.com', + }, + ], + action: 'Add', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: '', + files: {}, + headers: {}, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'hashed email available with hashEmail as false in config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + update: [ + { + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + ], + remove: [ + { + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: false, + }, + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + email: 'ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b', + }, + { + hashedEmail: + '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + email: '49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579', + }, + ], + action: 'Replace', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: '', + headers: {}, + params: {}, + body: { + JSON: { + list: [ + { + hashedEmail: + '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + email: '2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c', + }, + ], + action: 'Remove', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'bingads_audience', + description: 'validateInput should fail when properties are missing', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user 1', + type: 'audiencelist', + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + customerAccountId: '89236978', + customerId: '78678678', + audienceId: '564567', + hashEmail: false, + }, + }, + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + sourceType: '', + destinationType: '', + namespace: '', + }, + statusCode: 400, + error: + 'Message properties is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Message properties is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'cdkV2', + destType: 'BINGADS_AUDIENCE', + module: 'destination', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/braze/processor/data.ts b/test/integrations/destinations/braze/processor/data.ts index 9adde226a0..58c54bb232 100644 --- a/test/integrations/destinations/braze/processor/data.ts +++ b/test/integrations/destinations/braze/processor/data.ts @@ -3701,81 +3701,82 @@ export const data = [ request: { body: [ { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "sendPurchaseEventWithExtraProperties": true - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "traits": { - "city": "Disney", - "country": "USA", - "email": null, - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "event": "Order Completed", - "integrations": { - "All": true - }, - "messageId": "aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a", - "originalTimestamp": "2020-01-24T06:29:02.367Z", - "properties": { - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "coupon": "hasbros", - "currency": "USD", - "discount": 2.5, - "order_id": "50314b8e9bcf000000000000", - "products": [ + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + sendPurchaseEventWithExtraProperties: true, + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + traits: { + city: 'Disney', + country: 'USA', + email: null, + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + event: 'Order Completed', + integrations: { + All: true, + }, + messageId: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + originalTimestamp: '2020-01-24T06:29:02.367Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ { - "category": "Games", - "image_url": "https:///www.example.com/product/path.jpg", - "name": "Monopoly: 3rd Edition", - "price": 0, - "product_id": "507f1f77bcf86cd799439023", - "quantity": 1, - "sku": "45790-32", - "url": "https://www.example.com/product/path" + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 0, + product_id: '507f1f77bcf86cd799439023', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', }, { - "category": "Games", - "name": "Uno Card Game", - "price": 0, - "product_id": "505bd76785ebb509fc183724", - "quantity": 2, - "sku": "46493-32" - } + category: 'Games', + name: 'Uno Card Game', + price: 0, + product_id: '505bd76785ebb509fc183724', + quantity: 2, + sku: '46493-32', + }, ], - "revenue": 25, - "shipping": 3, - "subtotal": 22.5, - "tax": 2, - "total": 27.5 - }, - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53712", - "sentAt": "2020-01-24T06:29:02.368Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "track", - "userId": "" - } + revenue: 25, + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + }, + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53712', + sentAt: '2020-01-24T06:29:02.368Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'track', + userId: '', + }, }, ], }, @@ -3783,82 +3784,83 @@ export const data = [ output: { response: { status: 200, - body: [{ - output: { - "body": { - "FORM": {}, - "JSON": { - "attributes": [ - { - "_update_existing_only": false, - "city": "Disney", - "country": "USA", - "email": null, - "firstname": "Mickey", - "user_alias": { - "alias_label": "rudder_id", - "alias_name": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca" - } - } - ], - "partner": "RudderStack", - "purchases": [ - { - "_update_existing_only": false, - "currency": "USD", - "price": 0, - "product_id": "507f1f77bcf86cd799439023", - "properties": { - "category": "Games", - "image_url": "https:///www.example.com/product/path.jpg", - "name": "Monopoly: 3rd Edition", - "url": "https://www.example.com/product/path" + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + attributes: [ + { + _update_existing_only: false, + city: 'Disney', + country: 'USA', + email: null, + firstname: 'Mickey', + user_alias: { + alias_label: 'rudder_id', + alias_name: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, }, - "quantity": 1, - "time": "2020-01-24T11:59:02.402+05:30", - "user_alias": { - "alias_label": "rudder_id", - "alias_name": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca" - } - }, - { - "_update_existing_only": false, - "currency": "USD", - "price": 0, - "product_id": "505bd76785ebb509fc183724", - "properties": { - "category": "Games", - "name": "Uno Card Game" + ], + partner: 'RudderStack', + purchases: [ + { + _update_existing_only: false, + currency: 'USD', + price: 0, + product_id: '507f1f77bcf86cd799439023', + properties: { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + url: 'https://www.example.com/product/path', + }, + quantity: 1, + time: '2020-01-24T11:59:02.402+05:30', + user_alias: { + alias_label: 'rudder_id', + alias_name: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, }, - "quantity": 2, - "time": "2020-01-24T11:59:02.402+05:30", - "user_alias": { - "alias_label": "rudder_id", - "alias_name": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://rest.fra-01.braze.eu/users/track", - "files": {}, - "headers": { - "Accept": "application/json", - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "version": "1" + { + _update_existing_only: false, + currency: 'USD', + price: 0, + product_id: '505bd76785ebb509fc183724', + properties: { + category: 'Games', + name: 'Uno Card Game', + }, + quantity: 2, + time: '2020-01-24T11:59:02.402+05:30', + user_alias: { + alias_label: 'rudder_id', + alias_name: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://rest.fra-01.braze.eu/users/track', + files: {}, + headers: { + Accept: 'application/json', + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + version: '1', + }, + statusCode: 200, }, - statusCode: 200, - }, ], }, }, - } + }, ]; diff --git a/test/integrations/destinations/braze/router/data.ts b/test/integrations/destinations/braze/router/data.ts index 240f1333dd..2e3be35b01 100644 --- a/test/integrations/destinations/braze/router/data.ts +++ b/test/integrations/destinations/braze/router/data.ts @@ -1,919 +1,925 @@ export const data = [ - { - name: 'braze', - description: 'simple router tests', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ + { + name: 'braze', + description: 'simple router tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'eu-01', + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + jobId: 1, + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + originalTimestamp: '2020-01-24T06:29:02.358Z', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + }, + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.359Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'page', + userId: '', + }, + }, + { + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'us-01', + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53709', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '', + }, + }, + { + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'us-01', + enableSubscriptionGroupInGroupCall: true, + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + jobId: 3, + }, + message: { + anonymousId: '56yrtsdfgbgxcb-22b4-401d-aae5-1b994be9a969', + groupId: 'c90f0fd2-2a02-4f2f-bf07-7e7d2c2ed2b1', + traits: { + phone: '5055077683', + subscriptionState: 'subscribed', + }, + userId: 'user123', + type: 'group', + }, + }, + { + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'us-01', + enableSubscriptionGroupInGroupCall: true, + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + jobId: 4, + }, + message: { + anonymousId: 'dfgdfgdfg-22b4-401d-aae5-1b994be9a969', + groupId: '58d0a278-b55b-4f10-b7d2-98d1c5dd4c30', + traits: { + phone: '5055077683', + subscriptionState: 'subscribed', + }, + userId: 'user877', + type: 'group', + }, + }, + { + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'us-01', + enableSubscriptionGroupInGroupCall: true, + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + jobId: 5, + }, + message: { + type: 'alias', + previousId: 'adsfsaf', + userId: 'dsafsdf', + }, + }, + { + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'us-01', + enableSubscriptionGroupInGroupCall: true, + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + jobId: 6, + }, + message: { + type: 'alias', + previousId: 'adsfsaf2', + userId: 'dsafsdf2', + }, + }, + ], + destType: 'braze', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rest.fra-01.braze.eu/users/track', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + partner: 'RudderStack', + events: [ { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "eu-01" - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "jobId": 1 - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "originalTimestamp": "2020-01-24T06:29:02.358Z", - "properties": { - "path": "/tests/html/index2.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index2.html" - }, - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.359Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "page", - "userId": "" - } + name: 'Page Viewed', + time: '2020-01-24T11:59:02.402+05:30', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + }, + _update_existing_only: false, + user_alias: { + alias_name: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + alias_label: 'rudder_id', + }, }, + ], + attributes: [ { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "us-01" - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53709", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "" - } + email: 'mickey@disney.com', + city: 'Disney', + country: 'USA', + firstname: 'Mickey', + _update_existing_only: false, + user_alias: { + alias_name: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + alias_label: 'rudder_id', + }, }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rest.fra-01.braze.eu/v2/subscription/status/set', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + subscription_groups: [ { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "us-01", - "enableSubscriptionGroupInGroupCall": true - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "jobId": 3 - }, - "message": { - "anonymousId": "56yrtsdfgbgxcb-22b4-401d-aae5-1b994be9a969", - "groupId": "c90f0fd2-2a02-4f2f-bf07-7e7d2c2ed2b1", - "traits": { - "phone": "5055077683", - "subscriptionState": "subscribed" - }, - "userId": "user123", - "type": "group" - } + external_id: ['user123'], + phones: ['5055077683'], + subscription_group_id: 'c90f0fd2-2a02-4f2f-bf07-7e7d2c2ed2b1', + subscription_state: 'subscribed', }, { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "us-01", - "enableSubscriptionGroupInGroupCall": true - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "jobId": 4 - }, - "message": { - "anonymousId": "dfgdfgdfg-22b4-401d-aae5-1b994be9a969", - "groupId": "58d0a278-b55b-4f10-b7d2-98d1c5dd4c30", - "traits": { - "phone": "5055077683", - "subscriptionState": "subscribed" - }, - "userId": "user877", - "type": "group" - } + external_id: ['user877'], + phones: ['5055077683'], + subscription_group_id: '58d0a278-b55b-4f10-b7d2-98d1c5dd4c30', + subscription_state: 'subscribed', }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rest.fra-01.braze.eu/users/merge', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + merge_updates: [ { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "us-01", - "enableSubscriptionGroupInGroupCall": true - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "jobId": 5 - }, - "message": { - "type": "alias", - "previousId": "adsfsaf", - "userId": "dsafsdf" - } + identifier_to_keep: { + external_id: 'dsafsdf', + }, + identifier_to_merge: { + external_id: 'adsfsaf', + }, }, { - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "us-01", - "enableSubscriptionGroupInGroupCall": true - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "jobId": 6 - }, - "message": { - "type": "alias", - "previousId": "adsfsaf2", - "userId": "dsafsdf2" - } - } - ], - destType: 'braze', - }, - method: 'POST', + identifier_to_keep: { + external_id: 'dsafsdf2', + }, + identifier_to_merge: { + external_id: 'adsfsaf2', + }, + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + { + jobId: 3, + }, + { + jobId: 4, + }, + { + jobId: 5, + }, + { + jobId: 6, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + restApiKey: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + dataCenter: 'eu-01', + }, + DestinationDefinition: { + DisplayName: 'Braze', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'BRAZE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, }, + ], }, - output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rest.fra-01.braze.eu/users/track", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "partner": "RudderStack", - "events": [ - { - "name": "Page Viewed", - "time": "2020-01-24T11:59:02.402+05:30", - "properties": { - "path": "/tests/html/index2.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index2.html" - }, - "_update_existing_only": false, - "user_alias": { - "alias_name": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "alias_label": "rudder_id" - } - } - ], - "attributes": [ - { - "email": "mickey@disney.com", - "city": "Disney", - "country": "USA", - "firstname": "Mickey", - "_update_existing_only": false, - "user_alias": { - "alias_name": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "alias_label": "rudder_id" - } - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rest.fra-01.braze.eu/v2/subscription/status/set", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "subscription_groups": [ - { - "external_id": ["user123"], - "phones": ["5055077683"], - "subscription_group_id": "c90f0fd2-2a02-4f2f-bf07-7e7d2c2ed2b1", - "subscription_state": "subscribed" - }, - { - "external_id": ["user877"], - "phones": ["5055077683"], - "subscription_group_id": "58d0a278-b55b-4f10-b7d2-98d1c5dd4c30", - "subscription_state": "subscribed" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rest.fra-01.braze.eu/users/merge", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "merge_updates": [ - { - "identifier_to_keep": { - "external_id": "dsafsdf" - }, - "identifier_to_merge": { - "external_id": "adsfsaf" - } - }, - { - "identifier_to_keep": { - "external_id": "dsafsdf2" - }, - "identifier_to_merge": { - "external_id": "adsfsaf2" - } - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 3 - }, - { - "jobId": 4 - }, - { - "jobId": 5 - }, - { - "jobId": 6 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "restApiKey": "dummyApiKey", - "prefixProperties": true, - "useNativeSDK": false, - "dataCenter": "eu-01" - }, - "DestinationDefinition": { - "DisplayName": "Braze", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "BRAZE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - } - } - ], + }, + }, + }, + { + name: 'braze', + description: 'dedup enabled router tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: '2N9UakqKF0D35wfzSeofIxPdL8X', + Name: 'Braze-Test', + Config: { + appKey: '0e5440c3-226b-45d0-91b5-c64da56cde16', + blacklistedEvents: [], + dataCenter: 'US-03', + enableNestedArrayOperations: false, + enableSubscriptionGroupInGroupCall: false, + eventFilteringOption: 'disable', + oneTrustCookieCategories: [], + restApiKey: 'dummyApiKey', + supportDedup: true, + trackAnonymousUser: true, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2N9Uaf2tWq2QRmatBWQm03Rz6qX', + }, + metadata: { + jobId: 1, + }, + message: { + type: 'track', + event: 'Sign In Completed', + sentAt: '2023-03-10T18:36:04.738Z', + userId: 'braze_test_user', + channel: 'web', + context: { + locale: 'en-US', + traits: { + subscribe_once: true, + pwa: true, + email: 'jackson24miranda@gmail.com', + lastName: 'Miranda', + firstName: 'Spencer', + is_registered: true, + last_identify: 'GOOGLE_SIGN_IN', + account_region: 'ON', + is_pickup_selected: 'false', + has_tradein_attempt: false, + custom_obj_attr: { + key1: 'value1', + key2: 'value2', + key4: 'value4', + }, + custom_arr: [1, 2, 'str1'], + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.9.5', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36', + }, + rudderId: '4118560d-e4fc-4fd1-a734-9c69eae2c047', + messageId: '1a342814-a882-4b65-9cc9-347544997268', + timestamp: '2023-03-10T18:36:05.028Z', + properties: { + cause: '/redirector', + method: 'GOOGLE', + region: 'ON', + orderId: '6179367977099', + order_id: '6179367977099', + webhookurl: 'https://my.test.com', + countingMethod: 'standard', + is_first_time_signin: false, + }, + receivedAt: '2023-03-18T01:41:42.257+05:30', + request_ip: '[::1]', + anonymousId: '77e278c9-e984-4cdd-950c-cd0b61befd03', + originalTimestamp: '2023-03-10T18:36:04.733Z', + }, + }, + { + destination: { + ID: '2N9UakqKF0D35wfzSeofIxPdL8X', + Name: 'Braze-Test', + Config: { + appKey: '0e5440c3-226b-45d0-91b5-c64da56cde16', + blacklistedEvents: [], + dataCenter: 'US-03', + enableNestedArrayOperations: false, + enableSubscriptionGroupInGroupCall: false, + eventFilteringOption: 'disable', + oneTrustCookieCategories: [], + restApiKey: 'dummyApiKey', + supportDedup: true, + trackAnonymousUser: true, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2N9Uaf2tWq2QRmatBWQm03Rz6qX', + }, + metadata: { + jobId: 2, + }, + message: { + type: 'track', + event: 'Sign In Completed', + sentAt: '2023-03-10T18:36:04.738Z', + userId: 'braze_test_user', + channel: 'web', + context: { + locale: 'en-US', + traits: { + subscribe_once: true, + pwa: true, + email: 'jackson24miranda@gmail.com', + lastName: 'Miranda 2', + firstName: 'Spencer', + is_registered: true, + last_identify: 'GOOGLE_SIGN_IN', + account_region: 'ON', + is_pickup_selected: 'true', + has_tradein_attempt: false, + custom_obj_attr: { + key1: 'value1', + key2: 'value2', + key4: 'value4', + }, + custom_arr: ['1', '2', 'str1'], + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.9.5', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36', + }, + rudderId: '4118560d-e4fc-4fd1-a734-9c69eae2c047', + messageId: '1a342814-a882-4b65-9cc9-347544997268', + timestamp: '2023-03-10T18:36:05.028Z', + properties: { + cause: '/redirector', + method: 'GOOGLE', + region: 'ON', + orderId: '6179367977099', + order_id: '6179367977099', + webhookurl: 'https://my.test.com', + countingMethod: 'standard', + is_first_time_signin: false, + }, + receivedAt: '2023-03-18T01:41:42.257+05:30', + request_ip: '[::1]', + anonymousId: '77e278c9-e984-4cdd-950c-cd0b61befd03', + originalTimestamp: '2023-03-10T18:36:04.733Z', + }, + }, + { + destination: { + ID: '2N9UakqKF0D35wfzSeofIxPdL8X', + Name: 'Braze-Test', + Config: { + appKey: '0e5440c3-226b-45d0-91b5-c64da56cde16', + blacklistedEvents: [], + dataCenter: 'US-03', + enableNestedArrayOperations: false, + enableSubscriptionGroupInGroupCall: false, + eventFilteringOption: 'disable', + oneTrustCookieCategories: [], + restApiKey: 'dummyApiKey', + supportDedup: true, + trackAnonymousUser: true, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2N9Uaf2tWq2QRmatBWQm03Rz6qX', + }, + metadata: { + jobId: 3, + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + type: 'identify', + userId: 'user@50', + }, }, + { + destination: { + ID: '2N9UakqKF0D35wfzSeofIxPdL8X', + Name: 'Braze-Test', + Config: { + appKey: '0e5440c3-226b-45d0-91b5-c64da56cde16', + blacklistedEvents: [], + dataCenter: 'US-03', + enableNestedArrayOperations: false, + enableSubscriptionGroupInGroupCall: false, + eventFilteringOption: 'disable', + oneTrustCookieCategories: [], + restApiKey: 'dummyApiKey', + supportDedup: true, + trackAnonymousUser: true, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2N9Uaf2tWq2QRmatBWQm03Rz6qX', + }, + metadata: { + jobId: 4, + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + type: 'identify', + userId: 'user@50', + }, + }, + ], + destType: 'braze', }, + method: 'POST', + }, }, - { - name: 'braze', - description: 'dedup enabled router tests', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rest.iad-03.braze.com/users/track', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + partner: 'RudderStack', + attributes: [ { - "destination": { - "ID": "2N9UakqKF0D35wfzSeofIxPdL8X", - "Name": "Braze-Test", - "Config": { - "appKey": "0e5440c3-226b-45d0-91b5-c64da56cde16", - "blacklistedEvents": [], - "dataCenter": "US-03", - "enableNestedArrayOperations": false, - "enableSubscriptionGroupInGroupCall": false, - "eventFilteringOption": "disable", - "oneTrustCookieCategories": [], - "restApiKey": "dummyApiKey", - "supportDedup": true, - "trackAnonymousUser": true, - "whitelistedEvents": [] - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2N9Uaf2tWq2QRmatBWQm03Rz6qX" - }, - "metadata": { - "jobId": 1 - }, - "message": { - "type": "track", - "event": "Sign In Completed", - "sentAt": "2023-03-10T18:36:04.738Z", - "userId": "braze_test_user", - "channel": "web", - "context": { - "locale": "en-US", - "traits": { - "subscribe_once": true, - "pwa": true, - "email": "jackson24miranda@gmail.com", - "lastName": "Miranda", - "firstName": "Spencer", - "is_registered": true, - "last_identify": "GOOGLE_SIGN_IN", - "account_region": "ON", - "is_pickup_selected": "false", - "has_tradein_attempt": false, - "custom_obj_attr": { - "key1": "value1", - "key2": "value2", - "key4": "value4" - }, - "custom_arr": [1, 2, "str1"] - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.9.5" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" - }, - "rudderId": "4118560d-e4fc-4fd1-a734-9c69eae2c047", - "messageId": "1a342814-a882-4b65-9cc9-347544997268", - "timestamp": "2023-03-10T18:36:05.028Z", - "properties": { - "cause": "/redirector", - "method": "GOOGLE", - "region": "ON", - "orderId": "6179367977099", - "order_id": "6179367977099", - "webhookurl": "https://my.test.com", - "countingMethod": "standard", - "is_first_time_signin": false - }, - "receivedAt": "2023-03-18T01:41:42.257+05:30", - "request_ip": "[::1]", - "anonymousId": "77e278c9-e984-4cdd-950c-cd0b61befd03", - "originalTimestamp": "2023-03-10T18:36:04.733Z" - } + first_name: 'Spencer', + subscribe_once: true, + pwa: true, + external_id: 'braze_test_user', + custom_obj_attr: { + key1: 'value1', + key2: 'value2', + key4: 'value4', + }, }, { - "destination": { - "ID": "2N9UakqKF0D35wfzSeofIxPdL8X", - "Name": "Braze-Test", - "Config": { - "appKey": "0e5440c3-226b-45d0-91b5-c64da56cde16", - "blacklistedEvents": [], - "dataCenter": "US-03", - "enableNestedArrayOperations": false, - "enableSubscriptionGroupInGroupCall": false, - "eventFilteringOption": "disable", - "oneTrustCookieCategories": [], - "restApiKey": "dummyApiKey", - "supportDedup": true, - "trackAnonymousUser": true, - "whitelistedEvents": [] - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2N9Uaf2tWq2QRmatBWQm03Rz6qX" - }, - "metadata": { - "jobId": 2 - }, - "message": { - "type": "track", - "event": "Sign In Completed", - "sentAt": "2023-03-10T18:36:04.738Z", - "userId": "braze_test_user", - "channel": "web", - "context": { - "locale": "en-US", - "traits": { - "subscribe_once": true, - "pwa": true, - "email": "jackson24miranda@gmail.com", - "lastName": "Miranda 2", - "firstName": "Spencer", - "is_registered": true, - "last_identify": "GOOGLE_SIGN_IN", - "account_region": "ON", - "is_pickup_selected": "true", - "has_tradein_attempt": false, - "custom_obj_attr": { - "key1": "value1", - "key2": "value2", - "key4": "value4" - }, - "custom_arr": ["1", "2", "str1"] - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.9.5" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" - }, - "rudderId": "4118560d-e4fc-4fd1-a734-9c69eae2c047", - "messageId": "1a342814-a882-4b65-9cc9-347544997268", - "timestamp": "2023-03-10T18:36:05.028Z", - "properties": { - "cause": "/redirector", - "method": "GOOGLE", - "region": "ON", - "orderId": "6179367977099", - "order_id": "6179367977099", - "webhookurl": "https://my.test.com", - "countingMethod": "standard", - "is_first_time_signin": false - }, - "receivedAt": "2023-03-18T01:41:42.257+05:30", - "request_ip": "[::1]", - "anonymousId": "77e278c9-e984-4cdd-950c-cd0b61befd03", - "originalTimestamp": "2023-03-10T18:36:04.733Z" - } + last_name: 'Miranda 2', + is_pickup_selected: 'true', + external_id: 'braze_test_user', + custom_arr: ['1', '2', 'str1'], }, { - "destination": { - "ID": "2N9UakqKF0D35wfzSeofIxPdL8X", - "Name": "Braze-Test", - "Config": { - "appKey": "0e5440c3-226b-45d0-91b5-c64da56cde16", - "blacklistedEvents": [], - "dataCenter": "US-03", - "enableNestedArrayOperations": false, - "enableSubscriptionGroupInGroupCall": false, - "eventFilteringOption": "disable", - "oneTrustCookieCategories": [], - "restApiKey": "dummyApiKey", - "supportDedup": true, - "trackAnonymousUser": true, - "whitelistedEvents": [] - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2N9Uaf2tWq2QRmatBWQm03Rz6qX" - }, - "metadata": { - "jobId": 3 - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstName": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "type": "identify", - "userId": "user@50" - } + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + external_id: 'user@50', + first_name: 'Mickey', }, + ], + events: [ { - "destination": { - "ID": "2N9UakqKF0D35wfzSeofIxPdL8X", - "Name": "Braze-Test", - "Config": { - "appKey": "0e5440c3-226b-45d0-91b5-c64da56cde16", - "blacklistedEvents": [], - "dataCenter": "US-03", - "enableNestedArrayOperations": false, - "enableSubscriptionGroupInGroupCall": false, - "eventFilteringOption": "disable", - "oneTrustCookieCategories": [], - "restApiKey": "dummyApiKey", - "supportDedup": true, - "trackAnonymousUser": true, - "whitelistedEvents": [] - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2N9Uaf2tWq2QRmatBWQm03Rz6qX" - }, - "metadata": { - "jobId": 4 - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstName": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "type": "identify", - "userId": "user@50" - } - } - ], - destType: 'braze', - }, - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rest.iad-03.braze.com/users/track", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "partner": "RudderStack", - "attributes": [ - { - "first_name": "Spencer", - "subscribe_once": true, - "pwa": true, - "external_id": "braze_test_user", - "custom_obj_attr": { - "key1": "value1", - "key2": "value2", - "key4": "value4" - } - }, - { - "last_name": "Miranda 2", - "is_pickup_selected": "true", - "external_id": "braze_test_user", - "custom_arr": ["1", "2", "str1"] - }, - { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "external_id": "user@50", - "first_name": "Mickey" - } - ], - "events": [ - { - "name": "Sign In Completed", - "time": "2023-03-10T18:36:05.028Z", - "properties": { - "cause": "/redirector", - "method": "GOOGLE", - "region": "ON", - "orderId": "6179367977099", - "order_id": "6179367977099", - "webhookurl": "https://my.test.com", - "countingMethod": "standard", - "is_first_time_signin": false - }, - "external_id": "braze_test_user" - }, - { - "name": "Sign In Completed", - "time": "2023-03-10T18:36:05.028Z", - "properties": { - "cause": "/redirector", - "method": "GOOGLE", - "region": "ON", - "orderId": "6179367977099", - "order_id": "6179367977099", - "webhookurl": "https://my.test.com", - "countingMethod": "standard", - "is_first_time_signin": false - }, - "external_id": "braze_test_user" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 3 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "ID": "2N9UakqKF0D35wfzSeofIxPdL8X", - "Name": "Braze-Test", - "Config": { - "appKey": "0e5440c3-226b-45d0-91b5-c64da56cde16", - "blacklistedEvents": [], - "dataCenter": "US-03", - "enableNestedArrayOperations": false, - "enableSubscriptionGroupInGroupCall": false, - "eventFilteringOption": "disable", - "oneTrustCookieCategories": [], - "restApiKey": "dummyApiKey", - "supportDedup": true, - "trackAnonymousUser": true, - "whitelistedEvents": [] - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2N9Uaf2tWq2QRmatBWQm03Rz6qX" - } + name: 'Sign In Completed', + time: '2023-03-10T18:36:05.028Z', + properties: { + cause: '/redirector', + method: 'GOOGLE', + region: 'ON', + orderId: '6179367977099', + order_id: '6179367977099', + webhookurl: 'https://my.test.com', + countingMethod: 'standard', + is_first_time_signin: false, + }, + external_id: 'braze_test_user', }, { - "error": "[Braze Deduplication]: Duplicate user detected, the user is dropped", - "statTags": { - "destType": "BRAZE", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "router", - "implementation": "native", - "module": "destination", - }, - "statusCode": 400, - "batched": false, - "metadata": [ - { - "jobId": 4 - } - ], - "destination": { - "ID": "2N9UakqKF0D35wfzSeofIxPdL8X", - "Name": "Braze-Test", - "Config": { - "appKey": "0e5440c3-226b-45d0-91b5-c64da56cde16", - "blacklistedEvents": [], - "dataCenter": "US-03", - "enableNestedArrayOperations": false, - "enableSubscriptionGroupInGroupCall": false, - "eventFilteringOption": "disable", - "oneTrustCookieCategories": [], - "restApiKey": "dummyApiKey", - "supportDedup": true, - "trackAnonymousUser": true, - "whitelistedEvents": [] - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2N9Uaf2tWq2QRmatBWQm03Rz6qX" - } - } - ], + name: 'Sign In Completed', + time: '2023-03-10T18:36:05.028Z', + properties: { + cause: '/redirector', + method: 'GOOGLE', + region: 'ON', + orderId: '6179367977099', + order_id: '6179367977099', + webhookurl: 'https://my.test.com', + countingMethod: 'standard', + is_first_time_signin: false, + }, + external_id: 'braze_test_user', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, }, + ], + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + { + jobId: 3, + }, + ], + batched: true, + statusCode: 200, + destination: { + ID: '2N9UakqKF0D35wfzSeofIxPdL8X', + Name: 'Braze-Test', + Config: { + appKey: '0e5440c3-226b-45d0-91b5-c64da56cde16', + blacklistedEvents: [], + dataCenter: 'US-03', + enableNestedArrayOperations: false, + enableSubscriptionGroupInGroupCall: false, + eventFilteringOption: 'disable', + oneTrustCookieCategories: [], + restApiKey: 'dummyApiKey', + supportDedup: true, + trackAnonymousUser: true, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2N9Uaf2tWq2QRmatBWQm03Rz6qX', + }, }, + { + error: '[Braze Deduplication]: Duplicate user detected, the user is dropped', + statTags: { + destType: 'BRAZE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + batched: false, + metadata: [ + { + jobId: 4, + }, + ], + destination: { + ID: '2N9UakqKF0D35wfzSeofIxPdL8X', + Name: 'Braze-Test', + Config: { + appKey: '0e5440c3-226b-45d0-91b5-c64da56cde16', + blacklistedEvents: [], + dataCenter: 'US-03', + enableNestedArrayOperations: false, + enableSubscriptionGroupInGroupCall: false, + eventFilteringOption: 'disable', + oneTrustCookieCategories: [], + restApiKey: 'dummyApiKey', + supportDedup: true, + trackAnonymousUser: true, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2N9Uaf2tWq2QRmatBWQm03Rz6qX', + }, + }, + ], }, - } + }, + }, + }, ]; diff --git a/test/integrations/destinations/clevertap/router/data.ts b/test/integrations/destinations/clevertap/router/data.ts index 380d6db00d..2d6ec1dcf0 100644 --- a/test/integrations/destinations/clevertap/router/data.ts +++ b/test/integrations/destinations/clevertap/router/data.ts @@ -1,274 +1,276 @@ export const data = [ - { - name: 'clevertap', - description: 'simple router tests', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "passcode": "dummypasscode", - "accountId": "dummyAccountId", - "trackAnonymous": true, - "enableObjectIdMapping": true - } - }, - "metadata": { - "jobId": 1 - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "Android", - "version": "" - }, - "screen": { - "density": 2 - }, - "device": { - "id": "f54bb572361c4fd1", - "name": "whyred", - "type": "Android", - "model": "Redmi Note 5 Pro", - "manufacturer": "Xiaomi", - "token": "frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "ts": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "email": "dummyuser@gmail.com", - "name": "Dummy User", - "phone": "98765434210", - "gender": "M", - "employed": true, - "birthday": "1614775793", - "education": "Science", - "graduate": true, - "married": true, - "customerType": "Prime", - "msg_push": true, - "msgSms": true, - "msgemail": true, - "msgwhatsapp": false, - "custom_tags": ["Test_User", "Interested_User", "DIY_Hobby"], - "custom_mappings": { - "Office": "Trastkiv", - "Country": "Russia" - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "passcode": "dummypasscode", - "accountId": "dummyAccountId", - "trackAnonymous": true, - "enableObjectIdMapping": true - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "event": "Random", - "properties": { - "country_region": "India", - "test": "abc" - }, - "receivedAt": "2021-08-20T12:49:07.691Z", - "rudderId": "138c4214-b537-4f77-9dea-9abde70b5147", - "type": "track", - "anonymousId": "cd3a4439-7df0-4475-acb9-6659c7c4dfe3" - } - }, - { - "destination": { - "Config": { - "passcode": "dummypasscode", - "accountId": "dummyAccountId", - "trackAnonymous": true - } - }, - "metadata": { - "jobId": 3 - }, - "message": { - "type": "group", - "anonymousId": "anon-id-new", - "name": "Rudder", - "properties": { - "title": "Home", - "path": "/" - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } - ], - destType: 'clevertap', + { + name: 'clevertap', + description: 'simple router tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + passcode: 'dummypasscode', + accountId: 'dummyAccountId', + trackAnonymous: true, + enableObjectIdMapping: true, }, - method: 'POST', + }, + metadata: { + jobId: 1, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: 'Android', + version: '', + }, + screen: { + density: 2, + }, + device: { + id: 'f54bb572361c4fd1', + name: 'whyred', + type: 'Android', + model: 'Redmi Note 5 Pro', + manufacturer: 'Xiaomi', + token: 'frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf', + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + type: 'identify', + traits: { + ts: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + email: 'dummyuser@gmail.com', + name: 'Dummy User', + phone: '98765434210', + gender: 'M', + employed: true, + birthday: '1614775793', + education: 'Science', + graduate: true, + married: true, + customerType: 'Prime', + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: ['Test_User', 'Interested_User', 'DIY_Hobby'], + custom_mappings: { + Office: 'Trastkiv', + Country: 'Russia', + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + { + destination: { + Config: { + passcode: 'dummypasscode', + accountId: 'dummyAccountId', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + metadata: { + jobId: 2, + }, + message: { + event: 'Random', + properties: { + country_region: 'India', + test: 'abc', + }, + receivedAt: '2021-08-20T12:49:07.691Z', + rudderId: '138c4214-b537-4f77-9dea-9abde70b5147', + type: 'track', + anonymousId: 'cd3a4439-7df0-4475-acb9-6659c7c4dfe3', + }, }, + { + destination: { + Config: { + passcode: 'dummypasscode', + accountId: 'dummyAccountId', + trackAnonymous: true, + }, + }, + metadata: { + jobId: 3, + }, + message: { + type: 'group', + anonymousId: 'anon-id-new', + name: 'Rudder', + properties: { + title: 'Home', + path: '/', + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + destType: 'clevertap', }, - output: { - response: { - status: 200, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + batched: true, + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': 'dummyAccountId', + 'X-CleverTap-Passcode': 'dummypasscode', + 'Content-Type': 'application/json', + }, + params: {}, body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "batched": true, - "endpoint": "https://api.clevertap.com/1/upload", - "headers": { - "X-CleverTap-Account-Id": "dummyAccountId", - "X-CleverTap-Passcode": "dummypasscode", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "d": [ - { - "type": "profile", - "ts": 1571043797, - "profileData": { - "Email": "dummyuser@gmail.com", - "Name": "Dummy User", - "Phone": "98765434210", - "Gender": "M", - "Employed": true, - "DOB": "1614775793", - "Education": "Science", - "Married": true, - "Customer Type": "Prime", - "graduate": true, - "msg_push": true, - "msgSms": true, - "msgemail": true, - "msgwhatsapp": false, - "custom_tags": "[\"Test_User\",\"Interested_User\",\"DIY_Hobby\"]", - "custom_mappings": "{\"Office\":\"Trastkiv\",\"Country\":\"Russia\"}", - "address": "{\"city\":\"kolkata\",\"country\":\"India\",\"postalCode\":789223,\"state\":\"WB\",\"street\":\"\"}" - }, - "objectId": "anon_id" - }, - { - "type": "token", - "tokenData": { - "id": "frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf", - "type": "fcm" - }, - "objectId": "anon_id" - }, - { - "evtName": "Random", - "evtData": { - "country_region": "India", - "test": "abc" - }, - "type": "event", - "objectId": "cd3a4439-7df0-4475-acb9-6659c7c4dfe3" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "passcode": "dummypasscode", - "accountId": "dummyAccountId", - "trackAnonymous": true, - "enableObjectIdMapping": true - } - } + JSON: { + d: [ + { + type: 'profile', + ts: 1571043797, + profileData: { + Email: 'dummyuser@gmail.com', + Name: 'Dummy User', + Phone: '98765434210', + Gender: 'M', + Employed: true, + DOB: '1614775793', + Education: 'Science', + Married: true, + 'Customer Type': 'Prime', + graduate: true, + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', + custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', + address: + '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + }, + objectId: 'anon_id', + }, + { + type: 'token', + tokenData: { + id: 'frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf', + type: 'fcm', + }, + objectId: 'anon_id', + }, + { + evtName: 'Random', + evtData: { + country_region: 'India', + test: 'abc', }, - { - "metadata": [ - { - "jobId": 3 - } - ], - "batched": false, - "statusCode": 400, - "error": "Message type not supported", - "statTags": { - "destType": "CLEVERTAP", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "router", - "implementation": "native", - "module": "destination", - }, - "destination": { - "Config": { - "passcode": "dummypasscode", - "accountId": "dummyAccountId", - "trackAnonymous": true - } - } - } + type: 'event', + objectId: 'cd3a4439-7df0-4475-acb9-6659c7c4dfe3', + }, ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + passcode: 'dummypasscode', + accountId: 'dummyAccountId', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + }, + { + metadata: [ + { + jobId: 3, + }, + ], + batched: false, + statusCode: 400, + error: 'Message type not supported', + statTags: { + destType: 'CLEVERTAP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + destination: { + Config: { + passcode: 'dummypasscode', + accountId: 'dummyAccountId', + trackAnonymous: true, }, + }, }, + ], }, - } + }, + }, + }, ]; diff --git a/test/integrations/destinations/facebook_conversions/mocks.ts b/test/integrations/destinations/facebook_conversions/mocks.ts index ff6771fa1e..c155897bc4 100644 --- a/test/integrations/destinations/facebook_conversions/mocks.ts +++ b/test/integrations/destinations/facebook_conversions/mocks.ts @@ -1,3 +1,3 @@ export const defaultMockFns = () => { - jest.spyOn(Date, 'now').mockImplementation(() => new Date("2023-11-12T15:46:51.000Z").valueOf()); -}; \ No newline at end of file + jest.spyOn(Date, 'now').mockImplementation(() => new Date('2023-11-12T15:46:51.000Z').valueOf()); +}; diff --git a/test/integrations/destinations/facebook_conversions/processor/data.ts b/test/integrations/destinations/facebook_conversions/processor/data.ts index c8e20e5f20..beb7eb32aa 100644 --- a/test/integrations/destinations/facebook_conversions/processor/data.ts +++ b/test/integrations/destinations/facebook_conversions/processor/data.ts @@ -1,1433 +1,1437 @@ -import { defaultMockFns } from "../mocks" +import { defaultMockFns } from '../mocks'; export const data = [ - { - "name": "facebook_conversions", - "description": "Timestamp validation. Events must be sent within seven days of their occurrence or up to one minute in the future", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "randomevent", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-09-01T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Events must be sent within seven days of their occurrence or up to one minute in the future.", - "statusCode": 400, - "statTags": { - "destType": "FACEBOOK_CONVERSIONS", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination", - } - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event without event property set", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "'event' is required and should be a string", - "statTags": { - "destType": "FACEBOOK_CONVERSIONS", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination", - }, - "statusCode": 400, - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Simple track event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"spin_result\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"value\":400,\"currency\":\"USD\"}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event products searched", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "products searched", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"Search\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"content_ids\":[],\"contents\":[],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event product added", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "product added", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"AddToCart\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"content_ids\":[],\"contents\":[],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event product viewed", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "product viewed", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"ViewContent\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"content_ids\":[],\"contents\":[],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event product list viewed", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "product list viewed", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0, - "products": [ - { - "product_id": 1234, - "quantity": 5, - "price": 55 - } - ] - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"ViewContent\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"products\":[{\"product_id\":1234,\"quantity\":5,\"price\":55}],\"content_ids\":[1234],\"contents\":[{\"id\":1234,\"quantity\":5,\"item_price\":55}],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event product list viewed without products array", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "product list viewed", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0, - "category": "randomCategory" - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"ViewContent\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"category\":\"randomCategory\",\"content_ids\":[\"randomCategory\"],\"contents\":[{\"id\":\"randomCategory\",\"quantity\":1}],\"content_type\":\"product_group\",\"content_category\":\"randomCategory\",\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event product added to wishlist", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "product added to wishlist", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"AddToWishlist\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"content_ids\":[],\"contents\":[],\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event payment info entered", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "payment info entered", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"AddPaymentInfo\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"content_ids\":[],\"contents\":[],\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event order completed with delivery_category in products array", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "order completed", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0, - "products": [ - { - "product_id": 1234, - "quantity": 5, - "price": 55, - "delivery_category": "home_delivery" - } - ] - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"Purchase\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"products\":[{\"product_id\":1234,\"quantity\":5,\"price\":55,\"delivery_category\":\"home_delivery\"}],\"content_ids\":[1234],\"contents\":[{\"id\":1234,\"quantity\":5,\"item_price\":55,\"delivery_category\":\"home_delivery\"}],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400,\"num_items\":1}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "facebook_conversions", - "description": "Track event with standard event order completed with delivery_category in properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "order completed", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0, - "delivery_category": "home_delivery", - "products": [ - { - "product_id": 1234, - "quantity": 5, - "price": 55 - } - ] - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"Purchase\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"delivery_category\":\"home_delivery\",\"products\":[{\"product_id\":1234,\"quantity\":5,\"price\":55}],\"content_ids\":[1234],\"contents\":[{\"id\":1234,\"quantity\":5,\"item_price\":55,\"delivery_category\":\"home_delivery\"}],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400,\"num_items\":1}}" - ] - } - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - } -] \ No newline at end of file + { + name: 'facebook_conversions', + description: + 'Timestamp validation. Events must be sent within seven days of their occurrence or up to one minute in the future', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'randomevent', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-09-01T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Events must be sent within seven days of their occurrence or up to one minute in the future.', + statusCode: 400, + statTags: { + destType: 'FACEBOOK_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event without event property set', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: '', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: "'event' is required and should be a string", + statTags: { + destType: 'FACEBOOK_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Simple track event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"value":400,"currency":"USD"}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event products searched', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'products searched', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Search","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event product added', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'product added', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToCart","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event product viewed', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'product viewed', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event product list viewed', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'product list viewed', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + products: [ + { + product_id: 1234, + quantity: 5, + price: 55, + }, + ], + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55}],"content_type":"product","currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event product list viewed without products array', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'product list viewed', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + category: 'randomCategory', + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"category":"randomCategory","content_ids":["randomCategory"],"contents":[{"id":"randomCategory","quantity":1}],"content_type":"product_group","content_category":"randomCategory","currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event product added to wishlist', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'product added to wishlist', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToWishlist","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: 'Track event with standard event payment info entered', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'payment info entered', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddPaymentInfo","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"currency":"USD","value":400}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: + 'Track event with standard event order completed with delivery_category in products array', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'order completed', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + products: [ + { + product_id: 1234, + quantity: 5, + price: 55, + delivery_category: 'home_delivery', + }, + ], + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55,"delivery_category":"home_delivery"}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55,"delivery_category":"home_delivery"}],"content_type":"product","currency":"USD","value":400,"num_items":1}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'facebook_conversions', + description: + 'Track event with standard event order completed with delivery_category in properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'order completed', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + delivery_category: 'home_delivery', + products: [ + { + product_id: 1234, + quantity: 5, + price: 55, + }, + ], + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"delivery_category":"home_delivery","products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55,"delivery_category":"home_delivery"}],"content_type":"product","currency":"USD","value":400,"num_items":1}}', + ], + }, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, +]; diff --git a/test/integrations/destinations/facebook_conversions/router/data.ts b/test/integrations/destinations/facebook_conversions/router/data.ts index 09145aa1e6..1c7f316538 100644 --- a/test/integrations/destinations/facebook_conversions/router/data.ts +++ b/test/integrations/destinations/facebook_conversions/router/data.ts @@ -1,306 +1,306 @@ -import { defaultMockFns } from "../mocks" +import { defaultMockFns } from '../mocks'; export const data = [ - { - name: 'facebook_conversions', - description: 'Successfull Remove Group Call ', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { + { + name: 'facebook_conversions', + description: 'Successfull Remove Group Call ', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + metadata: { + jobId: 1, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + { + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + channel: 'web', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + screen: { + height: '100', + density: 50, + }, + traits: { + email: ' aBc@gmail.com ', + address: { + zip: 1234, + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'products searched', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + revenue: 400, + additional_bet_index: 0, + }, + timestamp: '2023-11-12T15:46:51.693229+05:30', + type: 'track', + }, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, + }, + ], + destType: 'facebook_conversions', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, body: { - input: [ - { - "metadata": { - "jobId": 1 - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - }, - { - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "channel": "web", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "screen": { - "height": "100", - "density": 50 - }, - "traits": { - "email": " aBc@gmail.com ", - "address": { - "zip": 1234 - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "products searched", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "revenue": 400, - "additional_bet_index": 0 - }, - "timestamp": "2023-11-12T15:46:51.693229+05:30", - "type": "track" - }, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"value":400,"currency":"USD"}}', ], - destType: 'facebook_conversions', + }, }, - method: 'POST', + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', + }, + Enabled: true, + }, }, - }, - output: { - response: { - status: 200, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + headers: {}, + params: {}, body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"spin_result\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"value\":400,\"currency\":\"USD\"}}" - ] - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v18.0/dummyID/events?access_token=09876", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "data": [ - "{\"user_data\":{\"em\":\"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08\",\"zp\":\"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4\"},\"event_name\":\"Search\",\"event_time\":1699784211,\"action_source\":\"website\",\"custom_data\":{\"revenue\":400,\"additional_bet_index\":0,\"content_ids\":[],\"contents\":[],\"content_type\":\"product\",\"currency\":\"USD\",\"value\":400}}" - ] - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "limitedDataUsage": true, - "blacklistPiiProperties": [ - { - "blacklistPiiProperties": "", - "blacklistPiiHash": false - } - ], - "accessToken": "09876", - "datasetId": "dummyID", - "eventsToEvents": [ - { - "from": "", - "to": "" - } - ], - "eventCustomProperties": [ - { - "eventCustomProperties": "" - } - ], - "removeExternalId": true, - "whitelistPiiProperties": [ - { - "whitelistPiiProperties": "" - } - ], - "actionSource": "website" - }, - "Enabled": true - } - } + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + data: [ + '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Search","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', ], + }, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + datasetId: 'dummyID', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + actionSource: 'website', }, + Enabled: true, + }, }, + ], }, - "mockFns": defaultMockFns - } + }, + }, + mockFns: defaultMockFns, + }, ]; diff --git a/test/integrations/destinations/ga4/mocks.ts b/test/integrations/destinations/ga4/mocks.ts index a13e124d23..7b47fe9f44 100644 --- a/test/integrations/destinations/ga4/mocks.ts +++ b/test/integrations/destinations/ga4/mocks.ts @@ -1,3 +1,3 @@ export const defaultMockFns = () => { - jest.spyOn(Date, 'now').mockImplementation(() => new Date("2022-04-29T05:17:09Z").valueOf()); -}; \ No newline at end of file + jest.spyOn(Date, 'now').mockImplementation(() => new Date('2022-04-29T05:17:09Z').valueOf()); +}; diff --git a/test/integrations/destinations/ga4/processor/data.ts b/test/integrations/destinations/ga4/processor/data.ts index 99eca54468..f96ca9e74a 100644 --- a/test/integrations/destinations/ga4/processor/data.ts +++ b/test/integrations/destinations/ga4/processor/data.ts @@ -1,14803 +1,14903 @@ -import { defaultMockFns } from "../mocks" +import { defaultMockFns } from '../mocks'; export const data = [ - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'Products Searched' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "timestamp_micros": 1650950229000000, - "events": [ - { - "name": "search", - "params": { - "search_term": "t-shirts", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product list viewed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "rudderId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product list viewed", - "properties": { - "list_id": "related_products", - "category": "Related_products", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "view_item_list", - "params": { - "item_list_id": "related_products", - "item_list_name": "Related_products", - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ], - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'promotion viewed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion viewed", - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "0", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "client_id", - "events": [ - { - "name": "view_promotion", - "params": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 0, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'promotion clicked' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion clicked", - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "0", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "select_promotion", - "params": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 0, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) exclude only 'products' property from 'promotion clicked' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion clicked", - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "select_promotion", - "params": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product clicked' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product clicked", - "properties": { - "list_id": "related_products", - "category": "Related_products", - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "timezone": { - "name": "Europe/Tallinn" - }, - "engagementTimeMsec": 100, - "sessionId": 655 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "select_item", - "params": { - "item_list_id": "related_products", - "item_list_name": "Related_products", - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Related_products", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ], - "timezone_name": "Europe/Tallinn", - "engagement_time_msec": 100, - "session_id": 655 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product viewed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product viewed", - "properties": { - "currency": "USD", - "total": "7.77", - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "view_item", - "params": { - "currency": "USD", - "value": 7.77, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'promotion clicked' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion clicked", - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "0", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "typesOfClient": "gtag", - "firebaseAppId": "1:17864591371:android:7a9520d3c78962e21f9fee", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "client_id", - "events": [ - { - "name": "select_promotion", - "params": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 0, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(firebase) check all property mappings for 'promotion clicked' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion clicked", - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "0", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "typesOfClient": "firebase", - "firebaseAppId": "1:17864591371:android:7a9520d3c78962e21f9fee", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "firebase_app_id": "1:17864591371:android:7a9520d3c78962e21f9fee" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "app_instance_id": "f0dd99b6f979fb551ce583373900f937", - "events": [ - { - "name": "select_promotion", - "params": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 0, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product added' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "total": "7.77", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "add_to_cart", - "params": { - "currency": "USD", - "value": 7.77, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product removed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product removed", - "properties": { - "currency": "USD", - "total": "7.77", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ], - "engagementTimeMsec": 100, - "sessionId": 655 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "remove_from_cart", - "params": { - "currency": "USD", - "value": 7.77, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ], - "engagement_time_msec": 100, - "session_id": 655 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'cart viewed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "cart viewed", - "properties": { - "currency": "USD", - "total": "7.77", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "view_cart", - "params": { - "currency": "USD", - "value": 7.77, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'checkout started' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "checkout started", - "properties": { - "currency": "USD", - "total": 7.77, - "coupon": "SUMMER_FUN", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "begin_checkout", - "params": { - "currency": "USD", - "value": 7.77, - "coupon": "SUMMER_FUN", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'payment info entered' -> 'add_payment_info' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "payment info entered", - "properties": { - "currency": "USD", - "value": "7.77", - "coupon": "SUMMER_FUN", - "payment_method": "Credit Card", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "params": { - "currency": "USD", - "value": 7.77, - "coupon": "SUMMER_FUN", - "payment_type": "Credit Card", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "name": "add_payment_info" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'checkout Step Completed' -> 'add_shipping_info' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "checkout Step Completed", - "properties": { - "currency": "USD", - "value": "7.77", - "coupon": "SUMMER_FUN", - "shipping_method": "Ground", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "params": { - "currency": "USD", - "value": 7.77, - "coupon": "SUMMER_FUN", - "shipping_tier": "Ground", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "name": "add_shipping_info" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'order completed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "order completed", - "properties": { - "currency": "USD", - "order_id": "T_12345", - "total": 12.21, - "affiliation": "Google Store", - "coupon": "SUMMER_FUN", - "shipping": 3.33, - "tax": 1.11, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "purchase", - "params": { - "currency": "USD", - "transaction_id": "T_12345", - "value": 12.21, - "affiliation": "Google Store", - "coupon": "SUMMER_FUN", - "shipping": 3.33, - "tax": 1.11, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'order refunded' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "order refunded", - "properties": { - "currency": "USD", - "order_id": "T_12345", - "total": 12.21, - "affiliation": "Google Store", - "coupon": "SUMMER_FUN", - "shipping": 3.33, - "tax": 1.11, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "refund", - "params": { - "currency": "USD", - "transaction_id": "T_12345", - "value": 12.21, - "affiliation": "Google Store", - "coupon": "SUMMER_FUN", - "shipping": 3.33, - "tax": 1.11, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) exclude only 'products' property from 'order refunded' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "order refunded", - "properties": { - "currency": "USD", - "order_id": "T_12345", - "total": 12.21, - "affiliation": "Google Store", - "coupon": "SUMMER_FUN", - "shipping": 3.33, - "tax": 1.11 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "refund", - "params": { - "currency": "USD", - "transaction_id": "T_12345", - "value": 12.21, - "affiliation": "Google Store", - "coupon": "SUMMER_FUN", - "shipping": 3.33, - "tax": 1.11, - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product added to wishlist' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added to wishlist", - "properties": { - "currency": "USD", - "total": "7.77", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "add_to_wishlist", - "params": { - "currency": "USD", - "value": 7.77, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product_shared' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product_shared", - "properties": { - "share_via": "Twitter", - "content_type": "image", - "item_id": "C_12345" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "share", - "params": { - "method": "Twitter", - "content_type": "image", - "item_id": "C_12345", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'product_shared' event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product_shared", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "share", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'cart Shared' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "cart Shared", - "properties": { - "share_via": "Twitter", - "content_type": "image", - "item_id": "C_12345" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "share", - "params": { - "method": "Twitter", - "content_type": "image", - "item_id": "C_12345", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'cart Shared' event name with empty properties: {}", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "cart Shared", - "properties": {}, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "share", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for group call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "group", - "properties": { - "group_id": "G_12345", - "engagementTimeMsec": 100, - "sessionId": 655 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "group", - "params": { - "group_id": "G_12345", - "engagement_time_msec": 100, - "session_id": 655 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) group: send only group event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "group", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "group", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'earn virtual currency' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "earn virtual currency", - "properties": { - "virtual_currency_name": "Gems", - "value": 5 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "earn_virtual_currency", - "params": { - "virtual_currency_name": "Gems", - "value": 5, - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'earn virtual currency' event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "earn virtual currency", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "earn_virtual_currency", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'generate_lead' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "generate_lead", - "properties": { - "currency": "USD", - "value": 99.99 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "generate_lead", - "params": { - "currency": "USD", - "value": 99.99, - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'level_up' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "level_up", - "properties": { - "level": 5, - "character": "Player 1" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "level_up", - "params": { - "level": 5, - "character": "Player 1", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'level_up' event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "level_up", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "level_up", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'login' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "login", - "properties": { - "method": "Google" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "login", - "params": { - "method": "Google", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'login' event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "login", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "login", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'post_score' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "post_score", - "properties": { - "score": 10000, - "level": 5, - "character": "Player 1" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "post_score", - "params": { - "score": 10000, - "level": 5, - "character": "Player 1", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'login' event name with its required `score` properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "post_score", - "properties": { - "score": 10000 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "post_score", - "params": { - "score": 10000, - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'select_content' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "select_content", - "properties": { - "content_type": "product", - "item_id": "I_12345" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "select_content", - "params": { - "content_type": "product", - "item_id": "I_12345", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'group' event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "select_content", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "select_content", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'sign_up' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "sign_up", - "properties": { - "method": "Google" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "sign_up", - "params": { - "method": "Google", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'sign_up' event name without it's properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "sign_up", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "sign_up", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'spend_virtual_currency' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "spend_virtual_currency", - "properties": { - "value": 5, - "virtual_currency_name": "Gems", - "item_name": "Starter Boost" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "spend_virtual_currency", - "params": { - "value": 5, - "virtual_currency_name": "Gems", - "item_name": "Starter Boost", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send only 'spend_virtual_currency' event name with it's required 'value' and 'virtual_currency_name' properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "spend_virtual_currency", - "properties": { - "value": 5, - "virtual_currency_name": "Gems" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "spend_virtual_currency", - "params": { - "value": 5, - "virtual_currency_name": "Gems", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send 'tutorial_begin' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutorial_begin", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "tutorial_begin", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send 'tutorial_complete' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutorial_complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "tutorial_complete", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send all properties for 'unlock_achievement' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "unlock_achievement", - "properties": { - "achievement_id": "A_12345" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "unlock_achievement", - "params": { - "achievement_id": "A_12345", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send all properties for 'view_search_results' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "view_search_results", - "properties": { - "search_term": "Clothing", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "view_search_results", - "params": { - "search_term": "Clothing", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) pass only 'products: [...]' property for 'view_search_results' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "view_search_results", - "properties": { - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "view_search_results", - "params": { - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) pass custom event name 'rudderstack event' to GA4 along with custom properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "rudderstack event", - "properties": { - "total": "10", - "timezone": { - "name": "Europe/Tallinn" - }, - "engagementTimeMsec": 100, - "sessionId": 655 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "rudderstack_event", - "params": { - "total": "10", - "timezone_name": "Europe/Tallinn", - "engagement_time_msec": 100, - "session_id": 655 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) pass custom event name 'rudderstack event' to GA4 along with custom properties and user_properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "rudderstack event", - "properties": { - "total": "10", - "user_properties": { - "price": "19" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "user_properties": { - "price": { - "value": "19" - } - }, - "events": [ - { - "name": "rudderstack_event", - "params": { - "total": "10", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error]: (gtag) pass reserved event name to GA4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "ad_click", - "properties": { - "total": "10" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "track:: Reserved event names are not allowed", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Exclusion]: (gtag) pass reserved property name to GA4 for custom events", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "rudderstack event", - "properties": { - "firebase_conversion": "firebase_conversion", - "google_id": "1234", - "ga_value": "ga_value", - "value": "10" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "rudderstack_event", - "params": { - "value": "10", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Exclusion]: (gtag) pass reserved property name and reserved properties in `user_properties` to GA4 for custom events", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "rudderstack event", - "properties": { - "firebase_conversion": "firebase_conversion", - "google_id": "1234", - "ga_value": "ga_value", - "value": "10", - "user_properties": { - "first_open_time": "first_open_time", - "user_id": "user_id", - "firebase_value": "firebase_value", - "price": "100" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "user_properties": { - "price": { - "value": "100" - } - }, - "events": [ - { - "name": "rudderstack_event", - "params": { - "value": "10", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error]: (gtag) pass reserved event names along with reserved properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "app_remove", - "properties": { - "firebase_conversion": "firebase_conversion", - "google_id": "1234", - "ga_value": "ga_value", - "value": "10", - "user_properties": { - "first_open_time": "first_open_time", - "user_id": "user_id", - "firebase_value": "firebase_value", - "price": "100" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "track:: Reserved event names are not allowed", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] (gtag) pass reserved custom prefix names to GA4 events", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "firebase_event1", - "properties": { - "firebase_conversion": "firebase_conversion", - "google_id": "1234", - "ga_value": "ga_value", - "value": "10" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Reserved custom prefix names are not allowed", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'product added' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "total": "7.77", - "google_data": "google_data", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "add_to_cart", - "params": { - "currency": "USD", - "value": 7.77, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) pass custom event name with its properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "rudderstack event", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "rudderstack_event", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) map 'product added' properties to ga4 'add_to_cart' items array", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "affiliation": "Google Merchandise Store", - "brand": "Google", - "category": "Related_products", - "coupon": "SUMMER_FUN", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "list_id": "related_products", - "location_id": "L_12345", - "name": "Monopoly: 3rd Edition", - "position": "1", - "price": "19", - "product_id": "507f1f77bcf86cd799439011", - "products": [], - "quantity": "2", - "total": "7.77", - "variant": "green" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "FORM": {}, - "JSON": { - "client_id": "client_id", - "events": [ - { - "name": "add_to_cart", - "params": { - "currency": "USD", - "engagement_time_msec": 1, - "items": [ - { - "affiliation": "Google Merchandise Store", - "coupon": "SUMMER_FUN", - "currency": "USD", - "discount": 2.22, - "index": 1, - "item_brand": "Google", - "item_category": "Related_products", - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_id": "507f1f77bcf86cd799439011", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "item_name": "Monopoly: 3rd Edition", - "item_variant": "green", - "location_id": "L_12345", - "price": 19, - "quantity": 2 - } - ], - "list_id": "related_products", - "value": 7.77 - } - } - ], - "non_personalized_ads": true, - "timestamp_micros": 1650950229000000 - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://www.google-analytics.com/mp/collect", - "files": {}, - "headers": { - "Content-Type": "application/json", - "HOST": "www.google-analytics.com" - }, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "type": "REST", - "version": "1", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) pass event name with invalid data type for products: {...} properties (when products parameter is optional)", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "total": "7.77", - "products": { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - }, - "affiliation": "Google Merchandise Store", - "brand": "Google", - "category": "Related_products", - "coupon": "SUMMER_FUN", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "list_id": "related_products", - "location_id": "L_12345", - "name": "Monopoly: 3rd Edition", - "position": "1", - "price": "19", - "product_id": "507f1f77bcf86cd799439011", - "quantity": "2", - "variant": "green" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "FORM": {}, - "JSON": { - "client_id": "client_id", - "events": [ - { - "name": "add_to_cart", - "params": { - "currency": "USD", - "engagement_time_msec": 1, - "items": [ - { - "affiliation": "Google Merchandise Store", - "coupon": "SUMMER_FUN", - "currency": "USD", - "discount": 2.22, - "index": 1, - "item_brand": "Google", - "item_category": "Related_products", - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_id": "507f1f77bcf86cd799439011", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "item_name": "Monopoly: 3rd Edition", - "item_variant": "green", - "location_id": "L_12345", - "price": 19, - "quantity": 2 - } - ], - "list_id": "related_products", - "value": 7.77 - } - } - ], - "non_personalized_ads": true, - "timestamp_micros": 1650950229000000 - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://www.google-analytics.com/mp/collect", - "files": {}, - "headers": { - "Content-Type": "application/json", - "HOST": "www.google-analytics.com" - }, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "type": "REST", - "version": "1", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error] (gtag) pass event name to GA4 with missing fields i.e required in products: [..]", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "total": "7.77", - "products": [ - { - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "One of product_id or name is required", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] (gtag) pass event name to GA4 with missing fields i.e required in properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Viewed", - "properties": { - "currency": "USD", - "total": "7.77" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "One of product_id or name is required", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] (gtag) missing API Secret", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "API Secret not found. Aborting ", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] (gtag) missing measurementId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "measurementId must be provided. Aborting", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) firing group event with event name. should take event name by default", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "group", - "event": "tutorial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "client_id", - "events": [ - { - "name": "join_group", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error] (gtag) payload has missing message.type", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Message Type is not present. Aborting message.", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] (gtag) payload has missing event name", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Event name is required", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) taking client_id from anonymousId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "events": [ - { - "name": "tutotial_complete", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error] (firebase) payload has missing ga4AppInstanceId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "", - "firebaseAppId": "1:17864591371:android:7a9520d3c78962e21f9fee", - "blockPageViewEvent": false, - "typesOfClient": "firebase", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "ga4AppInstanceId must be provided under externalId", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] (firebase) pass reserved event name", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "app_store_subscription_cancel", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "", - "firebaseAppId": "1:17864591371:android:7a9520d3c78962e21f9fee", - "blockPageViewEvent": false, - "typesOfClient": "firebase", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Reserved custom event names are not allowed", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'tutorial complete' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutorial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "non_personalized_ads": true, - "events": [ - { - "name": "tutorial_complete", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) check all property mappings for 'cart viewed' event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "cart viewed", - "properties": { - "currency": "USD", - "total": "7.77", - "products": [ - { - "product_id": 0, - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "view_cart", - "params": { - "currency": "USD", - "value": 7.77, - "engagement_time_msec": 1, - "items": [ - { - "item_id": 0, - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error]: (firebase) missing firebaseAppId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion clicked", - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "0", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "", - "typesOfClient": "firebase", - "firebaseAppId": "", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "firebaseAppId must be provided. Aborting", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) firing page call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "rudderId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "page", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "events": [ - { - "name": "page_view", - "params": { - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) firing page call with custom properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "rudderId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "page", - "event": "page view", - "properties": { - "view": "login" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "events": [ - { - "name": "page_view", - "params": { - "view": "login", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error]: (gtag) pass timestamp more than 72 hours into the past", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-20T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "blockPageViewEvent": false, - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Allowed timestamp is [72 hours] into the past", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error]: (gtag) pass timestamp more than 15 min into the future", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-05-05T15:47:57Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "tutotial complete", - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "blockPageViewEvent": false, - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Allowed timestamp is [15 minutes] into the future", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) pass custom properties along with products: [..] parameters to GA4 standard events along with its stated ones", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "order completed", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "myCustomProp": "My arbitray value", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "products": [ - { - "product_id": "123", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "item_category2": "Board games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - } - ], - "timezone": { - "name": "Europe/Tallinn" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "purchase", - "params": { - "checkout_id": "12345", - "transaction_id": "1234", - "myCustomProp": "My arbitray value", - "affiliation": "Apple Store", - "value": 20, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "engagement_time_msec": 1, - "items": [ - { - "item_id": "123", - "sku": "G-32", - "item_name": "Monopoly", - "price": 14, - "quantity": 1, - "item_category": "Games", - "item_category2": "Board games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - } - ], - "timezone_name": "Europe/Tallinn" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) pass custom properties excluding products: [..] parameter to GA4 standard events along with its stated ones", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "promotion clicked", - "properties": { - "customProp-1": "check-1", - "customProp-2": "check-2", - "timezone": { - "name": "Europe/Tallinn" - }, - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "client_id": "client_id", - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "events": [ - { - "name": "select_promotion", - "params": { - "customProp-1": "check-1", - "customProp-2": "check-2", - "timezone_name": "Europe/Tallinn", - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) message type group -> 'join_group' with custom event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "group", - "traits": { - "custom1": 1234, - "custom2": "custom2", - "timezone": { - "name": "Europe/Tallinn" - }, - "engagementTimeMsec": 100, - "sessionId": 655 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "client_id", - "events": [ - { - "name": "join_group", - "params": { - "custom1": 1234, - "custom2": "custom2", - "timezone_name": "Europe/Tallinn", - "engagement_time_msec": 100, - "session_id": 655 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag): check args keyword for price x currency multiplication", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "price": 2.4, - "quantity": 2, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "client_id", - "events": [ - { - "name": "add_to_cart", - "params": { - "currency": "USD", - "value": 4.8, - "engagement_time_msec": 1, - "items": [ - { - "item_id": "507f1f77bcf86cd799439011", - "item_name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "item_category": "Apparel", - "item_brand": "Google", - "item_variant": "green", - "price": 19, - "quantity": 2, - "index": 1, - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ], - "price": 2.4, - "quantity": 2 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag): take page properties from context.page for 'page' call along with custom properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "rudderId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "page": { - "url": "http://morkey.in", - "path": "/cart", - "title": "miphone", - "search": "MI", - "referrer": "morkey" - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "page", - "integrations": { - "All": true - }, - "properties": { - "cust1": 1234, - "engagementTimeMsec": 100, - "sessionId": 655 - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "events": [ - { - "name": "page_view", - "params": { - "page_referrer": "morkey", - "page_title": "miphone", - "page_location": "http://morkey.in", - "cust1": 1234, - "engagement_time_msec": 100, - "session_id": 655 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error] GA4: event not as string", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-26T05:17:09Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": { - "name": "promotion_viewed" - }, - "properties": { - "creative_name": "Summer Banner", - "creative_slot": "featured_app_1", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "0", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "promotion_id": "P_12345", - "promotion_name": "Summer Sale", - "creative_name": "summer_banner2", - "creative_slot": "featured_app_1" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-20T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "track:: event name should be string", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "[Error] GA4: client_id not found in all four path", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "price": 2.4, - "quantity": 2, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": true, - "sendLoginSignup": true, - "newOrExistingUserTrait": "firstLogin", - "loginSignupMethod": "method", - "generateLead": true, - "generateLeadValueTrait": "value", - "generateLeadCurrencyTrait": "currency", - "clientIdFieldIdentifier": "properties.client_id" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "ga4ClientId, anonymousId or messageId must be provided", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "client_id isn't sent from the path defined in the webapp config, falling back to default values i.e here it is anonymousId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "price": 2.4, - "quantity": 2, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": true, - "sendLoginSignup": true, - "newOrExistingUserTrait": "firstLogin", - "loginSignupMethod": "method", - "generateLead": true, - "generateLeadValueTrait": "value", - "generateLeadCurrencyTrait": "currency", - "clientIdFieldIdentifier": "properties.client_id" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "add_to_cart", - "params": { - "items": [ - { - "index": 1, - "price": 19, - "coupon": "SUMMER_FUN", - "item_id": "507f1f77bcf86cd799439011", - "currency": "USD", - "discount": 2.22, - "quantity": 2, - "item_name": "Monopoly: 3rd Edition", - "item_brand": "Google", - "affiliation": "Google Merchandise Store", - "location_id": "L_12345", - "item_list_id": "related_products", - "item_variant": "green", - "item_category": "Apparel", - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_name": "Related Products" - } - ], - "price": 2.4, - "value": 4.8, - "currency": "USD", - "quantity": 2, - "engagement_time_msec": 1 - } - } - ], - "client_id": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "any custom or item property with array value, is flattened with underscore delimeter", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "product added", - "originalTimestamp": "2022-04-26T05:17:09Z", - "properties": { - "currency": "USD", - "total": "7.77", - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "address": { - "city": "kolkata", - "district": "24pgs" - }, - "categoryLevels": [ - "Furniture", - "Bedroom Furniture", - "Dressers & Chests" - ], - "products": [ - { - "product_id": "1234", - "product_details": { - "colour": "red", - "shape": "rectangle" - }, - "productLevels": [ - "test1", - "test2", - "test3" - ] - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-11-14T15:20:57Z" - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": false, - "sendLoginSignup": false, - "generateLead": false - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "timestamp_micros": 1650950229000000, - "non_personalized_ads": true, - "client_id": "client_id", - "events": [ - { - "name": "add_to_cart", - "params": { - "currency": "USD", - "value": 7.77, - "items": [ - { - "item_id": "1234", - "product_details_colour": "red", - "product_details_shape": "rectangle", - "productLevels_0": "test1", - "productLevels_1": "test2", - "productLevels_2": "test3" - } - ], - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345", - "address_city": "kolkata", - "address_district": "24pgs", - "categoryLevels_0": "Furniture", - "categoryLevels_1": "Bedroom Furniture", - "categoryLevels_2": "Dressers & Chests", - "engagement_time_msec": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "extract session_id from context.sessionId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36", - "sessionId": 16678456735 - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "price": 2.4, - "quantity": 2, - "client_id": "client@1234", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": true, - "sendLoginSignup": true, - "newOrExistingUserTrait": "firstLogin", - "loginSignupMethod": "method", - "generateLead": true, - "generateLeadValueTrait": "value", - "generateLeadCurrencyTrait": "currency" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "add_to_cart", - "params": { - "items": [ - { - "index": 1, - "price": 19, - "coupon": "SUMMER_FUN", - "item_id": "507f1f77bcf86cd799439011", - "currency": "USD", - "discount": 2.22, - "quantity": 2, - "item_name": "Monopoly: 3rd Edition", - "item_brand": "Google", - "affiliation": "Google Merchandise Store", - "location_id": "L_12345", - "item_list_id": "related_products", - "item_variant": "green", - "item_category": "Apparel", - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_name": "Related Products" - } - ], - "price": 2.4, - "value": 4.8, - "currency": "USD", - "quantity": 2, - "session_id": 16678456735, - "engagement_time_msec": 1, - "client_id": "client@1234" - } - } - ], - "client_id": "client_id", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) send integer userId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "userId": 34567, - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36", - "sessionId": 16678456735 - }, - "type": "track", - "event": "product added", - "properties": { - "currency": "USD", - "price": 2.4, - "quantity": 2, - "client_id": "client@1234", - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "name": "Monopoly: 3rd Edition", - "coupon": "SUMMER_FUN", - "category": "Apparel", - "brand": "Google", - "variant": "green", - "price": "19", - "quantity": "2", - "position": "1", - "affiliation": "Google Merchandise Store", - "currency": "USD", - "discount": 2.22, - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_id": "related_products", - "item_list_name": "Related Products", - "location_id": "L_12345" - } - ] - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "blockPageViewEvent": false, - "typesOfClient": "gtag", - "extendPageViewParams": false, - "sendUserId": false, - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "enableServerSideIdentify": true, - "sendLoginSignup": true, - "newOrExistingUserTrait": "firstLogin", - "loginSignupMethod": "method", - "generateLead": true, - "generateLeadValueTrait": "value", - "generateLeadCurrencyTrait": "currency" - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "add_to_cart", - "params": { - "items": [ - { - "index": 1, - "price": 19, - "coupon": "SUMMER_FUN", - "item_id": "507f1f77bcf86cd799439011", - "currency": "USD", - "discount": 2.22, - "quantity": 2, - "item_name": "Monopoly: 3rd Edition", - "item_brand": "Google", - "affiliation": "Google Merchandise Store", - "location_id": "L_12345", - "item_list_id": "related_products", - "item_variant": "green", - "item_category": "Apparel", - "item_category2": "Adult", - "item_category3": "Shirts", - "item_category4": "Crew", - "item_category5": "Short sleeve", - "item_list_name": "Related Products" - } - ], - "price": 2.4, - "value": 4.8, - "currency": "USD", - "quantity": 2, - "session_id": 16678456735, - "engagement_time_msec": 1, - "client_id": "client@1234" - } - } - ], - "client_id": "client_id", - "user_id": "34567", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) login event with user_properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "traits": { - "campaign": "advertizing" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "login", - "properties": { - "method": "facebook" - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "login", - "params": { - "method": "facebook", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "user_properties": { - "campaign": { - "value": "advertizing" - } - }, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) sign_up event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "traits": { - "campaign": "advertizing" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "sign_up", - "properties": { - "method": "google" - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "sign_up", - "params": { - "method": "google", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "user_properties": { - "campaign": { - "value": "advertizing" - } - }, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) generate_lead event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "traits": { - "campaign": "advertizing" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "generate_lead", - "properties": { - "source": "instagram", - "value": 20 - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "generate_lead", - "params": { - "currency": "USD", - "value": 20, - "source": "instagram", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "user_properties": { - "campaign": { - "value": "advertizing" - } - }, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) track call with page information such as url, title, referrer", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "page": { - "initial_referrer": "$direct", - "path": "/", - "referrer": "$direct", - "tab_url": "https://www.rudderstack.com/", - "title": "Document", - "url": "https://www.rudderstack.com/" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "generate_lead", - "properties": { - "source": "instagram", - "value": 20 - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "generate_lead", - "params": { - "currency": "USD", - "value": 20, - "source": "instagram", - "page_location": "https://www.rudderstack.com/", - "page_referrer": "$direct", - "page_title": "Document", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) track event with hybrid connection mode using buffer cloud mode event approach", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "traits": { - "campaign": "advertizing" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "generate_lead", - "properties": { - "source": "instagram", - "value": 20 - }, - "integrations": { - "All": true, - "Google Analytics 4 (GA4)": { - "clientId": "554581488.1683172875", - "sessionId": "1683172875" - } - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "connectionMode": "hybrid", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "generate_lead", - "params": { - "currency": "USD", - "value": 20, - "source": "instagram", - "session_id": "1683172875", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "user_properties": { - "campaign": { - "value": "advertizing" - } - }, - "client_id": "554581488.1683172875", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) track event with hybrid connection mode using override client_id and session_id approach", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "traits": { - "campaign": "advertizing" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36", - "sessionId": 1683172874065 - }, - "type": "track", - "event": "generate_lead", - "properties": { - "source": "instagram", - "value": 20 - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "connectionMode": "hybrid", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "generate_lead", - "params": { - "currency": "USD", - "value": 20, - "source": "instagram", - "session_id": 1683172874065, - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "user_properties": { - "campaign": { - "value": "advertizing" - } - }, - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) firing group calls with GA4 hybrid mode connection", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "group", - "event": "tutorial complete", - "integrations": { - "Google Analytics 4": { - "clientId": "4718026.1683606287", - "sessionId": "1683606287", - "sessionNumber": 1 - } - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "connectionMode": "hybrid", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://www.google-analytics.com/mp/collect", - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "body": { - "JSON": { - "non_personalized_ads": true, - "client_id": "4718026.1683606287", - "events": [ - { - "name": "join_group", - "params": { - "engagement_time_msec": 1, - "session_id": "1683606287", - "session_number": 1 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) sign_up event with all data types of user_properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "traits": { - "campaign": "advertizing", - "name": "rudder", - "age": 45, - "hobby": [ - "dancing", - "singing", - "reading" - ], - "enableEURegion": false, - "isEnterpriseUser": { - "value": false - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "sign_up", - "properties": { - "method": "google" - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6BET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "sign_up", - "params": { - "method": "google", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "user_properties": { - "age": { - "value": 45 - }, - "name": { - "value": "rudder" - }, - "campaign": { - "value": "advertizing" - }, - "enableEURegion": { - "value": false - } - }, - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "[Error]: (gtag) event name starts with numbers", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "1234_sign_up", - "properties": { - "total": "10" - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "connectionMode": "cloud", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Event name must start with a letter and can only contain letters, numbers, and underscores", - "statTags": { - "destType": "GA4", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "ga4", - "description": "(gtag) event having multiple empty array and object parameters", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "track", - "event": "logIn", - "userId": "user@1", - "group_id": "group@1", - "anon_id": "78e95d6d-58c0-4237-b99e-2ef510b6d502", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99b6f979fb551ce583373900f937" - }, - { - "type": "ga4ClientId", - "id": "client_id" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "properties": { - "user_interest": "Moderate", - "company_interest": "", - "profile": [ - { - "is_6qa": true, - "product": null, - "product_fit": "Moderate", - "product_stage": "Purchase", - "intent_score": 89, - "profile_score": 52, - "product_display$name": "rudderstack" - } - ], - "user_company": "Analytics consulting", - "user_account": "1", - "user_id_mappings": "330098|245252|461224|282599", - "company_naics_6sense": "5173", - "usr_consent": null, - "firebase_user_id": "kdgMnP", - "google_user_id": "G-123456", - "company_domain": "consulting.net", - "company_region": "New Zealand", - "user_product_interests": { - "ids": [], - "list": [ - { - "id": 330098, - "name": [] - }, - { - "id": 245252, - "name": {} - } - ], - "names": [] - }, - "company_country": {}, - "company_industry": "Business Analytics", - "company_revenue": "$5M - $10M", - "company_annual_revenue": "5568000", - "company_sic_description": "", - "company_naics_description": [] - }, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "dummyApiSecret", - "measurementId": "G-T40PE6KET4", - "firebaseAppId": "", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "connectionMode": "cloud", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "login", - "params": { - "company_annual_revenue": "5568000", - "company_domain": "consulting.net", - "company_industry": "Business Analytics", - "company_naics_6sense": "5173", - "company_region": "New Zealand", - "company_revenue": "$5M - $10M", - "engagement_time_msec": 1, - "profile_0_intent_score": 89, - "profile_0_is_6qa": true, - "profile_0_product_display$name": "rudderstack", - "profile_0_product_fit": "Moderate", - "profile_0_product_stage": "Purchase", - "profile_0_profile_score": 52, - "user_account": "1", - "user_company": "Analytics consulting", - "user_id_mappings": "330098|245252|461224|282599", - "user_interest": "Moderate", - "user_product_interests_list_0_id": 330098, - "user_product_interests_list_1_id": 245252 - } - } - ], - "user_id": "user@1", - "client_id": "client_id", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "dummyApiSecret", - "measurement_id": "G-T40PE6KET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - }, - { - "name": "ga4", - "description": "(gtag) campaign_details custom event", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "userId": "user@1", - "channel": "web", - "anonymousId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "adTrackingEnabled": "false", - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "campaign": { - "id": "google_1234", - "name": "Summer_fun", - "source": "google", - "medium": "cpc", - "term": "summer+travel", - "content": "logo link" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Campaign Details", - "properties": {}, - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiSecret": "QyWKGHj8QhG2L4ePAPiXCA", - "measurementId": "G-T40PE6BET4", - "typesOfClient": "gtag", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "events": [ - { - "name": "campaign_details", - "params": { - "campaign_id": "google_1234", - "campaign": "Summer_fun", - "source": "google", - "medium": "cpc", - "term": "summer+travel", - "content": "logo link", - "engagement_time_msec": 1 - } - } - ], - "user_id": "user@1", - "client_id": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "non_personalized_ads": true - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": { - "api_secret": "QyWKGHj8QhG2L4ePAPiXCA", - "measurement_id": "G-T40PE6BET4" - }, - "headers": { - "HOST": "www.google-analytics.com", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://www.google-analytics.com/mp/collect", - "userId": "" - }, - "statusCode": 200 - } - ] - } - }, - "mockFns": defaultMockFns - } -] \ No newline at end of file + { + name: 'ga4', + description: "(gtag) check all property mappings for 'Products Searched' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + timestamp_micros: 1650950229000000, + events: [ + { + name: 'search', + params: { + search_term: 't-shirts', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product list viewed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + rudderId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product list viewed', + properties: { + list_id: 'related_products', + category: 'Related_products', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'view_item_list', + params: { + item_list_id: 'related_products', + item_list_name: 'Related_products', + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'promotion viewed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion viewed', + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '0', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'client_id', + events: [ + { + name: 'view_promotion', + params: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 0, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'promotion clicked' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion clicked', + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '0', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'select_promotion', + params: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 0, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) exclude only 'products' property from 'promotion clicked' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion clicked', + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'select_promotion', + params: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product clicked' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product clicked', + properties: { + list_id: 'related_products', + category: 'Related_products', + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + timezone: { + name: 'Europe/Tallinn', + }, + engagementTimeMsec: 100, + sessionId: 655, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'select_item', + params: { + item_list_id: 'related_products', + item_list_name: 'Related_products', + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Related_products', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + timezone_name: 'Europe/Tallinn', + engagement_time_msec: 100, + session_id: 655, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product viewed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product viewed', + properties: { + currency: 'USD', + total: '7.77', + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'view_item', + params: { + currency: 'USD', + value: 7.77, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'promotion clicked' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion clicked', + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '0', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + typesOfClient: 'gtag', + firebaseAppId: '1:17864591371:android:7a9520d3c78962e21f9fee', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'client_id', + events: [ + { + name: 'select_promotion', + params: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 0, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(firebase) check all property mappings for 'promotion clicked' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion clicked', + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '0', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + typesOfClient: 'firebase', + firebaseAppId: '1:17864591371:android:7a9520d3c78962e21f9fee', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + firebase_app_id: '1:17864591371:android:7a9520d3c78962e21f9fee', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + app_instance_id: 'f0dd99b6f979fb551ce583373900f937', + events: [ + { + name: 'select_promotion', + params: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 0, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product added' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + total: '7.77', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'add_to_cart', + params: { + currency: 'USD', + value: 7.77, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product removed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product removed', + properties: { + currency: 'USD', + total: '7.77', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + engagementTimeMsec: 100, + sessionId: 655, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'remove_from_cart', + params: { + currency: 'USD', + value: 7.77, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + engagement_time_msec: 100, + session_id: 655, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'cart viewed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'cart viewed', + properties: { + currency: 'USD', + total: '7.77', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'view_cart', + params: { + currency: 'USD', + value: 7.77, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'checkout started' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'checkout started', + properties: { + currency: 'USD', + total: 7.77, + coupon: 'SUMMER_FUN', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'begin_checkout', + params: { + currency: 'USD', + value: 7.77, + coupon: 'SUMMER_FUN', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + "(gtag) check all property mappings for 'payment info entered' -> 'add_payment_info' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'payment info entered', + properties: { + currency: 'USD', + value: '7.77', + coupon: 'SUMMER_FUN', + payment_method: 'Credit Card', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + params: { + currency: 'USD', + value: 7.77, + coupon: 'SUMMER_FUN', + payment_type: 'Credit Card', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + name: 'add_payment_info', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + "(gtag) check all property mappings for 'checkout Step Completed' -> 'add_shipping_info' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'checkout Step Completed', + properties: { + currency: 'USD', + value: '7.77', + coupon: 'SUMMER_FUN', + shipping_method: 'Ground', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + params: { + currency: 'USD', + value: 7.77, + coupon: 'SUMMER_FUN', + shipping_tier: 'Ground', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + name: 'add_shipping_info', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'order completed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'order completed', + properties: { + currency: 'USD', + order_id: 'T_12345', + total: 12.21, + affiliation: 'Google Store', + coupon: 'SUMMER_FUN', + shipping: 3.33, + tax: 1.11, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'purchase', + params: { + currency: 'USD', + transaction_id: 'T_12345', + value: 12.21, + affiliation: 'Google Store', + coupon: 'SUMMER_FUN', + shipping: 3.33, + tax: 1.11, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'order refunded' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'order refunded', + properties: { + currency: 'USD', + order_id: 'T_12345', + total: 12.21, + affiliation: 'Google Store', + coupon: 'SUMMER_FUN', + shipping: 3.33, + tax: 1.11, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'refund', + params: { + currency: 'USD', + transaction_id: 'T_12345', + value: 12.21, + affiliation: 'Google Store', + coupon: 'SUMMER_FUN', + shipping: 3.33, + tax: 1.11, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) exclude only 'products' property from 'order refunded' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'order refunded', + properties: { + currency: 'USD', + order_id: 'T_12345', + total: 12.21, + affiliation: 'Google Store', + coupon: 'SUMMER_FUN', + shipping: 3.33, + tax: 1.11, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'refund', + params: { + currency: 'USD', + transaction_id: 'T_12345', + value: 12.21, + affiliation: 'Google Store', + coupon: 'SUMMER_FUN', + shipping: 3.33, + tax: 1.11, + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product added to wishlist' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added to wishlist', + properties: { + currency: 'USD', + total: '7.77', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'add_to_wishlist', + params: { + currency: 'USD', + value: 7.77, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product_shared' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product_shared', + properties: { + share_via: 'Twitter', + content_type: 'image', + item_id: 'C_12345', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'share', + params: { + method: 'Twitter', + content_type: 'image', + item_id: 'C_12345', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'product_shared' event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product_shared', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'share', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'cart Shared' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'cart Shared', + properties: { + share_via: 'Twitter', + content_type: 'image', + item_id: 'C_12345', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'share', + params: { + method: 'Twitter', + content_type: 'image', + item_id: 'C_12345', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'cart Shared' event name with empty properties: {}", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'cart Shared', + properties: {}, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'share', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) check all property mappings for group call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'group', + properties: { + group_id: 'G_12345', + engagementTimeMsec: 100, + sessionId: 655, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'group', + params: { + group_id: 'G_12345', + engagement_time_msec: 100, + session_id: 655, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) group: send only group event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'group', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'group', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'earn virtual currency' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'earn virtual currency', + properties: { + virtual_currency_name: 'Gems', + value: 5, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'earn_virtual_currency', + params: { + virtual_currency_name: 'Gems', + value: 5, + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'earn virtual currency' event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'earn virtual currency', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'earn_virtual_currency', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'generate_lead' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'generate_lead', + properties: { + currency: 'USD', + value: 99.99, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'generate_lead', + params: { + currency: 'USD', + value: 99.99, + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'level_up' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'level_up', + properties: { + level: 5, + character: 'Player 1', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'level_up', + params: { + level: 5, + character: 'Player 1', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'level_up' event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'level_up', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'level_up', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'login' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'login', + properties: { + method: 'Google', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'login', + params: { + method: 'Google', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'login' event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'login', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'login', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'post_score' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'post_score', + properties: { + score: 10000, + level: 5, + character: 'Player 1', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'post_score', + params: { + score: 10000, + level: 5, + character: 'Player 1', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'login' event name with its required `score` properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'post_score', + properties: { + score: 10000, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'post_score', + params: { + score: 10000, + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'select_content' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'select_content', + properties: { + content_type: 'product', + item_id: 'I_12345', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'select_content', + params: { + content_type: 'product', + item_id: 'I_12345', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'group' event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'select_content', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'select_content', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'sign_up' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'sign_up', + properties: { + method: 'Google', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'sign_up', + params: { + method: 'Google', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send only 'sign_up' event name without it's properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'sign_up', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'sign_up', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'spend_virtual_currency' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'spend_virtual_currency', + properties: { + value: 5, + virtual_currency_name: 'Gems', + item_name: 'Starter Boost', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'spend_virtual_currency', + params: { + value: 5, + virtual_currency_name: 'Gems', + item_name: 'Starter Boost', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + "(gtag) send only 'spend_virtual_currency' event name with it's required 'value' and 'virtual_currency_name' properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'spend_virtual_currency', + properties: { + value: 5, + virtual_currency_name: 'Gems', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'spend_virtual_currency', + params: { + value: 5, + virtual_currency_name: 'Gems', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send 'tutorial_begin' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutorial_begin', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'tutorial_begin', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send 'tutorial_complete' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutorial_complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'tutorial_complete', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send all properties for 'unlock_achievement' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'unlock_achievement', + properties: { + achievement_id: 'A_12345', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'unlock_achievement', + params: { + achievement_id: 'A_12345', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) send all properties for 'view_search_results' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'view_search_results', + properties: { + search_term: 'Clothing', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'view_search_results', + params: { + search_term: 'Clothing', + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) pass only 'products: [...]' property for 'view_search_results' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'view_search_results', + properties: { + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'view_search_results', + params: { + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + "(gtag) pass custom event name 'rudderstack event' to GA4 along with custom properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'rudderstack event', + properties: { + total: '10', + timezone: { + name: 'Europe/Tallinn', + }, + engagementTimeMsec: 100, + sessionId: 655, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'rudderstack_event', + params: { + total: '10', + timezone_name: 'Europe/Tallinn', + engagement_time_msec: 100, + session_id: 655, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + "(gtag) pass custom event name 'rudderstack event' to GA4 along with custom properties and user_properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'rudderstack event', + properties: { + total: '10', + user_properties: { + price: '19', + }, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + user_properties: { + price: { + value: '19', + }, + }, + events: [ + { + name: 'rudderstack_event', + params: { + total: '10', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error]: (gtag) pass reserved event name to GA4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'ad_click', + properties: { + total: '10', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'track:: Reserved event names are not allowed', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Exclusion]: (gtag) pass reserved property name to GA4 for custom events', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'rudderstack event', + properties: { + firebase_conversion: 'firebase_conversion', + google_id: '1234', + ga_value: 'ga_value', + value: '10', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'rudderstack_event', + params: { + value: '10', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + '[Exclusion]: (gtag) pass reserved property name and reserved properties in `user_properties` to GA4 for custom events', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'rudderstack event', + properties: { + firebase_conversion: 'firebase_conversion', + google_id: '1234', + ga_value: 'ga_value', + value: '10', + user_properties: { + first_open_time: 'first_open_time', + user_id: 'user_id', + firebase_value: 'firebase_value', + price: '100', + }, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + user_properties: { + price: { + value: '100', + }, + }, + events: [ + { + name: 'rudderstack_event', + params: { + value: '10', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error]: (gtag) pass reserved event names along with reserved properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'app_remove', + properties: { + firebase_conversion: 'firebase_conversion', + google_id: '1234', + ga_value: 'ga_value', + value: '10', + user_properties: { + first_open_time: 'first_open_time', + user_id: 'user_id', + firebase_value: 'firebase_value', + price: '100', + }, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'track:: Reserved event names are not allowed', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error] (gtag) pass reserved custom prefix names to GA4 events', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'firebase_event1', + properties: { + firebase_conversion: 'firebase_conversion', + google_id: '1234', + ga_value: 'ga_value', + value: '10', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Reserved custom prefix names are not allowed', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'product added' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + total: '7.77', + google_data: 'google_data', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'add_to_cart', + params: { + currency: 'USD', + value: 7.77, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) pass custom event name with its properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'rudderstack event', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'rudderstack_event', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) map 'product added' properties to ga4 'add_to_cart' items array", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + affiliation: 'Google Merchandise Store', + brand: 'Google', + category: 'Related_products', + coupon: 'SUMMER_FUN', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + list_id: 'related_products', + location_id: 'L_12345', + name: 'Monopoly: 3rd Edition', + position: '1', + price: '19', + product_id: '507f1f77bcf86cd799439011', + products: [], + quantity: '2', + total: '7.77', + variant: 'green', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + client_id: 'client_id', + events: [ + { + name: 'add_to_cart', + params: { + currency: 'USD', + engagement_time_msec: 1, + items: [ + { + affiliation: 'Google Merchandise Store', + coupon: 'SUMMER_FUN', + currency: 'USD', + discount: 2.22, + index: 1, + item_brand: 'Google', + item_category: 'Related_products', + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_id: '507f1f77bcf86cd799439011', + item_list_id: 'related_products', + item_list_name: 'Related Products', + item_name: 'Monopoly: 3rd Edition', + item_variant: 'green', + location_id: 'L_12345', + price: 19, + quantity: 2, + }, + ], + list_id: 'related_products', + value: 7.77, + }, + }, + ], + non_personalized_ads: true, + timestamp_micros: 1650950229000000, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://www.google-analytics.com/mp/collect', + files: {}, + headers: { + 'Content-Type': 'application/json', + HOST: 'www.google-analytics.com', + }, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + '(gtag) pass event name with invalid data type for products: {...} properties (when products parameter is optional)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + total: '7.77', + products: { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + affiliation: 'Google Merchandise Store', + brand: 'Google', + category: 'Related_products', + coupon: 'SUMMER_FUN', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + list_id: 'related_products', + location_id: 'L_12345', + name: 'Monopoly: 3rd Edition', + position: '1', + price: '19', + product_id: '507f1f77bcf86cd799439011', + quantity: '2', + variant: 'green', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + client_id: 'client_id', + events: [ + { + name: 'add_to_cart', + params: { + currency: 'USD', + engagement_time_msec: 1, + items: [ + { + affiliation: 'Google Merchandise Store', + coupon: 'SUMMER_FUN', + currency: 'USD', + discount: 2.22, + index: 1, + item_brand: 'Google', + item_category: 'Related_products', + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_id: '507f1f77bcf86cd799439011', + item_list_id: 'related_products', + item_list_name: 'Related Products', + item_name: 'Monopoly: 3rd Edition', + item_variant: 'green', + location_id: 'L_12345', + price: 19, + quantity: 2, + }, + ], + list_id: 'related_products', + value: 7.77, + }, + }, + ], + non_personalized_ads: true, + timestamp_micros: 1650950229000000, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://www.google-analytics.com/mp/collect', + files: {}, + headers: { + 'Content-Type': 'application/json', + HOST: 'www.google-analytics.com', + }, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + '[Error] (gtag) pass event name to GA4 with missing fields i.e required in products: [..]', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + total: '7.77', + products: [ + { + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'One of product_id or name is required', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: + '[Error] (gtag) pass event name to GA4 with missing fields i.e required in properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Viewed', + properties: { + currency: 'USD', + total: '7.77', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'One of product_id or name is required', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error] (gtag) missing API Secret', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'API Secret not found. Aborting ', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error] (gtag) missing measurementId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: '', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'measurementId must be provided. Aborting', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '(gtag) firing group event with event name. should take event name by default', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'group', + event: 'tutorial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'client_id', + events: [ + { + name: 'join_group', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error] (gtag) payload has missing message.type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message Type is not present. Aborting message.', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error] (gtag) payload has missing event name', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event name is required', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '(gtag) taking client_id from anonymousId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + events: [ + { + name: 'tutotial_complete', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error] (firebase) payload has missing ga4AppInstanceId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: '', + firebaseAppId: '1:17864591371:android:7a9520d3c78962e21f9fee', + blockPageViewEvent: false, + typesOfClient: 'firebase', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'ga4AppInstanceId must be provided under externalId', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error] (firebase) pass reserved event name', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'app_store_subscription_cancel', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: '', + firebaseAppId: '1:17864591371:android:7a9520d3c78962e21f9fee', + blockPageViewEvent: false, + typesOfClient: 'firebase', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Reserved custom event names are not allowed', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'tutorial complete' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutorial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + non_personalized_ads: true, + events: [ + { + name: 'tutorial_complete', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) check all property mappings for 'cart viewed' event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'cart viewed', + properties: { + currency: 'USD', + total: '7.77', + products: [ + { + product_id: 0, + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'view_cart', + params: { + currency: 'USD', + value: 7.77, + engagement_time_msec: 1, + items: [ + { + item_id: 0, + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error]: (firebase) missing firebaseAppId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion clicked', + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '0', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: '', + typesOfClient: 'firebase', + firebaseAppId: '', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'firebaseAppId must be provided. Aborting', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '(gtag) firing page call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + rudderId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'page', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + events: [ + { + name: 'page_view', + params: { + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) firing page call with custom properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + rudderId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'page', + event: 'page view', + properties: { + view: 'login', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + events: [ + { + name: 'page_view', + params: { + view: 'login', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error]: (gtag) pass timestamp more than 72 hours into the past', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-20T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + blockPageViewEvent: false, + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Allowed timestamp is [72 hours] into the past', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error]: (gtag) pass timestamp more than 15 min into the future', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-05-05T15:47:57Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'tutotial complete', + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + blockPageViewEvent: false, + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Allowed timestamp is [15 minutes] into the future', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: + '(gtag) pass custom properties along with products: [..] parameters to GA4 standard events along with its stated ones', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'order completed', + properties: { + checkout_id: '12345', + order_id: '1234', + myCustomProp: 'My arbitray value', + affiliation: 'Apple Store', + total: 20, + revenue: 15, + shipping: 22, + tax: 1, + discount: 1.5, + coupon: 'ImagePro', + currency: 'USD', + products: [ + { + product_id: '123', + sku: 'G-32', + name: 'Monopoly', + price: 14, + quantity: 1, + category: 'Games', + item_category2: 'Board games', + url: 'https://www.website.com/product/path', + image_url: 'https://www.website.com/product/path.jpg', + }, + ], + timezone: { + name: 'Europe/Tallinn', + }, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'purchase', + params: { + checkout_id: '12345', + transaction_id: '1234', + myCustomProp: 'My arbitray value', + affiliation: 'Apple Store', + value: 20, + shipping: 22, + tax: 1, + discount: 1.5, + coupon: 'ImagePro', + currency: 'USD', + engagement_time_msec: 1, + items: [ + { + item_id: '123', + sku: 'G-32', + item_name: 'Monopoly', + price: 14, + quantity: 1, + item_category: 'Games', + item_category2: 'Board games', + url: 'https://www.website.com/product/path', + image_url: 'https://www.website.com/product/path.jpg', + }, + ], + timezone_name: 'Europe/Tallinn', + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + '(gtag) pass custom properties excluding products: [..] parameter to GA4 standard events along with its stated ones', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'promotion clicked', + properties: { + 'customProp-1': 'check-1', + 'customProp-2': 'check-2', + timezone: { + name: 'Europe/Tallinn', + }, + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + client_id: 'client_id', + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + events: [ + { + name: 'select_promotion', + params: { + 'customProp-1': 'check-1', + 'customProp-2': 'check-2', + timezone_name: 'Europe/Tallinn', + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: "(gtag) message type group -> 'join_group' with custom event", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'group', + traits: { + custom1: 1234, + custom2: 'custom2', + timezone: { + name: 'Europe/Tallinn', + }, + engagementTimeMsec: 100, + sessionId: 655, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'client_id', + events: [ + { + name: 'join_group', + params: { + custom1: 1234, + custom2: 'custom2', + timezone_name: 'Europe/Tallinn', + engagement_time_msec: 100, + session_id: 655, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag): check args keyword for price x currency multiplication', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + price: 2.4, + quantity: 2, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'client_id', + events: [ + { + name: 'add_to_cart', + params: { + currency: 'USD', + value: 4.8, + engagement_time_msec: 1, + items: [ + { + item_id: '507f1f77bcf86cd799439011', + item_name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + item_category: 'Apparel', + item_brand: 'Google', + item_variant: 'green', + price: 19, + quantity: 2, + index: 1, + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + price: 2.4, + quantity: 2, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + "(gtag): take page properties from context.page for 'page' call along with custom properties", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + rudderId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'page', + integrations: { + All: true, + }, + properties: { + cust1: 1234, + engagementTimeMsec: 100, + sessionId: 655, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + events: [ + { + name: 'page_view', + params: { + page_referrer: 'morkey', + page_title: 'miphone', + page_location: 'http://morkey.in', + cust1: 1234, + engagement_time_msec: 100, + session_id: 655, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error] GA4: event not as string', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-26T05:17:09Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: { + name: 'promotion_viewed', + }, + properties: { + creative_name: 'Summer Banner', + creative_slot: 'featured_app_1', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '0', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + promotion_id: 'P_12345', + promotion_name: 'Summer Sale', + creative_name: 'summer_banner2', + creative_slot: 'featured_app_1', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-20T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'track:: event name should be string', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '[Error] GA4: client_id not found in all four path', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + price: 2.4, + quantity: 2, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: true, + sendLoginSignup: true, + newOrExistingUserTrait: 'firstLogin', + loginSignupMethod: 'method', + generateLead: true, + generateLeadValueTrait: 'value', + generateLeadCurrencyTrait: 'currency', + clientIdFieldIdentifier: 'properties.client_id', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'ga4ClientId, anonymousId or messageId must be provided', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: + "client_id isn't sent from the path defined in the webapp config, falling back to default values i.e here it is anonymousId", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + price: 2.4, + quantity: 2, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: true, + sendLoginSignup: true, + newOrExistingUserTrait: 'firstLogin', + loginSignupMethod: 'method', + generateLead: true, + generateLeadValueTrait: 'value', + generateLeadCurrencyTrait: 'currency', + clientIdFieldIdentifier: 'properties.client_id', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'add_to_cart', + params: { + items: [ + { + index: 1, + price: 19, + coupon: 'SUMMER_FUN', + item_id: '507f1f77bcf86cd799439011', + currency: 'USD', + discount: 2.22, + quantity: 2, + item_name: 'Monopoly: 3rd Edition', + item_brand: 'Google', + affiliation: 'Google Merchandise Store', + location_id: 'L_12345', + item_list_id: 'related_products', + item_variant: 'green', + item_category: 'Apparel', + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_name: 'Related Products', + }, + ], + price: 2.4, + value: 4.8, + currency: 'USD', + quantity: 2, + engagement_time_msec: 1, + }, + }, + ], + client_id: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + 'any custom or item property with array value, is flattened with underscore delimeter', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'product added', + originalTimestamp: '2022-04-26T05:17:09Z', + properties: { + currency: 'USD', + total: '7.77', + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + address: { + city: 'kolkata', + district: '24pgs', + }, + categoryLevels: ['Furniture', 'Bedroom Furniture', 'Dressers & Chests'], + products: [ + { + product_id: '1234', + product_details: { + colour: 'red', + shape: 'rectangle', + }, + productLevels: ['test1', 'test2', 'test3'], + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-11-14T15:20:57Z', + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: false, + sendLoginSignup: false, + generateLead: false, + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + timestamp_micros: 1650950229000000, + non_personalized_ads: true, + client_id: 'client_id', + events: [ + { + name: 'add_to_cart', + params: { + currency: 'USD', + value: 7.77, + items: [ + { + item_id: '1234', + product_details_colour: 'red', + product_details_shape: 'rectangle', + productLevels_0: 'test1', + productLevels_1: 'test2', + productLevels_2: 'test3', + }, + ], + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + address_city: 'kolkata', + address_district: '24pgs', + categoryLevels_0: 'Furniture', + categoryLevels_1: 'Bedroom Furniture', + categoryLevels_2: 'Dressers & Chests', + engagement_time_msec: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: 'extract session_id from context.sessionId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + sessionId: 16678456735, + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + price: 2.4, + quantity: 2, + client_id: 'client@1234', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: true, + sendLoginSignup: true, + newOrExistingUserTrait: 'firstLogin', + loginSignupMethod: 'method', + generateLead: true, + generateLeadValueTrait: 'value', + generateLeadCurrencyTrait: 'currency', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'add_to_cart', + params: { + items: [ + { + index: 1, + price: 19, + coupon: 'SUMMER_FUN', + item_id: '507f1f77bcf86cd799439011', + currency: 'USD', + discount: 2.22, + quantity: 2, + item_name: 'Monopoly: 3rd Edition', + item_brand: 'Google', + affiliation: 'Google Merchandise Store', + location_id: 'L_12345', + item_list_id: 'related_products', + item_variant: 'green', + item_category: 'Apparel', + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_name: 'Related Products', + }, + ], + price: 2.4, + value: 4.8, + currency: 'USD', + quantity: 2, + session_id: 16678456735, + engagement_time_msec: 1, + client_id: 'client@1234', + }, + }, + ], + client_id: 'client_id', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) send integer userId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + userId: 34567, + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + sessionId: 16678456735, + }, + type: 'track', + event: 'product added', + properties: { + currency: 'USD', + price: 2.4, + quantity: 2, + client_id: 'client@1234', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + name: 'Monopoly: 3rd Edition', + coupon: 'SUMMER_FUN', + category: 'Apparel', + brand: 'Google', + variant: 'green', + price: '19', + quantity: '2', + position: '1', + affiliation: 'Google Merchandise Store', + currency: 'USD', + discount: 2.22, + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_id: 'related_products', + item_list_name: 'Related Products', + location_id: 'L_12345', + }, + ], + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + blockPageViewEvent: false, + typesOfClient: 'gtag', + extendPageViewParams: false, + sendUserId: false, + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + enableServerSideIdentify: true, + sendLoginSignup: true, + newOrExistingUserTrait: 'firstLogin', + loginSignupMethod: 'method', + generateLead: true, + generateLeadValueTrait: 'value', + generateLeadCurrencyTrait: 'currency', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'add_to_cart', + params: { + items: [ + { + index: 1, + price: 19, + coupon: 'SUMMER_FUN', + item_id: '507f1f77bcf86cd799439011', + currency: 'USD', + discount: 2.22, + quantity: 2, + item_name: 'Monopoly: 3rd Edition', + item_brand: 'Google', + affiliation: 'Google Merchandise Store', + location_id: 'L_12345', + item_list_id: 'related_products', + item_variant: 'green', + item_category: 'Apparel', + item_category2: 'Adult', + item_category3: 'Shirts', + item_category4: 'Crew', + item_category5: 'Short sleeve', + item_list_name: 'Related Products', + }, + ], + price: 2.4, + value: 4.8, + currency: 'USD', + quantity: 2, + session_id: 16678456735, + engagement_time_msec: 1, + client_id: 'client@1234', + }, + }, + ], + client_id: 'client_id', + user_id: '34567', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) login event with user_properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + traits: { + campaign: 'advertizing', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'login', + properties: { + method: 'facebook', + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'login', + params: { + method: 'facebook', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + user_properties: { + campaign: { + value: 'advertizing', + }, + }, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) sign_up event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + traits: { + campaign: 'advertizing', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'sign_up', + properties: { + method: 'google', + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'sign_up', + params: { + method: 'google', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + user_properties: { + campaign: { + value: 'advertizing', + }, + }, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) generate_lead event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + traits: { + campaign: 'advertizing', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'generate_lead', + properties: { + source: 'instagram', + value: 20, + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'generate_lead', + params: { + currency: 'USD', + value: 20, + source: 'instagram', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + user_properties: { + campaign: { + value: 'advertizing', + }, + }, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) track call with page information such as url, title, referrer', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + page: { + initial_referrer: '$direct', + path: '/', + referrer: '$direct', + tab_url: 'https://www.rudderstack.com/', + title: 'Document', + url: 'https://www.rudderstack.com/', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'generate_lead', + properties: { + source: 'instagram', + value: 20, + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'generate_lead', + params: { + currency: 'USD', + value: 20, + source: 'instagram', + page_location: 'https://www.rudderstack.com/', + page_referrer: '$direct', + page_title: 'Document', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + '(gtag) track event with hybrid connection mode using buffer cloud mode event approach', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + traits: { + campaign: 'advertizing', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'generate_lead', + properties: { + source: 'instagram', + value: 20, + }, + integrations: { + All: true, + 'Google Analytics 4 (GA4)': { + clientId: '554581488.1683172875', + sessionId: '1683172875', + }, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + connectionMode: 'hybrid', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'generate_lead', + params: { + currency: 'USD', + value: 20, + source: 'instagram', + session_id: '1683172875', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + user_properties: { + campaign: { + value: 'advertizing', + }, + }, + client_id: '554581488.1683172875', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: + '(gtag) track event with hybrid connection mode using override client_id and session_id approach', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + traits: { + campaign: 'advertizing', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + sessionId: 1683172874065, + }, + type: 'track', + event: 'generate_lead', + properties: { + source: 'instagram', + value: 20, + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + connectionMode: 'hybrid', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'generate_lead', + params: { + currency: 'USD', + value: 20, + source: 'instagram', + session_id: 1683172874065, + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + user_properties: { + campaign: { + value: 'advertizing', + }, + }, + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) firing group calls with GA4 hybrid mode connection', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'group', + event: 'tutorial complete', + integrations: { + 'Google Analytics 4': { + clientId: '4718026.1683606287', + sessionId: '1683606287', + sessionNumber: 1, + }, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + connectionMode: 'hybrid', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + non_personalized_ads: true, + client_id: '4718026.1683606287', + events: [ + { + name: 'join_group', + params: { + engagement_time_msec: 1, + session_id: '1683606287', + session_number: 1, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) sign_up event with all data types of user_properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + traits: { + campaign: 'advertizing', + name: 'rudder', + age: 45, + hobby: ['dancing', 'singing', 'reading'], + enableEURegion: false, + isEnterpriseUser: { + value: false, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'sign_up', + properties: { + method: 'google', + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6BET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'sign_up', + params: { + method: 'google', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + user_properties: { + age: { + value: 45, + }, + name: { + value: 'rudder', + }, + campaign: { + value: 'advertizing', + }, + enableEURegion: { + value: false, + }, + }, + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '[Error]: (gtag) event name starts with numbers', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: '1234_sign_up', + properties: { + total: '10', + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + connectionMode: 'cloud', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Event name must start with a letter and can only contain letters, numbers, and underscores', + statTags: { + destType: 'GA4', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'ga4', + description: '(gtag) event having multiple empty array and object parameters', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'logIn', + userId: 'user@1', + group_id: 'group@1', + anon_id: '78e95d6d-58c0-4237-b99e-2ef510b6d502', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99b6f979fb551ce583373900f937', + }, + { + type: 'ga4ClientId', + id: 'client_id', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + properties: { + user_interest: 'Moderate', + company_interest: '', + profile: [ + { + is_6qa: true, + product: null, + product_fit: 'Moderate', + product_stage: 'Purchase', + intent_score: 89, + profile_score: 52, + product_display$name: 'rudderstack', + }, + ], + user_company: 'Analytics consulting', + user_account: '1', + user_id_mappings: '330098|245252|461224|282599', + company_naics_6sense: '5173', + usr_consent: null, + firebase_user_id: 'kdgMnP', + google_user_id: 'G-123456', + company_domain: 'consulting.net', + company_region: 'New Zealand', + user_product_interests: { + ids: [], + list: [ + { + id: 330098, + name: [], + }, + { + id: 245252, + name: {}, + }, + ], + names: [], + }, + company_country: {}, + company_industry: 'Business Analytics', + company_revenue: '$5M - $10M', + company_annual_revenue: '5568000', + company_sic_description: '', + company_naics_description: [], + }, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'dummyApiSecret', + measurementId: 'G-T40PE6KET4', + firebaseAppId: '', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + connectionMode: 'cloud', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'login', + params: { + company_annual_revenue: '5568000', + company_domain: 'consulting.net', + company_industry: 'Business Analytics', + company_naics_6sense: '5173', + company_region: 'New Zealand', + company_revenue: '$5M - $10M', + engagement_time_msec: 1, + profile_0_intent_score: 89, + profile_0_is_6qa: true, + profile_0_product_display$name: 'rudderstack', + profile_0_product_fit: 'Moderate', + profile_0_product_stage: 'Purchase', + profile_0_profile_score: 52, + user_account: '1', + user_company: 'Analytics consulting', + user_id_mappings: '330098|245252|461224|282599', + user_interest: 'Moderate', + user_product_interests_list_0_id: 330098, + user_product_interests_list_1_id: 245252, + }, + }, + ], + user_id: 'user@1', + client_id: 'client_id', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4', + description: '(gtag) campaign_details custom event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + userId: 'user@1', + channel: 'web', + anonymousId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + adTrackingEnabled: 'false', + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + campaign: { + id: 'google_1234', + name: 'Summer_fun', + source: 'google', + medium: 'cpc', + term: 'summer+travel', + content: 'logo link', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Campaign Details', + properties: {}, + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiSecret: 'QyWKGHj8QhG2L4ePAPiXCA', + measurementId: 'G-T40PE6BET4', + typesOfClient: 'gtag', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'campaign_details', + params: { + campaign_id: 'google_1234', + campaign: 'Summer_fun', + source: 'google', + medium: 'cpc', + term: 'summer+travel', + content: 'logo link', + engagement_time_msec: 1, + }, + }, + ], + user_id: 'user@1', + client_id: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + non_personalized_ads: true, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + api_secret: 'QyWKGHj8QhG2L4ePAPiXCA', + measurement_id: 'G-T40PE6BET4', + }, + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://www.google-analytics.com/mp/collect', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, +]; diff --git a/test/integrations/destinations/gainsight/network.ts b/test/integrations/destinations/gainsight/network.ts new file mode 100644 index 0000000000..c8adf871b9 --- /dev/null +++ b/test/integrations/destinations/gainsight/network.ts @@ -0,0 +1,71 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://demo-domain.gainsightcloud.com/v1/data/objects/query/Company', + method: 'POST', + }, + httpRes: { + data: { + "result": true, + "errorCode": null, + "errorDesc": null, + "requestId": "47d9c8be-4912-4610-806c-0eec22b73236", + "data": { + "records": [] + }, + "message": null + }, + status: 200 + }, + }, + { + httpReq: { + url: 'https://demo-domain.gainsightcloud.com/v1/data/objects/Company', + method: 'POST', + }, + httpRes: { + data: { + "result": true, + "errorCode": null, + "errorDesc": null, + "requestId": "3ce46d4a-6a83-4a92-97b3-d9788a296af8", + "data": { + "count": 1, + "errors": null, + "records": [ + { + "Gsid": "1P0203VCESP7AUQMV9E953G" + } + ] + }, + "message": null + }, + status: 200 + }, + }, + { + httpReq: { + url: "https://demo-domain.gainsightcloud.com/v1/data/objects/Company?keys=Name", + method: 'GET', + }, + httpRes: { + data: { + "result": true, + "errorCode": null, + "errorDesc": null, + "requestId": "30630809-40a7-45d2-9673-ac2e80d06f33", + "data": { + "count": 1, + "errors": null, + "records": [ + { + "Gsid": "1P0203VCESP7AUQMV9E953G" + } + ] + }, + "message": null + }, + status: 200 + }, + } +]; diff --git a/test/integrations/destinations/gainsight/processor/data.ts b/test/integrations/destinations/gainsight/processor/data.ts new file mode 100644 index 0000000000..5844c22b65 --- /dev/null +++ b/test/integrations/destinations/gainsight/processor/data.ts @@ -0,0 +1,970 @@ +export const data = [ + { + "name": "gainsight", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "personMap": [], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "identify", + "traits": { + "email": "cosmo@krammer.com", + "name": "Cosmo Krammer", + "linkedinUrl": "https://linkedin.com/cosmo-krammer", + "location": "New York", + "emailOptOut": true, + "masterAvatarTypeCode": 10 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "Email": "cosmo@krammer.com", + "Name": "Cosmo Krammer", + "LinkedinUrl": "https://linkedin.com/cosmo-krammer", + "Location": "New York", + "EmailOptOut": true, + "MasterAvatarTypeCode": 10 + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "personMap": [ + { + "from": "age", + "to": "age__gc" + } + ], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "identify", + "traits": { + "email": "cosmo@krammer.com", + "name": "Cosmo Krammer", + "linkedinUrl": "https://linkedin.com/cosmo-krammer", + "location": "New York", + "emailOptOut": true, + "masterAvatarTypeCode": 10, + "age": 35, + "randomKey": "this should be dropped" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "Email": "cosmo@krammer.com", + "Name": "Cosmo Krammer", + "LinkedinUrl": "https://linkedin.com/cosmo-krammer", + "Location": "New York", + "EmailOptOut": true, + "MasterAvatarTypeCode": 10, + "age__gc": 35 + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "personMap": [], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "identify", + "traits": { + "name": "Cosmo Krammer", + "linkedinUrl": "https://linkedin.com/cosmo-krammer", + "location": "New York", + "emailOptOut": true, + "masterAvatarTypeCode": 10 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "email is required for identify", + "statTags": { + "destType": "GAINSIGHT", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "sharedSecret": "sample-shared-secret", + "eventNameMap": [ + { + "from": "Ticket Resolved", + "to": "Ticket Resolved Event" + } + ], + "eventVersionMap": [ + { + "from": "Ticket Resolved", + "to": "1.0.0" + } + ], + "topicName": "Ticket Actions", + "tenantId": "sample-tenant-id", + "personMap": [], + "companyMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "track", + "event": "Ticket Resolved", + "properties": { + "ticketId": "sample-ticket-id", + "actionEmail": "sample@email.com", + "status": "resovled" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "ticketId": "sample-ticket-id", + "actionEmail": "sample@email.com", + "status": "resovled" + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "tenantId": "sample-tenant-id", + "sharedSecret": "sample-shared-secret", + "Content-Type": "application/json", + "topicName": "Ticket Actions", + "eventName": "Ticket Resolved Event", + "eventVersion": "1.0.0" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/eventManager/event", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "sharedSecret": "sample-shared-secret", + "personMap": [], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "email": "krammer@seinfeld.com" + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "group", + "traits": { + "name": "Kramerica Industries", + "industry": "Sitcom", + "employees": "100", + "status": "complete", + "companyType": "spoof" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "Email": "krammer@seinfeld.com", + "companies": [ + { + "Company_ID": "1P0203VCESP7AUQMV9E953G" + } + ] + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "sharedSecret": "sample-shared-secret", + "personMap": [], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "email": "krammer@seinfeld.com" + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "group", + "traits": { + "name": "Seinfeld Corps", + "industry": "TV Series", + "employees": "50", + "status": "complete" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "Email": "krammer@seinfeld.com", + "companies": [ + { + "Company_ID": "1P0203VCESP7AUQMV9E953G" + } + ] + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "personMap": [], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "identify", + "traits": { + "email": "cosmo@krammer.com", + "firstname": "Cosmo", + "lastname": "Krammer", + "linkedinUrl": "https://linkedin.com/cosmo-krammer", + "location": "New York", + "emailOptOut": true, + "masterAvatarTypeCode": 10 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "Email": "cosmo@krammer.com", + "FirstName": "Cosmo", + "LastName": "Krammer", + "Name": "Cosmo Krammer", + "LinkedinUrl": "https://linkedin.com/cosmo-krammer", + "Location": "New York", + "EmailOptOut": true, + "MasterAvatarTypeCode": 10 + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "sharedSecret": "sample-shared-secret", + "eventNameMap": [ + { + "from": "Ticket Resolved", + "to": "Ticket Resolved Event" + } + ], + "eventVersionMap": [ + { + "from": "Ticket Resolved", + "to": "1.0.0" + } + ], + "topicName": "Ticket Actions", + "tenantId": "sample-tenant-id", + "personMap": [], + "companyMap": [], + "contractId": "externalId-shall-get-precedence" + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "gainsightEventContractId", + "id": "sample-contract-id" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "track", + "event": "Ticket Resolved", + "properties": { + "ticketId": "sample-ticket-id", + "actionEmail": "sample@email.com", + "status": "resovled" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "ticketId": "sample-ticket-id", + "actionEmail": "sample@email.com", + "status": "resovled" + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "tenantId": "sample-tenant-id", + "sharedSecret": "sample-shared-secret", + "Content-Type": "application/json", + "topicName": "Ticket Actions", + "eventName": "Ticket Resolved Event", + "eventVersion": "1.0.0", + "contractId": "sample-contract-id" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/eventManager/event", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "domain": "demo-domain.gainsightcloud.com", + "accessKey": "sample-access-key", + "personMap": [ + { + "from": "car", + "to": "car__gc" + } + ], + "companyMap": [], + "eventNameMap": [], + "eventVersionMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "identify", + "traits": { + "name": "Bruce Wayne", + "email": "ceo@waynefoundation.com", + "car": "Batmobile", + "comments": "I am Batman!", + "lastName": "Wayne", + "location": "Gotham Central", + "firstName": "Bruce", + "linkedinUrl": "https://www.linkedin.com/in/notyourBatman/" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "Name": "Bruce Wayne", + "Email": "ceo@waynefoundation.com", + "car__gc": "Batmobile", + "Comments": "I am Batman!", + "LastName": "Wayne", + "Location": "Gotham Central", + "FirstName": "Bruce", + "LinkedinUrl": "https://www.linkedin.com/in/notyourBatman/" + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://demo-domain.gainsightcloud.com/v1.0/api/people", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/gainsight/router/data.ts b/test/integrations/destinations/gainsight/router/data.ts new file mode 100644 index 0000000000..d5873e8465 --- /dev/null +++ b/test/integrations/destinations/gainsight/router/data.ts @@ -0,0 +1,451 @@ +export const data = [ + { + name: 'gainsight', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + "message": { + "type": "identify", + "sentAt": "2021-05-28T11:22:01.842Z", + "userId": "live-test", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.18", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "path": "/Users/anurajguha/workspace/simple-html-test/index.html", + "title": "Test", + "search": "", + "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "referrer": "$direct", + "initial_referrer": "$direct", + "referring_domain": "", + "initial_referring_domain": "" + }, + "locale": "en-GB", + "screen": { + "density": 2 + }, + "traits": { + "name": "Cosmo Krammer", + "email": "cosmo@krammer.com", + "location": "New York", + "emailOptOut": true, + "linkedinUrl": "https://linkedin.com/cosmo-krammer", + "masterAvatarTypeCode": 10 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.18" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" + }, + "rudderId": "94d40f2f-5787-4798-8a03-34f3b02f5ede", + "messageId": "8274e525-d99c-4f55-b67a-bbc890d1444c", + "timestamp": "2021-05-28T16:52:01.859+05:30", + "receivedAt": "2021-05-28T16:52:01.859+05:30", + "request_ip": "[::1]", + "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-05-28T11:22:01.842Z" + }, + "metadata": { + "userId": "94d40f2f-5787-4798-8a03-34f3b02f5ede", + "jobId": 1, + "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", + "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", + "attemptNum": 0, + "receivedAt": "2021-05-28T16:52:01.859+05:30", + "createdAt": "2021-05-28T11:22:02.463Z", + "firstAttemptedAt": "", + "transformAt": "router" + }, + "destination": { + "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", + "Name": "gainsight-dev-dest", + "DestinationDefinition": { + "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", + "Name": "GAINSIGHT", + "DisplayName": "Gainsight", + "Config": { + "destConfig": { + "defaultConfig": [ + "accessKey", + "sharedSecret", + "tenantId", + "domain", + "personMap", + "companyMap", + "topicName", + "eventNameMap", + "eventVersionMap", + "contractId" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["accessKey", "sharedSecret"], + "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accessKey": "sample-access-key", + "contractId": "", + "domain": "demo-account.gainsightcloud.com", + "sharedSecret": "", + "tenantId": "", + "topicName": "" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + }, + { + "message": { + "type": "track", + "event": "Demo Request", + "sentAt": "2021-05-28T11:52:12.893Z", + "userId": "", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.18", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "path": "/Users/anurajguha/workspace/simple-html-test/index.html", + "title": "Test", + "search": "", + "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "referrer": "$direct", + "initial_referrer": "$direct", + "referring_domain": "", + "initial_referring_domain": "" + }, + "locale": "en-GB", + "screen": { + "density": 2 + }, + "traits": {}, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.18" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" + }, + "rudderId": "1a30a93f-916b-4c39-ad20-1ce7bbbd7754", + "messageId": "f5619b1a-8704-42a8-bab9-92bbeaa44896", + "timestamp": "2021-05-28T17:22:12.905+05:30", + "properties": { + "email": "sample@user.com", + "status": "active" + }, + "receivedAt": "2021-05-28T17:22:12.905+05:30", + "request_ip": "[::1]", + "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-05-28T11:52:12.893Z" + }, + "metadata": { + "userId": "1a30a93f-916b-4c39-ad20-1ce7bbbd7754", + "jobId": 2, + "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", + "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", + "attemptNum": 0, + "receivedAt": "2021-05-28T17:22:12.905+05:30", + "createdAt": "2021-05-28T11:52:15.283Z", + "firstAttemptedAt": "", + "transformAt": "router" + }, + "destination": { + "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", + "Name": "gainsight-dev-dest", + "DestinationDefinition": { + "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", + "Name": "GAINSIGHT", + "DisplayName": "Gainsight", + "Config": { + "destConfig": { + "defaultConfig": [ + "accessKey", + "sharedSecret", + "tenantId", + "domain", + "personMap", + "companyMap", + "topicName", + "eventNameMap", + "eventVersionMap", + "contractId" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["accessKey", "sharedSecret"], + "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accessKey": "sample-access-key", + "contractId": "sample-contract-id", + "domain": "demo-account.gainsightcloud.com", + "eventNameMap": [ + { + "from": "Demo Request", + "to": "Product Demo" + } + ], + "eventVersionMap": [ + { + "from": "Demo Request", + "to": "1.0.0" + } + ], + "sharedSecret": "sample-shared-secret", + "tenantId": "sample-tenant-id", + "topicName": "Support Tickets" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + } + ], + destType: 'gainsight', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://demo-account.gainsightcloud.com/v1.0/api/people", + "headers": { + "Accesskey": "sample-access-key", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "Email": "cosmo@krammer.com", + "Name": "Cosmo Krammer", + "LinkedinUrl": "https://linkedin.com/cosmo-krammer", + "Location": "New York", + "EmailOptOut": true, + "MasterAvatarTypeCode": 10 + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "userId": "94d40f2f-5787-4798-8a03-34f3b02f5ede", + "jobId": 1, + "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", + "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", + "attemptNum": 0, + "receivedAt": "2021-05-28T16:52:01.859+05:30", + "createdAt": "2021-05-28T11:22:02.463Z", + "firstAttemptedAt": "", + "transformAt": "router" + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", + "Name": "gainsight-dev-dest", + "DestinationDefinition": { + "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", + "Name": "GAINSIGHT", + "DisplayName": "Gainsight", + "Config": { + "destConfig": { + "defaultConfig": [ + "accessKey", + "sharedSecret", + "tenantId", + "domain", + "personMap", + "companyMap", + "topicName", + "eventNameMap", + "eventVersionMap", + "contractId" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["accessKey", "sharedSecret"], + "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accessKey": "sample-access-key", + "contractId": "", + "domain": "demo-account.gainsightcloud.com", + "sharedSecret": "", + "tenantId": "", + "topicName": "" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://demo-account.gainsightcloud.com/v1.0/api/eventManager/event", + "headers": { + "sharedSecret": "sample-shared-secret", + "topicName": "Support Tickets", + "tenantId": "sample-tenant-id", + "Content-Type": "application/json", + "eventName": "Product Demo", + "eventVersion": "1.0.0", + "contractId": "sample-contract-id", + "Accesskey": "sample-access-key" + }, + "params": {}, + "body": { + "JSON": { + "email": "sample@user.com", + "status": "active" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "userId": "1a30a93f-916b-4c39-ad20-1ce7bbbd7754", + "jobId": 2, + "sourceId": "1syvMwC0K62eIb4yAV9kFJtbDEA", + "destinationId": "1syvZAuiGo4l1SIsil0TxDEx34G", + "attemptNum": 0, + "receivedAt": "2021-05-28T17:22:12.905+05:30", + "createdAt": "2021-05-28T11:52:15.283Z", + "firstAttemptedAt": "", + "transformAt": "router" + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "1syvZAuiGo4l1SIsil0TxDEx34G", + "Name": "gainsight-dev-dest", + "DestinationDefinition": { + "ID": "1syuhEt4I8jpvlwJc4lr1IiLjPu", + "Name": "GAINSIGHT", + "DisplayName": "Gainsight", + "Config": { + "destConfig": { + "defaultConfig": [ + "accessKey", + "sharedSecret", + "tenantId", + "domain", + "personMap", + "companyMap", + "topicName", + "eventNameMap", + "eventVersionMap", + "contractId" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["accessKey", "sharedSecret"], + "supportedSourceTypes": ["android", "ios", "web", "unity", "amp", "cloud", "reactnative"], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accessKey": "sample-access-key", + "contractId": "sample-contract-id", + "domain": "demo-account.gainsightcloud.com", + "eventNameMap": [ + { + "from": "Demo Request", + "to": "Product Demo" + } + ], + "eventVersionMap": [ + { + "from": "Demo Request", + "to": "1.0.0" + } + ], + "sharedSecret": "sample-shared-secret", + "tenantId": "sample-tenant-id", + "topicName": "Support Tickets" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + } + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/gainsight_px/network.ts b/test/integrations/destinations/gainsight_px/network.ts new file mode 100644 index 0000000000..d9dd6bbaa0 --- /dev/null +++ b/test/integrations/destinations/gainsight_px/network.ts @@ -0,0 +1,222 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.aptrinsic.com/v1/users/sample-user-id', + method: 'GET', + }, + httpRes: { + data: { + "aptrinsicId": "347c4c87-98c7-4ca6-a6da-678ed6924c22", + "identifyId": "sample-user-id", + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "lastSeenDate": 0, + "signUpDate": 1624431528295, + "firstVisitDate": 0, + "title": "engineer", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "", + "numberOfVisits": 1, + "location": { + "countryName": "USA", + "countryCode": "US", + "stateName": "", + "stateCode": "", + "city": "New York", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0.0, + "longitude": 0.0 + } + }, + "propertyKeys": ["AP-XABC-123"], + "createDate": 1624431528295, + "lastModifiedDate": 1624431528295, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "sample-user-id", + "lastInferredLocation": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0.0, + "longitude": 0.0 + } + } + }, + status: 200 + }, + }, + { + httpReq: { + url: 'https://api.aptrinsic.com/v1/accounts/ecorp-id', + method: 'GET', + }, + httpRes: { + data: { + "id": "ecorp-id", + "name": "ECorp", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 0, + "dunsNumber": "", + "industry": "software", + "numberOfEmployees": 400, + "sicCode": "", + "website": "www.ecorp.com", + "naicsCode": "", + "plan": "premium", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0.0, + "longitude": 0.0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-XABC-123"], + "createDate": 1624261864923, + "lastModifiedDate": 1624261864923, + "customAttributes": null, + "parentGroupId": "" + }, + status: 200 + }, + }, + { + httpReq: { + url: 'https://api.aptrinsic.com/v1/accounts/ecorp-id', + method: 'PUT', + }, + httpRes: { + data: { + "id": "ecorp-id", + "name": "ECorp", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 0, + "dunsNumber": "", + "industry": "software", + "numberOfEmployees": 400, + "sicCode": "", + "website": "www.ecorp.com", + "naicsCode": "", + "plan": "premium", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0.0, + "longitude": 0.0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-XABC-123"], + "createDate": 1624261864923, + "lastModifiedDate": 1624261864923, + "customAttributes": null, + "parentGroupId": "" + }, + status: 204 + }, + }, + { + httpReq: { + url: 'https://api.aptrinsic.com/v1/users/absent-id', + method: 'GET', + }, + httpRes: { + data: { + externalapierror: { + status: "NOT_FOUND", + message: "User was not found for parameters {id=absent-id}", + debugMessage: null, + subErrors: null + } + }, + status: 404 + }, + }, + { + httpReq: { + url: 'https://api.aptrinsic.com/v1/users/stanley-kubrick', + method: 'GET', + }, + httpRes: { + data: { + "id": "ecorp-id", + "name": "ECorp", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 0, + "dunsNumber": "", + "industry": "software", + "numberOfEmployees": 400, + "sicCode": "", + "website": "www.ecorp.com", + "naicsCode": "", + "plan": "premium", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0.0, + "longitude": 0.0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-XABC-123"], + "createDate": 1624261864923, + "lastModifiedDate": 1624261864923, + "customAttributes": null, + "parentGroupId": "" + }, + status: 200 + }, + } +]; diff --git a/test/integrations/destinations/gainsight_px/processor/data.ts b/test/integrations/destinations/gainsight_px/processor/data.ts new file mode 100644 index 0000000000..192c6969c4 --- /dev/null +++ b/test/integrations/destinations/gainsight_px/processor/data.ts @@ -0,0 +1,1857 @@ +export const data = [ + { + "name": "gainsight_px", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [ + { + "from": "projectId", + "to": "p-123" + }, + { + "from": "tag", + "to": "sample-category-tag" + } + ] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "userId": "sample-user-id", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "type": "track", + "event": "Product Added", + "properties": { + "product_id": "123", + "sku": "F16", + "category": "Games", + "name": "Game", + "brand": "Gamepro", + "variant": "111", + "price": 13.49, + "quantity": 11, + "coupon": "DISC21", + "position": 1, + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.png" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "attributes": { + "product_id": "123", + "sku": "F16", + "category": "Games", + "name": "Game", + "brand": "Gamepro", + "variant": "111", + "price": 13.49, + "quantity": 11, + "coupon": "DISC21", + "position": 1, + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.png" + }, + "propertyKey": "AP-XABC-123", + "userType": "USER", + "identifyId": "sample-user-id", + "date": 1571043797562, + "eventName": "Product Added", + "globalContext": { + "projectId": "p-123", + "tag": "sample-category-tag" + } + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/events/custom", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [ + { + "from": "projectId", + "to": "p-123" + }, + { + "from": "tag", + "to": "sample-category-tag" + } + ] + } + }, + "message": { + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "version": "1.27.0", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:8887/", + "path": "/", + "title": "RudderStack in 5", + "search": "", + "tab_url": "http://127.0.0.1:8887/", + "referrer": "$direct", + "initial_referrer": "$direct", + "referring_domain": "", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1512, + "height": 982, + "density": 2, + "innerWidth": 774, + "innerHeight": 774 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.27.0" + }, + "campaign": {}, + "sessionId": 1679967592314, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36", + "properties": { + "email": "84@84.com", + "price": "56.0", + "quantity": "5" + } + }, + "userId": "sample-user-id", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "type": "track", + "event": "Marketing - Plan Change Events", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "attributes": {}, + "url": "http://127.0.0.1:8887/", + "propertyKey": "AP-XABC-123", + "userType": "USER", + "identifyId": "sample-user-id", + "referrer": "$direct", + "date": 1571043797562, + "sessionId": 1679967592314, + "eventName": "Marketing - Plan Change Events", + "globalContext": { + "projectId": "p-123", + "tag": "sample-category-tag" + } + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/events/custom", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [ + { + "from": "projectId", + "to": "p-123" + }, + { + "from": "tag", + "to": "sample-category-tag" + } + ] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "userId": "sample-user-id", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "type": "track", + "event": "Track Me", + "properties": { + "description": "Sample Track call", + "globalContext": { + "testOverride": "some-value" + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "attributes": { + "description": "Sample Track call" + }, + "propertyKey": "AP-XABC-123", + "userType": "USER", + "identifyId": "sample-user-id", + "date": 1571043797562, + "eventName": "Track Me", + "globalContext": { + "testOverride": "some-value" + } + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/events/custom", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "userId": "sample-user-id", + "anonymousId": "sample-anon-id", + "type": "identify", + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "title": "engineer", + "countryName": "USA", + "countryCode": "US", + "city": "New York", + "hobbyCustomField": "Sample Hobby" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "createDate": 1571043797562, + "title": "engineer", + "propertyKeys": [ + "AP-XABC-123" + ], + "location": { + "countryName": "USA", + "countryCode": "US", + "city": "New York" + }, + "customAttributes": { + "hobby": "Sample Hobby" + } + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "medium": null + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "userId": "sample-user-id", + "groupId": "ecorp-id", + "type": "group", + "traits": { + "name": "ECorp", + "industry": "software", + "numberOfEmployees": 400, + "website": "www.ecorp.com", + "plan": "premium" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "accountId": "ecorp-id" + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "type": "identify", + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "title": "engineer", + "countryName": "USA", + "countryCode": "US", + "city": "New York", + "hobbyCustomField": "Sample Hobby" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "userId or anonymousId is required for identify", + "statTags": { + "destType": "GAINSIGHT_PX", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [ + { + "from": "projectId", + "to": "p-123" + }, + { + "from": "tag", + "to": "sample-category-tag" + } + ] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "type": "track", + "event": "Product Added", + "properties": { + "product_id": "123", + "sku": "F16", + "category": "Games", + "name": "Game", + "brand": "Gamepro", + "variant": "111", + "price": 13.49, + "quantity": 11, + "coupon": "DISC21", + "position": 1, + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.png" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Missing required value from \"userId\"", + "statTags": { + "destType": "GAINSIGHT_PX", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User" + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "userId": "sample-user-id", + "type": "group", + "traits": { + "name": "ECorp", + "industry": "software", + "numberOfEmployees": 400, + "website": "www.ecorp.com", + "plan": "premium" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "groupId is required for group", + "statTags": { + "destType": "GAINSIGHT_PX", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [ + { + "from": "projectId", + "to": "p-123" + }, + { + "from": "tag", + "to": "sample-category-tag" + } + ] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "userId": "sample-user-id", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "type": "track", + "event": "Stringify Test", + "properties": { + "description": "Stringify test for object values", + "nested": { + "a": [ + 1, + 2, + 3 + ], + "b": { + "c": 1 + } + }, + "arr": [ + 1, + 2, + 3 + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "attributes": { + "description": "Stringify test for object values", + "nested": "{\"a\":[1,2,3],\"b\":{\"c\":1}}", + "arr": "[1,2,3]" + }, + "propertyKey": "AP-XABC-123", + "userType": "USER", + "identifyId": "sample-user-id", + "date": 1571043797562, + "eventName": "Stringify Test", + "globalContext": { + "projectId": "p-123", + "tag": "sample-category-tag" + } + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/events/custom", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [ + { + "from": "projectId", + "to": "p-123" + }, + { + "from": "tag", + "to": "sample-category-tag" + } + ] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "userId": "sample-user-id", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "type": "track", + "event": "Stringify Test", + "properties": { + "description": "Stringify test for object values", + "nested": { + "a": [ + 1, + 2, + 3 + ], + "b": { + "c": 1 + } + }, + "arr": [ + 1, + 2, + 3 + ], + "globalContext": { + "someKey": "someVal" + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "attributes": { + "description": "Stringify test for object values", + "nested": "{\"a\":[1,2,3],\"b\":{\"c\":1}}", + "arr": "[1,2,3]" + }, + "propertyKey": "AP-XABC-123", + "userType": "USER", + "identifyId": "sample-user-id", + "date": 1571043797562, + "eventName": "Stringify Test", + "globalContext": { + "someKey": "someVal" + } + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/events/custom", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User" + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "userId": "absent-id", + "groupId": "ecorp-id", + "type": "group", + "traits": { + "name": "ECorp", + "industry": "software", + "numberOfEmployees": 400, + "website": "www.ecorp.com", + "plan": "premium" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "aborting group call: {\"status\":\"NOT_FOUND\",\"message\":\"User was not found for parameters {id=absent-id}\",\"debugMessage\":null,\"subErrors\":null}", + "statTags": { + "destType": "GAINSIGHT_PX", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "userId": "absent-id", + "anonymousId": "sample-anon-id", + "type": "identify", + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "title": "engineer", + "countryName": "USA", + "countryCode": "US", + "city": "New York", + "hobbyCustomField": "Sample Hobby" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "identifyId": "absent-id", + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "createDate": 1571043797562, + "title": "engineer", + "propertyKeys": [ + "AP-XABC-123" + ], + "location": { + "countryName": "USA", + "countryCode": "US", + "city": "New York" + }, + "customAttributes": { + "hobby": "Sample Hobby" + } + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/users", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 12", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "userId": "absent-id", + "anonymousId": "sample-anon-id", + "type": "identify", + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "title": "engineer", + "countryName": "USA", + "countryCode": "US", + "city": "New York", + "hobbyCustomField": "Sample Hobby", + "accountId": 1234 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "identifyId": "absent-id", + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "createDate": 1571043797562, + "title": "engineer", + "propertyKeys": [ + "AP-XABC-123" + ], + "accountId": "1234", + "location": { + "countryName": "USA", + "countryCode": "US", + "city": "New York" + }, + "customAttributes": {} + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/users", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 13", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User" + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "sample-anon-id", + "userId": "absent-id", + "groupId": "ecorp-id", + "type": "group", + "traits": { + "name": "ECorp", + "industry": "software", + "numberOfEmployees": 400, + "website": "www.ecorp.com", + "plan": "premium", + "term": null + }, + "integrations": { + "All": true, + "GAINSIGHT_PX": { + "limitAPIForGroup": true + } + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.aptrinsic.com/v1/users/absent-id", + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "accountId": "ecorp-id" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "gainsight_px", + "description": "Test 14", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "sample-api-key", + "productTagKey": "AP-XABC-123", + "accountAttributeMap": [ + { + "from": "", + "to": "" + } + ], + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ], + "globalContextMap": [] + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "userId": "sample-user-id", + "anonymousId": "sample-anon-id", + "type": "identify", + "traits": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "title": "engineer", + "countryName": "USA", + "countryCode": "US", + "city": "New York", + "hobbyCustomField": "Sample Hobby", + "term": null, + "campaign": "" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "type": "USER", + "gender": "MALE", + "email": "user@email.com", + "firstName": "Sample", + "lastName": "User", + "signUpDate": 1624431528295, + "createDate": 1571043797562, + "title": "engineer", + "propertyKeys": [ + "AP-XABC-123" + ], + "location": { + "countryName": "USA", + "countryCode": "US", + "city": "New York" + }, + "customAttributes": { + "hobby": "Sample Hobby" + } + } + }, + "type": "REST", + "files": {}, + "method": "PUT", + "params": {}, + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/gainsight_px/router/data.ts b/test/integrations/destinations/gainsight_px/router/data.ts new file mode 100644 index 0000000000..4017a3ddb7 --- /dev/null +++ b/test/integrations/destinations/gainsight_px/router/data.ts @@ -0,0 +1,558 @@ +export const data = [ + { + name: 'gainsight_px', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + "message": { + "type": "identify", + "sentAt": "2021-06-25T08:59:52.891Z", + "userId": "stanley-kubrick", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.18", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "title": "Test", + "search": "", + "path": "index.html", + "url": "http://127.0.0.1:3003/index.html", + "tab_url": "http://127.0.0.1:3003/index.html", + "referrer": "$direct", + "initial_referrer": "$direct", + "referring_domain": "", + "initial_referring_domain": "" + }, + "locale": "en-GB", + "screen": { + "width": 1920, + "height": 1080, + "density": 1, + "innerWidth": 1920, + "innerHeight": 436 + }, + "traits": { + "name": "Stanley Kubrick", + "email": "stanley@kubrick.com", + "score": 100, + "title": "Director/Film Maker", + "gender": "Male", + "countryCode": "US", + "countryName": "USA", + "hobbyCustomField": "Making films. Being a genius" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.18" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" + }, + "rudderId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", + "messageId": "ff90d62e-a6e3-4e23-af20-03b4a249ef48", + "timestamp": "2021-06-25T14:29:52.911+05:30", + "receivedAt": "2021-06-25T14:29:52.911+05:30", + "request_ip": "[::1]", + "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-06-25T08:59:52.891Z" + }, + "metadata": { + "userId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", + "jobId": 1, + "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", + "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "attemptNum": 0, + "receivedAt": "2021-06-25T14:29:52.911+05:30", + "createdAt": "2021-06-25T08:59:56.329Z", + "firstAttemptedAt": "", + "transformAt": "router" + }, + "destination": { + "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "Name": "gainsight-px-dest", + "DestinationDefinition": { + "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", + "Name": "GAINSIGHT_PX", + "DisplayName": "Gainsight PX", + "Config": { + "destConfig": { + "defaultConfig": [ + "apiKey", + "productTagKey", + "userAttributeMap", + "accountAttributeMap", + "globalContextMap" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["apiKey", "productTagKey"], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "reactnative", + "flutter" + ], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accountAttributeMap": [ + { + "from": "cultureCustomField", + "to": "culture" + } + ], + "apiKey": "sample-api-key", + "eventDelivery": false, + "eventDeliveryTS": 1624472902670, + "globalContextMap": [ + { + "from": "kubrickTest", + "to": "value" + } + ], + "productTagKey": "AP-SAMPLE-2", + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + }, + { + "message": { + "type": "track", + "event": "nested test2", + "sentAt": "2021-06-26T10:41:22.316Z", + "userId": "adifhas9734", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.18", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "path": "/Users/anurajguha/workspace/simple-html-test/index.html", + "title": "Test", + "search": "", + "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "referrer": "$direct", + "initial_referrer": "$direct", + "referring_domain": "", + "initial_referring_domain": "" + }, + "locale": "en-GB", + "screen": { + "width": 1920, + "height": 1080, + "density": 1, + "innerWidth": 1920, + "innerHeight": 585 + }, + "traits": { + "name": "Update test unique", + "phone": "9900990899", + "lastname": "user6", + "firstname": "test", + "previousCompany": "testprevCompany2" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.18" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" + }, + "rudderId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", + "messageId": "595dae36-5e4f-4feb-a2e4-8a7849615d38", + "timestamp": "2021-06-26T16:11:22.335+05:30", + "properties": { + "array": [1, 2, 3], + "nested": { + "json": "test" + }, + "status": "testing", + "description": "Example track call", + "fullyNested": [ + { + "a": 1, + "b": 2 + }, + { + "a": 1, + "b": [1, 2, 3] + } + ] + }, + "receivedAt": "2021-06-26T16:11:22.335+05:30", + "request_ip": "[::1]", + "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-06-26T10:41:22.316Z" + }, + "metadata": { + "userId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", + "jobId": 2, + "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", + "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "attemptNum": 0, + "receivedAt": "2021-06-26T16:11:22.335+05:30", + "createdAt": "2021-06-26T10:41:24.126Z", + "firstAttemptedAt": "", + "transformAt": "router" + }, + "destination": { + "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "Name": "gainsight-px-dest", + "DestinationDefinition": { + "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", + "Name": "GAINSIGHT_PX", + "DisplayName": "Gainsight PX", + "Config": { + "destConfig": { + "defaultConfig": [ + "apiKey", + "productTagKey", + "userAttributeMap", + "accountAttributeMap", + "globalContextMap" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["apiKey", "productTagKey"], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "reactnative", + "flutter" + ], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accountAttributeMap": [ + { + "from": "cultureCustomField", + "to": "culture" + } + ], + "apiKey": "sample-api-key", + "eventDelivery": false, + "eventDeliveryTS": 1624472902670, + "globalContextMap": [ + { + "from": "kubrickTest", + "to": "value" + } + ], + "productTagKey": "AP-SAMPLE-2", + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + } + ] + , + destType: 'gainsight_px', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.aptrinsic.com/v1/users/stanley-kubrick", + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "email": "stanley@kubrick.com", + "gender": "MALE", + "signUpDate": 1624611592911, + "title": "Director/Film Maker", + "score": 100, + "createDate": 1624611592911, + "location": { + "countryName": "USA", + "countryCode": "US" + }, + "firstName": "Stanley", + "lastName": "Kubrick", + "customAttributes": { + "hobby": "Making films. Being a genius" + }, + "propertyKeys": ["AP-SAMPLE-2"], + "type": "USER" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "userId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", + "jobId": 1, + "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", + "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "attemptNum": 0, + "receivedAt": "2021-06-25T14:29:52.911+05:30", + "createdAt": "2021-06-25T08:59:56.329Z", + "firstAttemptedAt": "", + "transformAt": "router" + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "Name": "gainsight-px-dest", + "DestinationDefinition": { + "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", + "Name": "GAINSIGHT_PX", + "DisplayName": "Gainsight PX", + "Config": { + "destConfig": { + "defaultConfig": [ + "apiKey", + "productTagKey", + "userAttributeMap", + "accountAttributeMap", + "globalContextMap" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["apiKey", "productTagKey"], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "reactnative", + "flutter" + ], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accountAttributeMap": [ + { + "from": "cultureCustomField", + "to": "culture" + } + ], + "apiKey": "sample-api-key", + "eventDelivery": false, + "eventDeliveryTS": 1624472902670, + "globalContextMap": [ + { + "from": "kubrickTest", + "to": "value" + } + ], + "productTagKey": "AP-SAMPLE-2", + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.aptrinsic.com/v1/events/custom", + "headers": { + "X-APTRINSIC-API-KEY": "sample-api-key", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "identifyId": "adifhas9734", + "eventName": "nested test2", + "date": 1624704082335, + "attributes": { + "array": "[1,2,3]", + "nested": "{\"json\":\"test\"}", + "status": "testing", + "description": "Example track call", + "fullyNested": "[{\"a\":1,\"b\":2},{\"a\":1,\"b\":[1,2,3]}]" + }, + "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", + "referrer": "$direct", + "propertyKey": "AP-SAMPLE-2", + "userType": "USER", + "globalContext": { + "kubrickTest": "value" + } + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "userId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", + "jobId": 2, + "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", + "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "attemptNum": 0, + "receivedAt": "2021-06-26T16:11:22.335+05:30", + "createdAt": "2021-06-26T10:41:24.126Z", + "firstAttemptedAt": "", + "transformAt": "router" + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", + "Name": "gainsight-px-dest", + "DestinationDefinition": { + "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", + "Name": "GAINSIGHT_PX", + "DisplayName": "Gainsight PX", + "Config": { + "destConfig": { + "defaultConfig": [ + "apiKey", + "productTagKey", + "userAttributeMap", + "accountAttributeMap", + "globalContextMap" + ] + }, + "excludeKeys": [], + "includeKeys": [], + "saveDestinationResponse": true, + "secretKeys": ["apiKey", "productTagKey"], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "reactnative", + "flutter" + ], + "transformAt": "router", + "transformAtV1": "router" + }, + "ResponseRules": {} + }, + "Config": { + "accountAttributeMap": [ + { + "from": "cultureCustomField", + "to": "culture" + } + ], + "apiKey": "sample-api-key", + "eventDelivery": false, + "eventDeliveryTS": 1624472902670, + "globalContextMap": [ + { + "from": "kubrickTest", + "to": "value" + } + ], + "productTagKey": "AP-SAMPLE-2", + "userAttributeMap": [ + { + "from": "hobbyCustomField", + "to": "hobby" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + } + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts index a956d358f0..74c514d082 100644 --- a/test/integrations/destinations/intercom/router/data.ts +++ b/test/integrations/destinations/intercom/router/data.ts @@ -1,272 +1,272 @@ export const data = [ - { - name: 'intercom', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "message": { - "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "channel": "mobile", - "context": { - "app": { - "build": "1.0", - "name": "Test_Example", - "namespace": "com.example.testapp", - "version": "1.0" - }, - "device": { - "id": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPod touch (7th generation)", - "type": "iOS" - }, - "library": { - "name": "test-ios-library", - "version": "1.0.7" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "14.0" - }, - "screen": { - "density": 2, - "height": 320, - "width": 568 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "name": "Test Name", - "firstName": "Test", - "lastName": "Name", - "createdAt": "2020-09-30T19:11:00.337Z", - "userId": "test_user_id_1", - "email": "test_1@test.com", - "phone": "9876543210", - "key1": "value1" - }, - "userAgent": "unknown" - }, - "event": "Test Event 2", - "integrations": { - "All": true - }, - "messageId": "1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8", - "originalTimestamp": "2020-09-30T19:11:00.337Z", - "receivedAt": "2020-10-01T00:41:11.369+05:30", - "request_ip": "2405:201:8005:9856:7911:25e7:5603:5e18", - "sentAt": "2020-09-30T19:11:10.382Z", - "timestamp": "2020-10-01T00:41:01.324+05:30", - "type": "identify" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "intercomApiKey", - "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0", - "collectContext": false - } - } - }, - { - "message": { - "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "channel": "mobile", - "context": { - "app": { - "build": "1.0", - "name": "Test_Example", - "namespace": "com.example.testapp", - "version": "1.0" - }, - "device": { - "id": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPod touch (7th generation)", - "type": "iOS" - }, - "library": { - "name": "test-ios-library", - "version": "1.0.7" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "14.0" - }, - "screen": { - "density": 2, - "height": 320, - "width": 568 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "firstName": "Test", - "lastName": "Name", - "createdAt": "2020-09-30T19:11:00.337Z", - "email": "test_1@test.com", - "phone": "9876543210", - "key1": "value1" - }, - "userAgent": "unknown" - }, - "event": "Test Event 2", - "integrations": { - "All": true - }, - "messageId": "1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8", - "originalTimestamp": "2020-09-30T19:11:00.337Z", - "receivedAt": "2020-10-01T00:41:11.369+05:30", - "request_ip": "2405:201:8005:9856:7911:25e7:5603:5e18", - "sentAt": "2020-09-30T19:11:10.382Z", - "timestamp": "2020-10-01T00:41:01.324+05:30", - "type": "identify" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "intercomApiKey", - "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0", - "collectContext": false - } - } - } - ], - destType: 'intercom', + { + name: 'intercom', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + channel: 'mobile', + context: { + app: { + build: '1.0', + name: 'Test_Example', + namespace: 'com.example.testapp', + version: '1.0', + }, + device: { + id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPod touch (7th generation)', + type: 'iOS', + }, + library: { + name: 'test-ios-library', + version: '1.0.7', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '14.0', + }, + screen: { + density: 2, + height: 320, + width: 568, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + name: 'Test Name', + firstName: 'Test', + lastName: 'Name', + createdAt: '2020-09-30T19:11:00.337Z', + userId: 'test_user_id_1', + email: 'test_1@test.com', + phone: '9876543210', + key1: 'value1', + }, + userAgent: 'unknown', + }, + event: 'Test Event 2', + integrations: { + All: true, + }, + messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8', + originalTimestamp: '2020-09-30T19:11:00.337Z', + receivedAt: '2020-10-01T00:41:11.369+05:30', + request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18', + sentAt: '2020-09-30T19:11:10.382Z', + timestamp: '2020-10-01T00:41:01.324+05:30', + type: 'identify', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'intercomApiKey', + appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', + collectContext: false, }, + }, }, + { + message: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + channel: 'mobile', + context: { + app: { + build: '1.0', + name: 'Test_Example', + namespace: 'com.example.testapp', + version: '1.0', + }, + device: { + id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPod touch (7th generation)', + type: 'iOS', + }, + library: { + name: 'test-ios-library', + version: '1.0.7', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '14.0', + }, + screen: { + density: 2, + height: 320, + width: 568, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + firstName: 'Test', + lastName: 'Name', + createdAt: '2020-09-30T19:11:00.337Z', + email: 'test_1@test.com', + phone: '9876543210', + key1: 'value1', + }, + userAgent: 'unknown', + }, + event: 'Test Event 2', + integrations: { + All: true, + }, + messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8', + originalTimestamp: '2020-09-30T19:11:00.337Z', + receivedAt: '2020-10-01T00:41:11.369+05:30', + request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18', + sentAt: '2020-09-30T19:11:10.382Z', + timestamp: '2020-10-01T00:41:01.324+05:30', + type: 'identify', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'intercomApiKey', + appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', + collectContext: false, + }, + }, + }, + ], + destType: 'intercom', }, - output: { - response: { - status: 200, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.intercom.io/users', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer intercomApiKey', + Accept: 'application/json', + 'Intercom-Version': '1.4', + }, + params: {}, body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.intercom.io/users", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer intercomApiKey", - "Accept": "application/json", - "Intercom-Version": "1.4" - }, - "params": {}, - "body": { - "JSON": { - "email": "test_1@test.com", - "phone": "9876543210", - "name": "Test Name", - "signed_up_at": 1601493060, - "last_seen_user_agent": "unknown", - "update_last_request_at": true, - "user_id": "test_user_id_1", - "custom_attributes": { - "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "key1": "value1" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33" - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "intercomApiKey", - "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0", - "collectContext": false - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.intercom.io/users", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer intercomApiKey", - "Accept": "application/json", - "Intercom-Version": "1.4" - }, - "params": {}, - "body": { - "JSON": { - "email": "test_1@test.com", - "phone": "9876543210", - "signed_up_at": 1601493060, - "name": "Test Name", - "last_seen_user_agent": "unknown", - "update_last_request_at": true, - "custom_attributes": { - "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", - "key1": "value1" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "intercomApiKey", - "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0", - "collectContext": false - } - } - } - ], + JSON: { + email: 'test_1@test.com', + phone: '9876543210', + name: 'Test Name', + signed_up_at: 1601493060, + last_seen_user_agent: 'unknown', + update_last_request_at: true, + user_id: 'test_user_id_1', + custom_attributes: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + key1: 'value1', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'intercomApiKey', + appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', + collectContext: false, + }, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.intercom.io/users', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer intercomApiKey', + Accept: 'application/json', + 'Intercom-Version': '1.4', + }, + params: {}, + body: { + JSON: { + email: 'test_1@test.com', + phone: '9876543210', + signed_up_at: 1601493060, + name: 'Test Name', + last_seen_user_agent: 'unknown', + update_last_request_at: true, + custom_attributes: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + key1: 'value1', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'intercomApiKey', + appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', + collectContext: false, }, + }, }, + ], }, + }, }, + }, ]; diff --git a/test/integrations/destinations/klaviyo/network.ts b/test/integrations/destinations/klaviyo/network.ts new file mode 100644 index 0000000000..aa788a60da --- /dev/null +++ b/test/integrations/destinations/klaviyo/network.ts @@ -0,0 +1,75 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://a.klaviyo.com/api/v2/list/XUepkK/subscribe', + method: 'GET', + }, + httpRes: { + status: 200 + }, + }, + { + httpReq: { + url: 'https://a.klaviyo.com/api/v2/list/XUepkK/members', + method: 'GET', + }, + httpRes: { + status: 200 + }, + }, + { + httpReq: { + url: 'https://a.klaviyo.com/api/profiles', + method: 'GET', + data: { + attributes: { + email: "test3@rudderstack.com" + } + } + }, + httpRes: { + status: 409, + data: { + } + }, + }, + { + httpReq: { + url: 'https://a.klaviyo.com/api/profiles', + method: 'GET', + }, + httpRes: { + status: 201, + data: { + data: { + id: '01GW3PHVY0MTCDGS0A1612HARX', + attributes: {} + }, + } + }, + }, + { + httpReq: { + url: 'https://a.klaviyo.com/api/profiles', + method: 'POST', + headers: { Authorization: 'Klaviyo-API-Key dummyPrivateApiKeyforfailure' } + }, + httpRes: { + }, + }, + { + httpReq: { + url: 'https://a.klaviyo.com/api/profiles', + method: 'POST', + }, + httpRes: { + status: 201, + data: { + data: { + id: '01GW3PHVY0MTCDGS0A1612HARX', + attributes: {} + }, + } + }, + } +]; diff --git a/test/integrations/destinations/klaviyo/processor/data.ts b/test/integrations/destinations/klaviyo/processor/data.ts new file mode 100644 index 0000000000..2025957716 --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/data.ts @@ -0,0 +1,2430 @@ +export const data = [ + { + "name": "klaviyo", + "description": "Profile updating call and subscribe user (old transformer)", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "email": "test@rudderstack.com", + "phone": "+12 345 578 900", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "Flagged": false, + "Residence": "Shibuya", + "properties": { + "listId": "XUepkK", + "subscribe": true, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": + { + "version": "1", + "type": "REST", + "userId": "", + "method": "PATCH", + "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile", + "attributes": { + "external_id": "user@1", + "email": "test@rudderstack.com", + "first_name": "Test", + "last_name": "Rudderlabs", + "phone_number": "+12 345 578 900", + "title": "Developer", + "organization": "Rudder", + "location": { + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001" + }, + "properties": { + "Flagged": false, + "Residence": "Shibuya" + } + }, + "id": "01GW3PHVY0MTCDGS0A1612HARX" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + }, { + "output": + { + "version": "1", + "type": "REST", + "method": "POST", + "userId": "", + "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", + "headers": { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile-subscription-bulk-create-job", + "attributes": { + "list_id": "XUepkK", + "subscriptions": [ + { + "email": "test@rudderstack.com", + "phone_number": "+12 345 578 900", + "channels": { + "email": [ + "MARKETING" + ], + "sms": [ + "MARKETING" + ] + } + } + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Identify call for with flattenProperties enabled (old transformer)", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "flattenProperties": true + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "email": "test@rudderstack.com", + "phone": "+12 345 578 900", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "Flagged": false, + "Residence": "Shibuya", + "friend": { + "names": { + "first": "Alice", + "last": "Smith" + }, + "age": 25 + }, + "properties": { + "listId": "XUepkK", + "subscribe": true, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": + { + "version": "1", + "type": "REST", + "userId": "", + "method": "PATCH", + "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile", + "attributes": { + "external_id": "user@1", + "email": "test@rudderstack.com", + "first_name": "Test", + "last_name": "Rudderlabs", + "phone_number": "+12 345 578 900", + "title": "Developer", + "organization": "Rudder", + "location": { + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001" + }, + "properties": { + "friend.age": 25, + "friend.names.first": "Alice", + "friend.names.last": "Smith", + "Flagged": false, + "Residence": "Shibuya" + } + }, + "id": "01GW3PHVY0MTCDGS0A1612HARX" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", + "headers": { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile-subscription-bulk-create-job", + "attributes": { + "list_id": "XUepkK", + "subscriptions": [ + { + "email": "test@rudderstack.com", + "phone_number": "+12 345 578 900", + "channels": { + "email": [ + "MARKETING" + ], + "sms": [ + "MARKETING" + ] + } + } + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Profile updation call and subcribe user", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKeyforfailure" + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "email": "test3@rudderstack.com", + "phone": "+12 345 578 900", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "Flagged": false, + "Residence": "Shibuya", + "properties": { + "listId": "XUepkK", + "subscribe": true, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "{\"message\":\"Failed to create user due to \\\"\\\"\",\"destinationResponse\":\"\\\"\\\"\"}", + "statTags": { + "destType": "KLAVIYO", + "errorCategory": "network", + "errorType": "retryable", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 500 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Profile updation call listId is not provided for subscribing the user", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "email": "test@rudderstack.com", + "phone": "+12 345 578 900", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "Flagged": false, + "Residence": "Shibuya", + "properties": { + "subscribe": false, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile", + "attributes": { + "external_id": "user@1", + "email": "test@rudderstack.com", + "first_name": "Test", + "last_name": "Rudderlabs", + "phone_number": "+12 345 578 900", + "title": "Developer", + "organization": "Rudder", + "location": { + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001" + }, + "properties": { + "Flagged": false, + "Residence": "Shibuya" + } + }, + "id": "01GW3PHVY0MTCDGS0A1612HARX" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Identify call with enforceEmailAsPrimary enabled from UI", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "enforceEmailAsPrimary": true + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "email": "test@rudderstack.com", + "phone": "+12 345 578 900", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "Flagged": false, + "Residence": "Shibuya", + "properties": { + "listId": "XUepkK", + "subscribe": true, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": + { + "version": "1", + "type": "REST", + "userId": "", + "method": "PATCH", + "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile", + "attributes": { + "email": "test@rudderstack.com", + "first_name": "Test", + "last_name": "Rudderlabs", + "phone_number": "+12 345 578 900", + "title": "Developer", + "organization": "Rudder", + "location": { + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001" + }, + "properties": { + "Flagged": false, + "Residence": "Shibuya", + "_id": "user@1" + } + }, + "id": "01GW3PHVY0MTCDGS0A1612HARX" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", + "headers": { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile-subscription-bulk-create-job", + "attributes": { + "list_id": "XUepkK", + "subscriptions": [ + { + "email": "test@rudderstack.com", + "phone_number": "+12 345 578 900", + "channels": { + "email": [ + "MARKETING" + ], + "sms": [ + "MARKETING" + ] + } + } + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Identify call without user custom Properties", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "enforceEmailAsPrimary": false + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "email": "test@rudderstack.com", + "phone": "+12 345 578 900", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "properties": { + "listId": "XUepkK", + "subscribe": true, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "PATCH", + "endpoint": "https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile", + "attributes": { + "email": "test@rudderstack.com", + "first_name": "Test", + "last_name": "Rudderlabs", + "phone_number": "+12 345 578 900", + "external_id": "user@1", + "title": "Developer", + "organization": "Rudder", + "location": { + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001" + } + }, + "id": "01GW3PHVY0MTCDGS0A1612HARX" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", + "headers": { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "profile-subscription-bulk-create-job", + "attributes": { + "list_id": "XUepkK", + "subscriptions": [ + { + "email": "test@rudderstack.com", + "phone_number": "+12 345 578 900", + "channels": { + "email": [ + "MARKETING" + ], + "sms": [ + "MARKETING" + ] + } + } + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Identify call without email and phone & enforceEmailAsPrimary enabled from UI", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "enforceEmailAsPrimary": true + } + }, + "message": { + "type": "identify", + "sentAt": "2021-01-03T17:02:53.195Z", + "userId": "user@1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.11", + "namespace": "com.rudderlabs.javascript" + }, + "traits": { + "firstName": "Test", + "lastName": "Rudderlabs", + "userId": "user@1", + "title": "Developer", + "organization": "Rudder", + "city": "Tokyo", + "region": "Kanto", + "country": "JP", + "zip": "100-0001", + "Flagged": false, + "Residence": "Shibuya", + "properties": { + "listId": "XUepkK", + "subscribe": true, + "consent": [ + "email", + "sms" + ] + } + }, + "locale": "en-US", + "screen": { + "density": 2 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.11" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" + }, + "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", + "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", + "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-03T17:02:53.193Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "None of email and phone are present in the payload", + "statTags": { + "destType": "KLAVIYO", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Screen event call", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "type": "screen", + "event": "TestEven001", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ] + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "TestEven001" + }, + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ] + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "$id": "sajal12", + "age": "22" + } + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track event call with flatten properties enabled", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "flattenProperties": true + } + }, + "message": { + "type": "track", + "event": "TestEven001", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68", + "plan_details": { + "plan_type": "gold", + "duration": "3 months" + } + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "vicePresdentInfo": { + "PreviouslVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "AaronBurr", + "GeorgeClinton" + ] + } + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "TestEven001" + }, + "properties": { + "vicePresdentInfo.PreviouslVicePresident": true, + "vicePresdentInfo.VicePresidents": [ + "AaronBurr", + "GeorgeClinton" + ], + "vicePresdentInfo.YearElected": 1801 + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "$id": "sajal12", + "age": "22", + "plan_details.plan_type": "gold", + "plan_details.duration": "3 months" + } + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track event call", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "type": "track", + "event": "TestEven002", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "name": "Test", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68", + "description": "Sample description" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ], + "revenue": 3000 + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "TestEven002" + }, + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ] + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "$id": "sajal12", + "age": "22", + "name": "Test", + "description": "Sample description" + }, + "value": 3000 + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track event call, with make email or phone as primary identifier toggle on", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "enforceEmailAsPrimary": true + } + }, + "message": { + "type": "track", + "event": "TestEven001", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ] + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Accept": "application/json", + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "TestEven001" + }, + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ] + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "age": "22", + "_id": "sajal12" + } + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track event call, without email and phone & with (make email or phone as primary identifier) toggle on", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "enforceEmailAsPrimary": true + } + }, + "message": { + "type": "track", + "event": "TestEven001", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "anonymousId": "9c6bd77ea9da3e68" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "PreviouslyVicePresident": true, + "YearElected": 1801, + "VicePresidents": [ + "Aaron Burr", + "George Clinton" + ] + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "None of email and phone are present in the payload", + "statTags": { + "destType": "KLAVIYO", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "group call", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "userId": "user123", + "type": "group", + "groupId": "XUepkK", + "traits": { + "subscribe": true + }, + "context": { + "traits": { + "email": "test@rudderstack.com", + "phone": "+12 345 678 900", + "consent": [ + "email" + ] + }, + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-01-21T00:21:34.208Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { "output": { "body": { "FORM": {}, "JSON": { "data": { "attributes": { "list_id": "XUepkK", "subscriptions": [{ "email": "test@rudderstack.com", "phone_number": "+12 345 678 900" }] }, "type": "profile-subscription-bulk-create-job" } }, "JSON_ARRAY": {}, "XML": {} }, "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs", "files": {}, "headers": { "Accept": "application/json", "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", "Content-Type": "application/json", "revision": "2023-02-22" }, "method": "POST", "params": {}, "type": "REST", "userId": "", "version": "1" }, "statusCode": 200 } + ] + } + } + }, + { + "name": "klaviyo", + "description": "group call without groupId", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "userId": "user123", + "type": "group", + "groupId": "", + "traits": { + "subscribe": true + }, + "context": { + "traits": { + "email": "test@rudderstack.com", + "phone": "+12 345 678 900", + "consent": "email" + }, + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-01-21T00:21:34.208Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "groupId is a required field for group events", + "statTags": { + "destType": "KLAVIYO", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "[Error]: Check for unsupported message type", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "userId": "user123", + "type": "random", + "groupId": "XUepkK", + "traits": { + "subscribe": true + }, + "context": { + "traits": { + "email": "test@rudderstack.com", + "phone": "+12 345 678 900", + "consent": "email" + }, + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-01-21T00:21:34.208Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Event type random is not supported", + "statTags": { + "destType": "KLAVIYO", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track call with Ecom events (Viewed Product)", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "type": "track", + "event": "product viewed", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "name": "Test", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68", + "description": "Sample description" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "name": "test product", + "product_id": "1114", + "sku": "WINNIePuh12", + "image_url": "http://www.example.com/path/to/product/image.png", + "url": "http://www.example.com/path/to/product", + "brand": "Not for Kids", + "price": 9.9, + "categories": [ + "Fiction", + "Children" + ] + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "Viewed Product" + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "$id": "sajal12", + "age": "22", + "name": "Test", + "description": "Sample description" + }, + "properties": { + "ProductName": "test product", + "ProductID": "1114", + "SKU": "WINNIePuh12", + "ImageURL": "http://www.example.com/path/to/product/image.png", + "URL": "http://www.example.com/path/to/product", + "Brand": "Not for Kids", + "Price": 9.9, + "Categories": [ + "Fiction", + "Children" + ] + } + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track call with Ecom events (Checkout Started) with enabled flattenProperties", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey", + "flattenProperties": true + } + }, + "message": { + "type": "track", + "event": "checkout started", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "name": "Test", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68", + "description": "Sample description" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "order_id": "1234", + "affiliation": "Apple Store", + "value": 20, + "revenue": 15, + "shipping": 4, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "products": [ + { + "product_id": "123", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ] + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "Started Checkout" + }, + "properties": { + "$event_id": "1234", + "$value": 20, + "items[0].ProductID": "123", + "items[0].SKU": "G-32", + "items[0].ProductName": "Monopoly", + "items[0].Quantity": 1, + "items[0].ItemPrice": 14, + "items[0].ProductURL": "https://www.website.com/product/path", + "items[0].ImageURL": "https://www.website.com/product/path.jpg", + "items[1].ProductID": "345", + "items[1].SKU": "F-32", + "items[1].ProductName": "UNO", + "items[1].Quantity": 2, + "items[1].ItemPrice": 3.45 + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "$id": "sajal12", + "age": "22", + "name": "Test", + "description": "Sample description" + } + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "klaviyo", + "description": "Track call with Ecom events (Added to Cart) with properties.products", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "publicApiKey": "dummyPublicApiKey", + "privateApiKey": "dummyPrivateApiKey" + } + }, + "message": { + "type": "track", + "event": "product added", + "sentAt": "2021-01-25T16:12:02.048Z", + "userId": "sajal12", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "10" + }, + "app": { + "name": "KlaviyoTest", + "build": "1", + "version": "1.0", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp" + }, + "device": { + "id": "9c6bd77ea9da3e68", + "name": "raphaelin", + "type": "android", + "model": "Redmi K20 Pro", + "manufacturer": "Xiaomi" + }, + "locale": "en-IN", + "screen": { + "width": 1080, + "height": 2210, + "density": 440 + }, + "traits": { + "id": "user@1", + "age": "22", + "name": "Test", + "email": "test@rudderstack.com", + "phone": "9112340375", + "anonymousId": "9c6bd77ea9da3e68", + "description": "Sample description" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "network": { + "wifi": true, + "carrier": "airtel", + "cellular": true, + "bluetooth": false + }, + "timezone": "Asia/Kolkata", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)" + }, + "rudderId": "b7b24f86-f7bf-46d8-b2b4-ccafc080239c", + "messageId": "1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce", + "properties": { + "order_id": "1234", + "value": 12.12, + "categories": [ + "Fiction3", + "Children3" + ], + "checkout_url": "http://www.heythere.com", + "item_names": [ + "book1", + "book2" + ], + "products": [ + { + "product_id": "b1pid", + "sku": "123x", + "name": "book1", + "url": "heyther.com", + "price": 12 + }, + { + "product_id": "b2pid", + "sku": "123x", + "name": "book2", + "url": "heyther2.com", + "price": 14 + } + ] + }, + "anonymousId": "9c6bd77ea9da3e68", + "integrations": { + "All": true + }, + "originalTimestamp": "2021-01-25T15:32:56.409Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://a.klaviyo.com/api/events", + "headers": { + "Authorization": "Klaviyo-API-Key dummyPrivateApiKey", + "Content-Type": "application/json", + "Accept": "application/json", + "revision": "2023-02-22" + }, + "params": {}, + "body": { + "JSON": { + "data": { + "type": "event", + "attributes": { + "metric": { + "name": "Added to Cart" + }, + "profile": { + "$email": "test@rudderstack.com", + "$phone_number": "9112340375", + "$id": "sajal12", + "age": "22", + "name": "Test", + "description": "Sample description" + }, + "properties": { + "$value": 12.12, + "AddedItemCategories": [ + "Fiction3", + "Children3" + ], + "ItemNames": [ + "book1", + "book2" + ], + "CheckoutURL": "http://www.heythere.com", + "items": [ + { + "ProductID": "b1pid", + "SKU": "123x", + "ProductName": "book1", + "ItemPrice": 12, + "ProductURL": "heyther.com" + }, + { + "ProductID": "b2pid", + "SKU": "123x", + "ProductName": "book2", + "ItemPrice": 14, + "ProductURL": "heyther2.com" + } + ] + } + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/klaviyo/router/data.ts b/test/integrations/destinations/klaviyo/router/data.ts new file mode 100644 index 0000000000..0fb735d6bf --- /dev/null +++ b/test/integrations/destinations/klaviyo/router/data.ts @@ -0,0 +1,464 @@ +export const data = [ + { + name: 'klaviyo', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + metadata: { + jobId: 1, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'test', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12 345 578 900', + userId: 'Testc', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + properties: { + consent: ['email', 'sms'], + }, + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + { + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + metadata: { + jobId: 2, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'test', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12 345 578 900', + userId: 'test', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + properties: { + listId: 'XUepkK', + subscribe: true, + consent: ['email', 'sms'], + }, + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + { + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + metadata: { + jobId: 3, + }, + message: { + userId: 'user123', + type: 'group', + groupId: 'XUepkK', + traits: { + subscribe: true, + }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: ['email'], + }, + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + }, + { + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + metadata: { + jobId: 4, + }, + message: { + userId: 'user123', + type: 'random', + groupId: 'XUepkK', + traits: { + subscribe: true, + }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: 'email', + }, + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + }, + { + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + metadata: { + jobId: 5, + }, + message: { + userId: 'user123', + type: 'group', + groupId: '', + traits: { + subscribe: true, + }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: 'email', + }, + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + }, + ], + destType: 'klaviyo', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2023-02-22', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + list_id: 'XUepkK', + subscriptions: [ + { + email: 'test@rudderstack.com', + phone_number: '+12 345 678 900', + }, + { + email: 'test@rudderstack.com', + phone_number: '+12 345 578 900', + channels: { + email: ['MARKETING'], + sms: ['MARKETING'], + }, + }, + ], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2023-02-22', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'test', + email: 'test@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + }, + properties: { + Flagged: false, + Residence: 'Shibuya', + }, + }, + id: '01GW3PHVY0MTCDGS0A1612HARX', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [ + { + jobId: 3, + }, + { + jobId: 2, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2023-02-22', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'test', + email: 'test@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + }, + properties: { + Flagged: false, + Residence: 'Shibuya', + }, + }, + id: '01GW3PHVY0MTCDGS0A1612HARX', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + }, + { + metadata: [ + { + jobId: 4, + }, + ], + batched: false, + statusCode: 400, + error: 'Event type random is not supported', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + }, + { + metadata: [ + { + jobId: 5, + }, + ], + batched: false, + statusCode: 400, + error: 'groupId is a required field for group events', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + destination: { + Config: { + publicApiKey: 'dummyPublicApiKey', + privateApiKey: 'dummyPrivateApiKey', + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/kustomer/network.ts b/test/integrations/destinations/kustomer/network.ts new file mode 100644 index 0000000000..527b47ce2f --- /dev/null +++ b/test/integrations/destinations/kustomer/network.ts @@ -0,0 +1,423 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.kustomerapp.com/v1/customers/externalId=annodD', + method: 'GET', + }, + httpRes: { + data: { + data: { + type: 'customer', + id: '58210c3db0f09110006b7953', + attributes: { + name: 'AnnoD', + displayName: 'AnnoD', + displayColor: 'yellow', + displayIcon: 'flower', + externalId: 'annodD', + externalIds: [ + { + externalId: 'annodD', + verified: true, + id: null, + }, + ], + sharedExternalIds: [], + signedUpAt: null, + avatarUrl: null, + username: null, + emails: [ + { + email: 'annod@kustomer.com', + verified: true, + type: 'home', + id: null, + }, + ], + sharedEmails: [ + { + email: 'annod@kustomer.com', + verified: false, + type: 'home', + id: null, + }, + ], + phones: [], + sharedPhones: [], + socials: [], + sharedSocials: [], + urls: [], + locations: [], + activeUsers: [], + watchers: [], + recentLocation: { + updatedAt: '2016-11-07T23:22:01.746Z', + }, + locale: null, + timeZone: null, + birthdayAt: null, + gender: null, + presence: 'offline', + createdAt: '2016-11-07T23:20:29.080Z', + updatedAt: '2016-11-09T04:47:07.036Z', + modifiedAt: '2016-11-09T04:47:07.036Z', + lastSeenAt: '2016-11-07T23:23:51.582Z', + lastActivityAt: '2016-11-09T04:47:07.036Z', + lastCustomerActivityAt: '2016-11-07T23:23:51.582Z', + lastMessageIn: { + sentAt: '2016-11-07T23:22:02.281Z', + sentiment: null, + }, + lastConversation: { + id: '58210c99b0f09110006b7969', + sentiment: { + confidence: 0.649023, + polarity: 1, + }, + tags: [], + }, + conversationCounts: { + all: 3, + snoozed: 0, + open: 2, + done: 1, + }, + preview: { + previewAt: '2016-11-07T23:23:26.039Z', + type: 'message_out', + text: 'dfsd fsdsfdsfdsf', + subject: 'Hi, do you guys have an XXL hoodie', + }, + tags: [], + sentiment: { + polarity: 1, + confidence: 0.649023, + }, + progressiveStatus: 'open', + verified: true, + rev: 37, + }, + relationships: { + org: { + links: { + self: '/v1/orgs/57f29863a1dbf61100e6aa92', + }, + data: { + type: 'org', + id: '57f29863a1dbf61100e6aa92', + }, + }, + messages: { + links: { + self: '/v1/customers/58210c3db0f09110006b7953/messages', + }, + }, + modifiedBy: { + links: { + self: '/v1/users/58190b991f2932100010d683', + }, + data: { + type: 'user', + id: '58190b991f2932100010d683', + }, + }, + }, + links: { + self: '/v1/customers/58210c3db0f09110006b7953', + }, + }, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.kustomerapp.com/v1/customers/externalId=58210c3db0f09110006b7953', + method: 'GET', + }, + httpRes: { + data: { + data: { + type: 'customer', + id: '58210c3db0f09110006b7953', + attributes: { + name: 'AnnoD', + displayName: 'AnnoD', + displayColor: 'yellow', + displayIcon: 'flower', + externalId: 'annodD', + externalIds: [ + { + externalId: 'annodD', + verified: true, + id: null, + }, + ], + sharedExternalIds: [], + signedUpAt: null, + avatarUrl: null, + username: null, + emails: [ + { + email: 'annod@kustomer.com', + verified: true, + type: 'home', + id: null, + }, + ], + sharedEmails: [ + { + email: 'annod@kustomer.com', + verified: false, + type: 'home', + id: null, + }, + ], + phones: [], + sharedPhones: [], + socials: [], + sharedSocials: [], + urls: [], + locations: [], + activeUsers: [], + watchers: [], + recentLocation: { + updatedAt: '2016-11-07T23:22:01.746Z', + }, + locale: null, + timeZone: null, + birthdayAt: null, + gender: null, + presence: 'offline', + createdAt: '2016-11-07T23:20:29.080Z', + updatedAt: '2016-11-09T04:47:07.036Z', + modifiedAt: '2016-11-09T04:47:07.036Z', + lastSeenAt: '2016-11-07T23:23:51.582Z', + lastActivityAt: '2016-11-09T04:47:07.036Z', + lastCustomerActivityAt: '2016-11-07T23:23:51.582Z', + lastMessageIn: { + sentAt: '2016-11-07T23:22:02.281Z', + sentiment: null, + }, + lastConversation: { + id: '58210c99b0f09110006b7969', + sentiment: { + confidence: 0.649023, + polarity: 1, + }, + tags: [], + }, + conversationCounts: { + all: 3, + snoozed: 0, + open: 2, + done: 1, + }, + preview: { + previewAt: '2016-11-07T23:23:26.039Z', + type: 'message_out', + text: 'dfsd fsdsfdsfdsf', + subject: 'Hi, do you guys have an XXL hoodie', + }, + tags: [], + sentiment: { + polarity: 1, + confidence: 0.649023, + }, + progressiveStatus: 'open', + verified: true, + rev: 37, + }, + relationships: { + org: { + links: { + self: '/v1/orgs/57f29863a1dbf61100e6aa92', + }, + data: { + type: 'org', + id: '57f29863a1dbf61100e6aa92', + }, + }, + messages: { + links: { + self: '/v1/customers/58210c3db0f09110006b7953/messages', + }, + }, + modifiedBy: { + links: { + self: '/v1/users/58190b991f2932100010d683', + }, + data: { + type: 'user', + id: '58190b991f2932100010d683', + }, + }, + }, + links: { + self: '/v1/customers/58210c3db0f09110006b7953', + }, + }, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.prod2.kustomerapp.com/v1/customers/externalId=58210c3db0f09110006b7953', + method: 'GET', + }, + httpRes: { + data: { + data: { + type: 'customer', + id: '58210c3db0f09110006b7953', + attributes: { + name: 'AnnoD', + displayName: 'AnnoD', + displayColor: 'yellow', + displayIcon: 'flower', + externalId: 'annodD', + externalIds: [ + { + externalId: 'annodD', + verified: true, + id: null, + }, + ], + sharedExternalIds: [], + signedUpAt: null, + avatarUrl: null, + username: null, + emails: [ + { + email: 'annod@kustomer.com', + verified: true, + type: 'home', + id: null, + }, + ], + sharedEmails: [ + { + email: 'annod@kustomer.com', + verified: false, + type: 'home', + id: null, + }, + ], + phones: [], + sharedPhones: [], + socials: [], + sharedSocials: [], + urls: [], + locations: [], + activeUsers: [], + watchers: [], + recentLocation: { + updatedAt: '2016-11-07T23:22:01.746Z', + }, + locale: null, + timeZone: null, + birthdayAt: null, + gender: null, + presence: 'offline', + createdAt: '2016-11-07T23:20:29.080Z', + updatedAt: '2016-11-09T04:47:07.036Z', + modifiedAt: '2016-11-09T04:47:07.036Z', + lastSeenAt: '2016-11-07T23:23:51.582Z', + lastActivityAt: '2016-11-09T04:47:07.036Z', + lastCustomerActivityAt: '2016-11-07T23:23:51.582Z', + lastMessageIn: { + sentAt: '2016-11-07T23:22:02.281Z', + sentiment: null, + }, + lastConversation: { + id: '58210c99b0f09110006b7969', + sentiment: { + confidence: 0.649023, + polarity: 1, + }, + tags: [], + }, + conversationCounts: { + all: 3, + snoozed: 0, + open: 2, + done: 1, + }, + preview: { + previewAt: '2016-11-07T23:23:26.039Z', + type: 'message_out', + text: 'dfsd fsdsfdsfdsf', + subject: 'Hi, do you guys have an XXL hoodie', + }, + tags: [], + sentiment: { + polarity: 1, + confidence: 0.649023, + }, + progressiveStatus: 'open', + verified: true, + rev: 37, + }, + relationships: { + org: { + links: { + self: '/v1/orgs/57f29863a1dbf61100e6aa92', + }, + data: { + type: 'org', + id: '57f29863a1dbf61100e6aa92', + }, + }, + messages: { + links: { + self: '/v1/customers/58210c3db0f09110006b7953/messages', + }, + }, + modifiedBy: { + links: { + self: '/v1/users/58190b991f2932100010d683', + }, + data: { + type: 'user', + id: '58190b991f2932100010d683', + }, + }, + }, + links: { + self: '/v1/customers/58210c3db0f09110006b7953', + }, + }, + }, + status: 204, + }, + }, + { + httpReq: { + url: 'https://api.kustomerapp.com/v1/customers/externalId=Testc', + method: 'GET', + }, + httpRes: { error: 'Request failed', status: 404 }, + }, + { + httpReq: { + url: 'https://api.kustomerapp.com/v1/customers/email=test@rudderstack.com', + method: 'GET', + }, + httpRes: { error: 'Request failed', status: 404 }, + }, + { + httpReq: { + url: 'https://api.kustomerapp.com/v1/customers/externalId=97c46c81-3140-456d-b2a9-690d70aaca35', + method: 'GET', + }, + httpRes: { error: 'Request failed', status: 404 }, + }, + { + httpReq: { + url: 'https://api.kustomerapp.com/v1/customers/externalId=testc', + method: 'GET', + }, + httpRes: { error: 'Request failed', status: 404 }, + }, +]; diff --git a/test/integrations/destinations/kustomer/processor/data.ts b/test/integrations/destinations/kustomer/processor/data.ts new file mode 100644 index 0000000000..ba8407baaf --- /dev/null +++ b/test/integrations/destinations/kustomer/processor/data.ts @@ -0,0 +1,1901 @@ +export const data = [ + { + name: 'kustomer', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Testc', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + name: 'Test Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12345578900', + birthday: '2005-01-01T23:28:56.782Z', + userId: 'Testc', + address: { + street: '24 Dovers Lane', + city: 'Miami', + state: 'Florida', + postalCode: '1890001', + }, + userName: 'Testc47', + company: 'Rudderstack', + createdAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + website: 'www.mattertoast873.com', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/customers', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + name: 'Test Rudderlabs', + externalId: 'Testc', + username: 'Testc47', + company: 'Rudderstack', + signedUpAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + locale: 'en-US', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + birthdayAt: '2005-01-01T23:28:56.782Z', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + urls: [ + { + url: 'www.mattertoast873.com', + }, + ], + locations: [ + { + type: 'home', + address: '24 Dovers Lane Miami Florida 1890001', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + userId: '58210c3db0f09110006b7953', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + name: 'Ano Domeni', + phone: '+12345578000', + birthday: '2005-01-01T23:28:56.782Z', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://api.kustomerapp.com/v1/customers/58210c3db0f09110006b7953?replace=false', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + name: 'Ano Domeni', + externalId: '58210c3db0f09110006b7953', + locale: 'en-US', + birthdayAt: '2005-01-01T23:28:56.782Z', + phones: [ + { + type: 'home', + phone: '+12345578000', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'screen', + event: 'Test-Event-Screen', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'Testc', + channel: 'mobile', + context: { + os: { + name: 'Android', + version: '10', + }, + app: { + name: 'KlaviyoTest', + build: '1', + version: '1.0', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + }, + device: { + id: '9c6bd77ea9da3e68', + name: 'raphaelin', + type: 'android', + model: 'Redmi K20 Pro', + manufacturer: 'Xiaomi', + }, + locale: 'en-IN', + screen: { + width: 1080, + height: 2210, + density: 440, + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + network: { + wifi: true, + carrier: 'airtel', + cellular: true, + bluetooth: false, + }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)', + }, + rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c', + messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce', + properties: { + hasAccount: 'true', + YearSelectedNum: 1801, + originalServing: '2021-01-25T15:32:56.409Z', + }, + anonymousId: '9c6bd77ea9da3e68', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-25T15:32:56.409Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'Testc', + }, + event: { + name: 'Screen-Viewed-Test-Event-Screen', + meta: { + hasAccount: 'true', + YearSelectedNum: 1801, + originalServing: '2021-01-25T15:32:56.409Z', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + name: 'Cart-Viewed', + type: 'page', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + locale: 'en-US', + screen: { + density: 2, + }, + traits: { + userId: 'userid', + profession: 'Student', + anonymousId: 'd80b66d5-b33d-412d-866f-r4fft5841af', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + category: 'Cart', + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + url: 'http://morkey.in', + name: 'Cart Viewed', + path: '/cart', + title: 'miphone', + search: 'MI', + category: 'Cart', + referrer: 'morkey', + domain: 'morkey.com', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'user@doe', + }, + event: { + name: 'Web-Page-Viewed-Cart-Viewed', + meta: { + url: 'http://morkey.in', + name: 'Cart Viewed', + path: '/cart', + title: 'miphone', + search: 'MI', + category: 'Cart', + referrer: 'morkey', + domain: 'morkey.com', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'page', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + locale: 'en-US', + screen: { + density: 2, + }, + traits: { + userId: 'userid', + profession: 'Student', + anonymousId: 'd80b66d5-b33d-412d-866f-r4fft5841af', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + category: 'Cart', + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + category: 'Cart', + referrer: 'morkey', + domain: 'morkey.com', + kustomerTrackingId: '829131sjad', + kustomerSessionId: 'hsad522', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'user@doe', + }, + event: { + name: 'Web-Page-Viewed', + sessionId: 'hsad522', + trackingId: '829131sjad', + meta: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + category: 'Cart', + referrer: 'morkey', + domain: 'morkey.com', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'track', + event: 'Tracking-Weekender', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + YearServicedNum: 211, + region: 'strapis', + kustomerTrackingId: 'sahetwiac', + kustomerSessionId: '63nsa22', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + locale: 'en-US', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'user@doe', + }, + event: { + name: 'Tracking-Weekender', + sessionId: '63nsa22', + trackingId: 'sahetwiac', + meta: { + YearServicedNum: 211, + region: 'strapis', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'track', + event: 'Tracking-Weekender2', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + YearServicedNum: 211, + 'reg_8-821x': false, + kustomer_tracking_id: 'sahetwiac', + kustomer_session_id: '63nsa22', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + locale: 'en-US', + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + FORM: {}, + JSON: { + event: { + meta: { + YearServicedNum: 211, + 'reg_8-821x': false, + }, + name: 'Tracking-Weekender2', + sessionId: '63nsa22', + trackingId: 'sahetwiac', + }, + identity: { + externalId: 'user@doe', + }, + }, + XML: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + genericPage: true, + }, + }, + message: { + type: 'page', + name: 'Unfinished page', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + category: 'Cart', + referrer: 'morkey', + domain: 'morkey.com', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + locale: 'en-US', + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'user@doe', + }, + event: { + name: 'Web-Page-Viewed', + meta: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + category: 'Cart', + referrer: 'morkey', + domain: 'morkey.com', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + genericScreen: true, + }, + }, + message: { + type: 'screen', + event: 'Test-Event-Screen', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'Testc', + channel: 'mobile', + context: { + os: { + name: 'Android', + version: '10', + }, + app: { + name: 'KlaviyoTest', + build: '1', + version: '1.0', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + }, + device: { + id: '9c6bd77ea9da3e68', + name: 'raphaelin', + type: 'android', + model: 'Redmi K20 Pro', + manufacturer: 'Xiaomi', + }, + locale: 'en-IN', + screen: { + width: 1080, + height: 2210, + density: 440, + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + network: { + wifi: true, + carrier: 'airtel', + cellular: true, + bluetooth: false, + }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)', + }, + rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c', + messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce', + properties: { + hasAccount: 'true', + YearSelectedNum: 1801, + originalServing: '2021-01-25T15:32:56.409Z', + }, + anonymousId: '9c6bd77ea9da3e68', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-25T15:32:56.409Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'Testc', + }, + event: { + name: 'Screen-Viewed', + meta: { + hasAccount: 'true', + YearSelectedNum: 1801, + originalServing: '2021-01-25T15:32:56.409Z', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Testc', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12345578900', + birthday: '2005-01-01T23:28:56.782Z', + userId: 'Testc', + address: { + street: '24 Dovers Lane', + city: 'Miami', + state: 'Florida', + postalCode: '1890001', + }, + userName: 'Testc47', + company: 'Rudderstack', + createdAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + website: 'www.mattertoast873.com', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/customers', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + name: 'Test Rudderlabs', + externalId: 'Testc', + username: 'Testc47', + company: 'Rudderstack', + signedUpAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + locale: 'en-US', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + birthdayAt: '2005-01-01T23:28:56.782Z', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + urls: [ + { + url: 'www.mattertoast873.com', + }, + ], + locations: [ + { + type: 'home', + address: '24 Dovers Lane Miami Florida 1890001', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Testc', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + birthday: '2005-01-01T23:28:56.782Z', + userId: 'Testc', + address: 'test address string', + userName: 'Testc47', + company: 'Rudderstack', + createdAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + website: 'www.mattertoast873.com', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/customers', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + name: 'Test Rudderlabs', + externalId: 'Testc', + username: 'Testc47', + company: 'Rudderstack', + signedUpAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + locale: 'en-US', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + birthdayAt: '2005-01-01T23:28:56.782Z', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + urls: [ + { + url: 'www.mattertoast873.com', + }, + ], + locations: [ + { + type: 'home', + address: 'test address string', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Testc', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + birthday: '2005-01-01T23:28:56.782Z', + userId: 'Testc', + address: 'test address string', + userName: 'Testc47', + company: 'Rudderstack', + createdAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + website: 'www.mattertoast873.com', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + externalId: [ + { + type: 'kustomerId', + id: 'abcd1234', + }, + ], + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { + All: true, + }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.kustomerapp.com/v1/customers/abcd1234?replace=false', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + name: 'Test Rudderlabs', + externalId: 'Testc', + username: 'Testc47', + company: 'Rudderstack', + signedUpAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + locale: 'en-US', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@Testc', + url: 'http://twitter.com/Testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'Testc', + url: 'http://facebook.com/Testc', + }, + ], + birthdayAt: '2005-01-01T23:28:56.782Z', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + urls: [ + { + url: 'www.mattertoast873.com', + }, + ], + locations: [ + { + type: 'home', + address: 'test address string', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + genericScreen: true, + }, + }, + message: { + type: 'screen', + event: 'Test-Event-Screen', + userId: 'utsabc', + channel: 'mobile', + context: { + os: { + name: 'Android', + version: '10', + }, + app: { + name: 'KlaviyoTest', + build: '1', + version: '1.0', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + }, + device: { + id: '9c6bd77ea9da3e68', + name: 'raphaelin', + type: 'android', + model: 'Redmi K20 Pro', + manufacturer: 'Xiaomi', + }, + locale: 'en-IN', + screen: { + width: 1080, + height: 2210, + density: 440, + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + network: { + wifi: true, + carrier: 'airtel', + cellular: true, + bluetooth: false, + }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)', + sessionId: 'hsad522', + }, + rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c', + messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce', + properties: { + hasAccount: 'true', + YearSelectedNum: 1801, + }, + anonymousId: '9c6bd77ea9da3e68', + integrations: { + All: true, + }, + originalTimestamp: '2023-01-10T15:32:56.409Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'utsabc', + }, + event: { + name: 'Screen-Viewed', + sessionId: 'hsad522', + meta: { + hasAccount: 'true', + YearSelectedNum: 1801, + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kustomer', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + baseEndpoint: 'https://api.prod2.kustomerapp.com', + genericScreen: true, + }, + }, + message: { + type: 'screen', + event: 'Test-Event-Screen', + userId: 'Testc', + channel: 'mobile', + context: { + os: { + name: 'Android', + version: '10', + }, + app: { + name: 'KlaviyoTest', + build: '1', + version: '1.0', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + }, + device: { + id: '9c6bd77ea9da3e68', + name: 'raphaelin', + type: 'android', + model: 'Redmi K20 Pro', + manufacturer: 'Xiaomi', + }, + locale: 'en-IN', + screen: { + width: 1080, + height: 2210, + density: 440, + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + network: { + wifi: true, + carrier: 'airtel', + cellular: true, + bluetooth: false, + }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)', + sessionId: 'hsad522', + }, + rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c', + messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce', + properties: { + hasAccount: 'true', + YearSelectedNum: 1801, + }, + anonymousId: '9c6bd77ea9da3e68', + integrations: { + All: true, + }, + originalTimestamp: '2023-01-10T15:32:56.409Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'Testc', + }, + event: { + name: 'Screen-Viewed', + sessionId: 'hsad522', + meta: { + hasAccount: 'true', + YearSelectedNum: 1801, + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/kustomer/router/data.ts b/test/integrations/destinations/kustomer/router/data.ts new file mode 100644 index 0000000000..6dae5d5e76 --- /dev/null +++ b/test/integrations/destinations/kustomer/router/data.ts @@ -0,0 +1,393 @@ +export const data = [ + { + name: 'kustomer', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'testc', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + name: 'test Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12345578900', + birthday: '2005-01-01T23:28:56.782Z', + userId: 'testc', + address: { + street: '24 Dovers Lane', + city: 'Miami', + state: 'Florida', + postalCode: '1890001', + }, + userName: 'testc47', + company: 'Rudderstack', + createdAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + website: 'www.mattertoast873.com', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@testc', + url: 'http://twitter.com/testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'testc', + url: 'http://facebook.com/testc', + }, + ], + }, + locale: 'en-US', + screen: { density: 2 }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + genericPage: false, + genericScreen: false, + }, + }, + }, + { + message: { + type: 'track', + event: 'Tracking-Weekender', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + locale: 'en-US', + screen: { density: 2 }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + YearServicedNum: 211, + region: 'strapis', + kustomerTrackingId: 'sahetwiac', + kustomerSessionId: '63nsa22', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + locale: 'en-US', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + genericPage: false, + genericScreen: false, + }, + }, + }, + { + message: { + type: 'track', + event: 'Tracking-Weekender', + sentAt: '2021-01-03T17:02:53.197Z', + userId: 'user@doe', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://morkey.in', + path: '/cart', + title: 'miphone', + search: 'MI', + referrer: 'morkey', + }, + locale: 'en-US', + screen: { density: 2 }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '15129730-eb00-4db7-8db2-799566ccb2ef', + properties: { + YearServicedNum: 211, + region: 'strapis', + kustomerTrackingId: 'sahetwiac', + kustomerSessionId: '63nsa22', + }, + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + locale: 'en-US', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.195Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + baseEndpoint: 'https://api.prod2.kustomerapp.com', + apiKey: 'dummyApiKey', + genericPage: false, + genericScreen: false, + }, + }, + }, + ], + destType: 'kustomer', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/customers', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + name: 'test Rudderlabs', + externalId: 'testc', + username: 'testc47', + company: 'Rudderstack', + signedUpAt: '2015-04-17T12:37:42.146Z', + lastActivityAt: '2016-04-17T12:37:42.146Z', + lastCustomerActivityAt: '2017-04-17T12:37:42.146Z', + lastSeenAt: '2017-04-17T12:37:42.146Z', + avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png', + gender: 'm', + tags: ['happy', 'satisfied'], + locale: 'en-US', + socials: [ + { + verified: true, + userid: '100', + type: 'twitter', + username: '@testc', + url: 'http://twitter.com/testc', + }, + { + verified: false, + userid: '200', + type: 'facebook', + username: 'testc', + url: 'http://facebook.com/testc', + }, + ], + birthdayAt: '2005-01-01T23:28:56.782Z', + emails: [ + { + type: 'home', + email: 'test@rudderstack.com', + }, + ], + phones: [ + { + type: 'home', + phone: '+12345578900', + }, + ], + urls: [ + { + url: 'www.mattertoast873.com', + }, + ], + locations: [ + { + type: 'home', + address: '24 Dovers Lane Miami Florida 1890001', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'dummyApiKey', + genericPage: false, + genericScreen: false, + }, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'user@doe', + }, + event: { + name: 'Tracking-Weekender', + sessionId: '63nsa22', + trackingId: 'sahetwiac', + meta: { + YearServicedNum: 211, + region: 'strapis', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'dummyApiKey', + genericPage: false, + genericScreen: false, + }, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + identity: { + externalId: 'user@doe', + }, + event: { + name: 'Tracking-Weekender', + sessionId: '63nsa22', + trackingId: 'sahetwiac', + meta: { + YearServicedNum: 211, + region: 'strapis', + }, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + baseEndpoint: 'https://api.prod2.kustomerapp.com', + apiKey: 'dummyApiKey', + genericPage: false, + genericScreen: false, + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/mailchimp/network.ts b/test/integrations/destinations/mailchimp/network.ts new file mode 100644 index 0000000000..b036bf566c --- /dev/null +++ b/test/integrations/destinations/mailchimp/network.ts @@ -0,0 +1,80 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://usXXX.api.mailchimp.com/3.0/lists/aud111/members/0b63fa319d113aede8b7b409e4fc6437', + method: 'GET', + }, + httpRes: { + data: { + data: { + type: 'https://mailchimp.com/developer/marketing/docs/errors/', + title: 'Forbidden', + status: 403, + detail: "The API key provided is linked to datacenter 'us6'", + instance: 'ff092056-4d86-aa05-bbe9-9e9466108d81', + }, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', + method: 'GET', + }, + httpRes: { + data: { + contact_id: 821932121, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/b599284b872e06d29bb796a260ae7c1f', + method: 'GET', + }, + httpRes: { + data: { + contact_id: 821932121, + }, + status: 204, + }, + }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud000', + method: 'GET', + }, + httpRes: { + data: { + double_optin: false, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud112', + method: 'GET', + }, + httpRes: { + data: { + double_optin: false, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud002', + method: 'GET', + }, + httpRes: { + data: { + double_optin: false, + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/mailchimp/processor/data.ts b/test/integrations/destinations/mailchimp/processor/data.ts new file mode 100644 index 0000000000..a0ee5de3d3 --- /dev/null +++ b/test/integrations/destinations/mailchimp/processor/data.ts @@ -0,0 +1,2259 @@ +export const data = [ + { + name: 'mailchimp', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + firstName: 'Bob', + lastName: 'Dole', + zip: '123', + state: 'test', + city: 'test', + addressLine1: 'test', + birthday: '2000-05-06', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + merge_fields: { + ADDRESS: { + addr1: 'test', + city: 'test', + state: 'test', + zip: '123', + }, + FNAME: 'Bob', + LNAME: 'Dole', + ANONYMOUSI: 'userId12345', + BIRTHDAY: '05/06', + }, + email_address: 'bob.dole@initech.com', + status: 'subscribed', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + MailChimp: { + subscriptionStatus: 'subscribed', + }, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + status: 'subscribed', + email_address: 'bob.dole@initech.com', + merge_fields: { + ANONYMOUSI: 'userId12345', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'Titli Test', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + type: 'identify', + sentAt: '2021-05-18T06:58:57.186Z', + userId: 'test.rudderlabs@yara.com', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'https://app.rudderstack.com/sources/1qHR2Qzd894ievNGc4aBHmjltLD', + path: '/sources/1qHR2Qzd894ievNGc4aBHmjltLD', + title: 'RudderStack', + search: '', + tab_url: 'https://app.rudderstack.com/sources/1qHR2Qzd894ievNGc4aBHmjltLD', + referrer: '$direct', + initial_referrer: 'https://www.google.com/', + referring_domain: '', + initial_referring_domain: 'www.google.com', + }, + locale: 'en-US', + screen: { + width: 1792, + height: 1120, + density: 2, + }, + traits: { + name: 'test rudderlabs', + email: 'test.rudderlabs@yara.com', + userId: '1sWVaQTxoVwjvShC0295E6OqMaP', + first_login: false, + workspaceId: '1jWrHYPjNGSHbvKwzow0ZFPIQll', + account_type: 'invited', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.18', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36', + }, + rudderId: '6d612dda-9c8c-4062-9d09-af9425b846ce', + messageId: 'c6d49688-89f2-45cf-b061-0ae3c212a4e5', + timestamp: '2021-05-18T06:58:57.811Z', + receivedAt: '2021-05-18T06:58:57.812Z', + request_ip: '122.172.221.51', + anonymousId: '6914679f-fd34-45ef-86e0-4930e6e8b91a', + integrations: { + Salesforce: true, + }, + originalTimestamp: '2021-05-18T06:58:57.185Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'User does not have access to the requested operation', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'network', + errorType: 'aborted', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'Titli Test', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + type: 'page', + sentAt: '2021-05-18T07:02:17.675Z', + userId: '', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'https://app.rudderstack.com/signup?type=freetrial', + path: '/signup', + title: '', + search: '?type=freetrial', + tab_url: 'https://app.rudderstack.com/signup?type=freetrial', + referrer: + 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e', + initial_referrer: + 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e', + referring_domain: 'rudderstack.medium.com', + initial_referring_domain: 'rudderstack.medium.com', + }, + locale: 'en-GB', + screen: { + density: 2, + }, + traits: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.18', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36', + }, + rudderId: '4dbe224c-6aea-4d89-8da6-09d27c0d2908', + messageId: '72df8cb0-54ab-417c-8e87-e97e9d339feb', + timestamp: '2021-05-18T07:02:18.566Z', + properties: { + url: 'https://app.rudderstack.com/signup?type=freetrial', + path: '/signup', + title: '', + search: '?type=freetrial', + tab_url: 'https://app.rudderstack.com/signup?type=freetrial', + referrer: + 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e', + initial_referrer: + 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e', + referring_domain: 'rudderstack.medium.com', + initial_referring_domain: 'rudderstack.medium.com', + }, + receivedAt: '2021-05-18T07:02:18.566Z', + request_ip: '162.44.150.11', + anonymousId: '58ec7b39-48f1-4d83-9d45-a48c64f96fa0', + integrations: { + All: true, + }, + originalTimestamp: '2021-05-18T07:02:17.675Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'message type page is not supported', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email_address', + id: 'bob.dole@initech.com', + type: 'audience', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + merge_fields: { + FIRSTNAME: 'Bob', + }, + status: 'subscribed', + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + merge_fields: { + FIRSTNAME: 'Bob', + }, + status: 'subscribed', + email_address: 'bob.dole@initech.com', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + type: 'identify', + traits: { + status: 'subscri', + }, + userId: 'emrichardson820+22822@gmail.com', + channel: 'sources', + context: { + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + externalId: [ + { + id: 'emrichardson820+22822@gmail.com', + type: 'MAILCHIMP-92e1f1ad2c', + identifierType: 'email_address', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a', + messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Email is required for identify', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud112', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'jhon@gmail.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + status: 'subscribed', + email_address: 'jhon@gmail.com', + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + audienceId: 'aud112', + version: '1', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud112/members/7f3863b197eeff650876bb89eca08e57', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'bob.dole@initech.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + email_address: 'bob.dole@initech.com', + status: 'subscribed', + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + audienceId: 'aud111', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + version: '1', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + MailChimp: { + subscriptionStatus: 'subscribed', + }, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + status: 'subscribed', + email_address: 'bob.dole@initech.com', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: '', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'test-rudderlabs', + email: 'test-rudderlabs-test@initech.com', + firstName: 'Test', + lastName: 'Rudderlabs', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'API Key not found. Aborting', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'test-rudderlabs', + email: 'test-rudderlabs-test@initech.com', + firstName: 'Test', + lastName: 'Rudderlabs', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Audience Id not found. Aborting', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: '', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'test-rudderlabs', + email: 'test-rudderlabs-test@initech.com', + firstName: 'Test', + lastName: 'Rudderlabs', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'DataCenter Id not found. Aborting', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'test-rudderlabs', + email: 'test-rudderlabs-test@initech.com', + firstName: 'Test', + lastName: 'Rudderlabs', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'group', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'message type group is not supported', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + name: 'local_testing', + occurred_at: '2019-11-15T10:26:53+00:00', + properties: { + brand: 'Aster', + product: 'Garments', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 15', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + name: 'local_testing', + occurred_at: '2019-11-15T10:26:53+00:00', + is_syncing: false, + properties: { + brand: 'Aster', + product: 'Garments', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + }, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Email is required for track', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 17', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Missing required value from "event"', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 18', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + name: 'local_testing', + occurred_at: '2019-11-15T10:26:53+00:00', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 19', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + }, + ], + purchased: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + name: 'local_testing', + occurred_at: '2019-11-15T10:26:53+00:00', + is_syncing: false, + properties: { + brand: 'Aster', + product: 'Garments', + products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + purchased: 'false', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 20', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + }, + ], + purchased: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 22, + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + }, + params: {}, + body: { + JSON: { + name: '22', + occurred_at: '2019-11-15T10:26:53+00:00', + is_syncing: false, + properties: { + brand: 'Aster', + product: 'Garments', + products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + purchased: 'false', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 21', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + }, + ], + purchased: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'E', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event name should be between 2 and 30 characters', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'mailchimp', + description: 'Test 22', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'dummyApiKey', + audienceId: 'aud111', + datacenterId: 'usXX', + }, + Enabled: true, + Transformations: [], + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + }, + ], + purchased: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'Event Name more than 30 characters abcdefghijklmno', + userId: 'userId12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event name should be between 2 and 30 characters', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/mailchimp/router/data.ts b/test/integrations/destinations/mailchimp/router/data.ts new file mode 100644 index 0000000000..f6a9627719 --- /dev/null +++ b/test/integrations/destinations/mailchimp/router/data.ts @@ -0,0 +1,977 @@ +export const data = [ + { + name: 'mailchimp', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + firstName: 'Bob', + lastName: 'Dole', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 3, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + MailChimp: { + subscriptionStatus: 'subscribed', + }, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 4, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + MailChimp: { + subscriptionStatus: 'subscrib', + }, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 5, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 6, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + is_syncing: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + userId: 'userId12345', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 7, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + traits: { + anonymousId: 'userId12345', + email: 'bob.dole@initech.com', + }, + }, + properties: { + brand: 'Aster', + product: 'Garments', + isSyncing: false, + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + }, + ], + purchased: false, + }, + messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c', + originalTimestamp: '2019-11-15T10:26:53Z', + receivedAt: '2019-11-15T15:56:58+05:30', + sentAt: '2019-11-15T10:26:58Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:56:53+05:30', + type: 'track', + event: 'local testing', + userId: 'userId12345', + }, + }, + ], + destType: 'mailchimp', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111?skip_merge_validation=true&skip_duplicate_check=false', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + }, + params: {}, + body: { + JSON: { + members: [ + { + email_address: 'bob.dole@initech.com', + merge_fields: { + FNAME: 'Bob', + LNAME: 'Dole', + ANONYMOUSI: 'userId12345', + }, + status: 'subscribed', + }, + { + email_address: 'bob.dole@initech.com', + merge_fields: { + ANONYMOUSI: 'userId12345', + }, + status: 'subscribed', + }, + ], + update_existing: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + { + jobId: 3, + }, + ], + batched: true, + statusCode: 200, + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + }, + params: {}, + body: { + JSON: { + name: 'local_testing', + occurred_at: '2019-11-15T10:26:53+00:00', + properties: { + brand: 'Aster', + product: 'Garments', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + }, + metadata: [ + { + jobId: 5, + }, + ], + batched: false, + statusCode: 200, + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + }, + params: {}, + body: { + JSON: { + name: 'local_testing', + occurred_at: '2019-11-15T10:26:53+00:00', + is_syncing: false, + properties: { + brand: 'Aster', + product: 'Garments', + products: + '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + purchased: 'false', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + audienceId: 'aud111', + }, + metadata: [ + { + jobId: 7, + }, + ], + batched: false, + statusCode: 200, + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: [ + { + jobId: 6, + }, + ], + batched: false, + statusCode: 400, + error: 'Missing required value from "event"', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apikey', + audienceId: 'aud111', + datacenterId: 'usXX', + enableMergeFields: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: [ + { + jobId: 4, + }, + ], + batched: false, + statusCode: 400, + error: + 'The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + }, + ], + }, + }, + }, + }, + { + name: 'mailchimp', + description: 'events batching', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: '1232yyqw22', + datacenterId: 'us20', + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'userId12345', + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email_address', + id: 'bob.dole@initech.com', + type: 'audience', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + merge_fields: { + FIRSTNAME: 'Bob', + }, + status: 'subscribed', + }, + messageId: '21e475b2-3694-477b-afb6-5b94a81aac21', + originalTimestamp: '2019-11-15T10:22:32Z', + receivedAt: '2019-11-15T15:52:37+05:30', + request_ip: '[::1]:62921', + sentAt: '2019-11-15T10:22:37Z', + source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr', + timestamp: '2019-11-15T15:52:32+05:30', + type: 'identify', + userId: 'userId12345', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: '1232yyqw22', + datacenterId: 'us20', + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 3, + }, + message: { + type: 'identify', + traits: { + status: 'subscribed', + }, + userId: 'emrichardson820+22822@gmail.com', + channel: 'sources', + context: { + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + externalId: [ + { + id: 'emrichardson820+22822@gmail.com', + type: 'MAILCHIMP-92e1f1ad2c', + identifierType: 'email_address', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a', + messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: '1232yyqw22', + datacenterId: 'us20', + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 4, + }, + message: { + type: 'identify', + traits: { + status: 'subscribed', + }, + userId: 'emrichardson820+22822@gmail.com', + channel: 'sources', + context: { + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + externalId: [ + { + id: 'emrichardson820+22822@gmail.com', + type: 'MAILCHIMP-92e1f1ad2c', + identifierType: 'email_address', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a', + messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82', + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: '1232yyqw22', + datacenterId: 'us20', + }, + Enabled: true, + Transformations: [], + }, + metadata: { + jobId: 5, + }, + message: { + type: 'identify', + traits: { + status: 'subscrib', + }, + userId: 'emrichardson820+22822@gmail.com', + channel: 'sources', + context: { + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + externalId: [ + { + id: 'emrichardson820+22822@gmail.com', + type: 'MAILCHIMP-92e1f1ad2c', + identifierType: 'email_address', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a', + messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82', + }, + }, + ], + destType: 'mailchimp', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://us20.api.mailchimp.com/3.0/lists/1232yyqw22?skip_merge_validation=false&skip_duplicate_check=false', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + }, + params: {}, + body: { + JSON: { + members: [ + { + merge_fields: { + FIRSTNAME: 'Bob', + }, + status: 'subscribed', + email_address: 'bob.dole@initech.com', + }, + { + status: 'subscribed', + email_address: 'emrichardson820+22822@gmail.com', + }, + { + status: 'subscribed', + email_address: 'emrichardson820+22822@gmail.com', + }, + ], + update_existing: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + { + jobId: 3, + }, + { + jobId: 4, + }, + ], + batched: true, + statusCode: 200, + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: '1232yyqw22', + datacenterId: 'us20', + }, + Enabled: true, + Transformations: [], + }, + }, + { + destination: { + ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6', + Name: 'test-mc', + DestinationDefinition: { + ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn', + Name: 'MC', + DisplayName: 'MailChimp', + }, + Config: { + apiKey: 'apiKey-dummyApiKey', + audienceId: '1232yyqw22', + datacenterId: 'us20', + }, + Enabled: true, + Transformations: [], + }, + metadata: [ + { + jobId: 5, + }, + ], + batched: false, + statusCode: 400, + error: + 'The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]', + statTags: { + destType: 'MAILCHIMP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/marketo/network.ts b/test/integrations/destinations/marketo/network.ts index b7ae48b23f..9c28a9aef1 100644 --- a/test/integrations/destinations/marketo/network.ts +++ b/test/integrations/destinations/marketo/network.ts @@ -248,10 +248,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_success", - "expires_in": 3599, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -264,10 +264,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_expired", - "expires_in": 0, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_expired', + expires_in: 0, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -280,14 +280,14 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7ab2#17672a46a99", - "result": [ + requestId: '7ab2#17672a46a99', + result: [ { - "id": 4, - "status": "created" - } + id: 4, + status: 'created', + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -300,9 +300,9 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "107#17672aeadba", - "result": [], - "success": true + requestId: '107#17672aeadba', + result: [], + success: true, }, status: 200, statusText: 'OK', @@ -315,19 +315,19 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "12093#17672aeaee6", - "result": [ + requestId: '12093#17672aeaee6', + result: [ { - "createdAt": "2020-12-17T21:39:07Z", - "email": null, - "firstName": null, - "id": 4, - "lastName": null, - "updatedAt": "2020-12-17T21:39:07Z", - "userId": "test-user-6j55yr" - } + createdAt: '2020-12-17T21:39:07Z', + email: null, + firstName: null, + id: 4, + lastName: null, + updatedAt: '2020-12-17T21:39:07Z', + userId: 'test-user-6j55yr', + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -340,13 +340,13 @@ export const networkCallsData = [ }, httpRes: { data: { - "success": false, - "errors": [ + success: false, + errors: [ { - "code": "601", - "message": "Access Token Expired" - } - ] + code: '601', + message: 'Access Token Expired', + }, + ], }, status: 200, statusText: 'OK', @@ -359,7 +359,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_acess" + access_token: 'test_acess', }, status: 200, statusText: 'OK', @@ -372,7 +372,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_access_token" + access_token: 'test_access_token', }, status: 200, statusText: 'OK', @@ -385,24 +385,24 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7fa1#17fd1da66fe", - "result": [ + requestId: '7fa1#17fd1da66fe', + result: [ { - "name": "API Lead", - "searchableFields": [["email"]], - "fields": [ + name: 'API Lead', + searchableFields: [['email']], + fields: [ { - "name": "email", - "displayName": "Email Address", - "dataType": "email", - "length": 255, - "updateable": true, - "crmManaged": false - } - ] - } + name: 'email', + displayName: 'Email Address', + dataType: 'email', + length: 255, + updateable: true, + crmManaged: false, + }, + ], + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -415,15 +415,15 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "5bdd#17fd1ff88cd", - "result": [ + requestId: '5bdd#17fd1ff88cd', + result: [ { - "batchId": 2977, - "importId": "2977", - "status": "Queued" - } + batchId: 2977, + importId: '2977', + status: 'Queued', + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -436,7 +436,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_access_token" + access_token: 'test_access_token', }, status: 200, statusText: 'OK', @@ -449,7 +449,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_access_token" + access_token: 'test_access_token', }, status: 200, statusText: 'OK', @@ -462,24 +462,24 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7fa1#17fd1da66fe", - "result": [ + requestId: '7fa1#17fd1da66fe', + result: [ { - "name": "API Lead", - "searchableFields": [["email"]], - "fields": [ + name: 'API Lead', + searchableFields: [['email']], + fields: [ { - "name": "email", - "displayName": "Email Address", - "dataType": "email", - "length": 255, - "updateable": true, - "crmManaged": false - } - ] - } + name: 'email', + displayName: 'Email Address', + dataType: 'email', + length: 255, + updateable: true, + crmManaged: false, + }, + ], + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -492,7 +492,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_access_token" + access_token: 'test_access_token', }, status: 200, statusText: 'OK', @@ -505,12 +505,12 @@ export const networkCallsData = [ }, httpRes: { data: { - "errors": [ + errors: [ { - "message": "Any 400 error", - "code": 1000 - } - ] + message: 'Any 400 error', + code: 1000, + }, + ], }, status: 200, statusText: 'OK', @@ -523,7 +523,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_access_token" + access_token: 'test_access_token', }, status: 200, statusText: 'OK', @@ -536,7 +536,7 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "test_access_token" + access_token: 'test_access_token', }, status: 200, statusText: 'OK', @@ -549,12 +549,12 @@ export const networkCallsData = [ }, httpRes: { data: { - "errors": [ + errors: [ { - "message": "Any 500 error", - "code": 502 - } - ] + message: 'Any 500 error', + code: 502, + }, + ], }, status: 200, statusText: 'OK', @@ -566,7 +566,7 @@ export const networkCallsData = [ method: 'GET', }, httpRes: { - data: "data \n data", + data: 'data \n data', status: 200, statusText: 'OK', }, @@ -577,7 +577,7 @@ export const networkCallsData = [ method: 'GET', }, httpRes: { - data: "data \n data", + data: 'data \n data', status: 200, statusText: 'OK', }, @@ -589,10 +589,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_success", - "expires_in": 3599, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -605,24 +605,24 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7fa1#17fd1da66fe", - "result": [ + requestId: '7fa1#17fd1da66fe', + result: [ { - "name": "API Lead", - "searchableFields": [["email"]], - "fields": [ + name: 'API Lead', + searchableFields: [['email']], + fields: [ { - "name": "email", - "displayName": "Email Address", - "dataType": "email", - "length": 255, - "updateable": true, - "crmManaged": false - } - ] - } + name: 'email', + displayName: 'Email Address', + dataType: 'email', + length: 255, + updateable: true, + crmManaged: false, + }, + ], + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -635,12 +635,12 @@ export const networkCallsData = [ }, httpRes: { data: { - "success": false, - "errors": [ + success: false, + errors: [ { - "code": 603 - } - ] + code: 603, + }, + ], }, status: 200, statusText: 'OK', @@ -653,10 +653,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_success", - "expires_in": 3599, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -669,24 +669,24 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7fa1#17fd1da66fe", - "result": [ + requestId: '7fa1#17fd1da66fe', + result: [ { - "name": "API Lead", - "searchableFields": [["email"]], - "fields": [ + name: 'API Lead', + searchableFields: [['email']], + fields: [ { - "name": "Email", - "displayName": "Email Address", - "dataType": "email", - "length": 255, - "updateable": true, - "crmManaged": false - } - ] - } + name: 'Email', + displayName: 'Email Address', + dataType: 'email', + length: 255, + updateable: true, + crmManaged: false, + }, + ], + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -699,12 +699,12 @@ export const networkCallsData = [ }, httpRes: { data: { - "success": false, - "errors": [ + success: false, + errors: [ { - "message": "There are 10 imports currently being processed. Please try again later" - } - ] + message: 'There are 10 imports currently being processed. Please try again later', + }, + ], }, status: 200, statusText: 'OK', @@ -717,24 +717,24 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7fa1#17fd1da66fe", - "result": [ + requestId: '7fa1#17fd1da66fe', + result: [ { - "name": "API Lead", - "searchableFields": [["email"]], - "fields": [ + name: 'API Lead', + searchableFields: [['email']], + fields: [ { - "name": "Email", - "displayName": "Email Address", - "dataType": "email", - "length": 255, - "updateable": true, - "crmManaged": false - } - ] - } + name: 'Email', + displayName: 'Email Address', + dataType: 'email', + length: 255, + updateable: true, + crmManaged: false, + }, + ], + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -747,12 +747,12 @@ export const networkCallsData = [ }, httpRes: { data: { - "success": false, - "errors": [ + success: false, + errors: [ { - "message": "Empty file" - } - ] + message: 'Empty file', + }, + ], }, status: 200, statusText: 'OK', @@ -765,24 +765,24 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7fa1#17fd1da66fe", - "result": [ + requestId: '7fa1#17fd1da66fe', + result: [ { - "name": "API Lead", - "searchableFields": [["email"]], - "fields": [ + name: 'API Lead', + searchableFields: [['email']], + fields: [ { - "name": "Email", - "displayName": "Email Address", - "dataType": "email", - "length": 255, - "updateable": true, - "crmManaged": false - } - ] - } + name: 'Email', + displayName: 'Email Address', + dataType: 'email', + length: 255, + updateable: true, + crmManaged: false, + }, + ], + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -795,12 +795,12 @@ export const networkCallsData = [ }, httpRes: { data: { - "success": false, - "errors": [ + success: false, + errors: [ { - "message": "Any other error" - } - ] + message: 'Any other error', + }, + ], }, status: 200, statusText: 'OK', @@ -813,10 +813,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_success", - "expires_in": 3599, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -829,9 +829,9 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "12093#17672aeaee6", - "result": [], - "success": true + requestId: '12093#17672aeaee6', + result: [], + success: true, }, status: 200, statusText: 'OK', @@ -844,14 +844,14 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "142e4#1835b117b76", - "success": false, - "errors": [ + requestId: '142e4#1835b117b76', + success: false, + errors: [ { - "code": "1006", - "message": "Lookup field 'userId' not found" - } - ] + code: '1006', + message: "Lookup field 'userId' not found", + }, + ], }, status: 200, statusText: 'OK', @@ -864,10 +864,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_success", - "expires_in": 3599, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -880,9 +880,9 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "12093#17672aeaee6", - "result": [], - "success": true + requestId: '12093#17672aeaee6', + result: [], + success: true, }, status: 200, statusText: 'OK', @@ -895,14 +895,14 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "142e4#1835b117b76", - "success": false, - "errors": [ + requestId: '142e4#1835b117b76', + success: false, + errors: [ { - "code": "random_marketo_code", - "message": "some other problem" - } - ] + code: 'random_marketo_code', + message: 'some other problem', + }, + ], }, status: 200, statusText: 'OK', @@ -915,10 +915,10 @@ export const networkCallsData = [ }, httpRes: { data: { - "access_token": "access_token_success", - "expires_in": 3599, - "scope": "integrations@rudderstack.com", - "token_type": "bearer" + access_token: 'access_token_success', + expires_in: 3599, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', }, status: 200, statusText: 'OK', @@ -931,14 +931,14 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "7ab2#17672a46a99", - "result": [ + requestId: '7ab2#17672a46a99', + result: [ { - "id": 4, - "status": "created" - } + id: 4, + status: 'created', + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', @@ -951,22 +951,22 @@ export const networkCallsData = [ }, httpRes: { data: { - "requestId": "12093#17672aeaee6", - "result": [ + requestId: '12093#17672aeaee6', + result: [ { - "createdAt": "2022-09-17T21:39:07Z", - "email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "firstName": "random_first", - "id": 4, - "lastName": "random_last", - "updatedAt": "2022-09-20T21:48:07Z", - "userId": "test-user-957ue" - } + createdAt: '2022-09-17T21:39:07Z', + email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + firstName: 'random_first', + id: 4, + lastName: 'random_last', + updatedAt: '2022-09-20T21:48:07Z', + userId: 'test-user-957ue', + }, ], - "success": true + success: true, }, status: 200, statusText: 'OK', }, - } + }, ]; diff --git a/test/integrations/destinations/marketo/router/data.ts b/test/integrations/destinations/marketo/router/data.ts index 327f470627..0fa79b77df 100644 --- a/test/integrations/destinations/marketo/router/data.ts +++ b/test/integrations/destinations/marketo/router/data.ts @@ -1,2140 +1,2132 @@ export const data = [ - { - name: 'marketo', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ + { + name: 'marketo', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: 'anon_id_success', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'TestAppName', + namespace: 'com.android.sample', + version: '1.0', + }, + device: { + id: 'anon_id_success', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.1-beta.1', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '8.1.0', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: 'anon_id_success', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)', + }, + event: 'Product Clicked', + integrations: { + All: true, + }, + messageId: 'id1', + properties: { + name: 'Test Product', + }, + originalTimestamp: '2020-12-17T21:00:59.176Z', + type: 'track', + sentAt: '2020-03-12T09:05:03.421Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + accountId: 'marketo_acct_id_success', + clientId: 'marketo_client_id_success', + clientSecret: 'marketo_client_secret_success', + trackAnonymousEvents: true, + customActivityPropertyMap: [ + { + from: 'name', + to: 'productName', + }, + ], + leadTraitMapping: [ + { + from: 'leadScore', + to: 'customLeadScore', + }, + ], + rudderEventsMapping: [ + { + event: 'Product Clicked', + marketoPrimarykey: 'name', + marketoActivityId: '100001', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, { - "message": { - "anonymousId": "anon_id_success", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "TestAppName", - "namespace": "com.android.sample", - "version": "1.0" - }, - "device": { - "id": "anon_id_success", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.1-beta.1" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "8.1.0" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "anon_id_success" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "id1", - "properties": { - "name": "Test Product" - }, - "originalTimestamp": "2020-12-17T21:00:59.176Z", - "type": "track", - "sentAt": "2020-03-12T09:05:03.421Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "accountId": "marketo_acct_id_success", - "clientId": "marketo_client_id_success", - "clientSecret": "marketo_client_secret_success", - "trackAnonymousEvents": true, - "customActivityPropertyMap": [ - { - "from": "name", - "to": "productName" - } - ], - "leadTraitMapping": [ - { - "from": "leadScore", - "to": "customLeadScore" - } - ], - "rudderEventsMapping": [ - { - "event": "Product Clicked", - "marketoPrimarykey": "name", - "marketoActivityId": "100001" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "anonymousId": "anon_id_success", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "TestAppName", - "namespace": "com.android.sample", - "version": "1.0" - }, - "device": { - "id": "anon_id_success", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.1-beta.1" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "8.1.0" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "anon_id_success" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "id1", - "properties": { - "name": "Test Product", - "product_id": "prod_1" - }, - "originalTimestamp": "2020-12-17T21:00:59.176Z", - "type": "track", - "sentAt": "2020-12-17T21:00:59.176Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "accountId": "marketo_acct_id_success", - "clientId": "marketo_client_id_success", - "clientSecret": "marketo_client_secret_success", - "trackAnonymousEvents": true, - "customActivityPropertyMap": [ - { - "from": "name", - "to": "productName" - } - ], - "leadTraitMapping": [ - { - "from": "leadScore", - "to": "customLeadScore" - } - ], - "rudderEventsMapping": [ - { - "event": "Product Clicked", - "marketoPrimarykey": "name", - "marketoActivityId": "100001" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "type": "identify", - "sentAt": "2022-09-19T10:34:02.002Z", - "userId": "e17c5a5e-5e2f-430b-b497-fe3f1ea3a704", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "2.12.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://accounts.app.t2.broken.com/home", - "path": "/home", - "title": "Home", - "search": "", - "tab_url": "https://accounts.app.t2.broken.com/home", - "referrer": "https://ts50-cvii.core.broken.org/", - "initial_referrer": "https://ts50-cvii.core.broken.org/", - "referring_domain": "ts50-cvii.core.broken.org", - "initial_referring_domain": "ts50-cvii.core.broken.org" - }, - "locale": "en-IN", - "screen": { - "width": 1728, - "height": 1117, - "density": 2, - "innerWidth": 1728, - "innerHeight": 969 - }, - "traits": { - "name": "AM", - "email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "lastName": "M", - "firstName": "A", - "accountName": "MACDEV", - "billingName": "g g", - "companyName": "macDev", - "currentTier": "Webinar Pro 250", - "billingCycle": "Annually", - "lastBillingDate": "2022-06-29T09:40:42.000Z", - "nextBillingDate": "2023-09-09T04:00:00.000Z", - "subscriptionType": "Webinar Pro 250", - "subscriptionStatus": "ACTIVE", - "lastWebinarEventDate": "2022-09-15T20:00:00.000Z", - "nextWebinarEventDate": "2022-09-16T06:15:00.000Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.12.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" - }, - "rudderId": "73dc83ef-587f-4077-90f3-c36083e64019", - "messageId": "1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007", - "timestamp": "2022-09-19T10:34:02.954Z", - "receivedAt": "2022-09-19T10:34:02.956Z", - "request_ip": "11.105.44.120", - "anonymousId": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-09-19T10:34:02.000Z" - }, - "destination": { - "Config": { - "accountId": "valid_account_broken_event", - "clientId": "504300cd-76b2-a7l4-bhle-90a07420nx73", - "clientSecret": "3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd", - "trackAnonymousEvents": false, - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "acq_signup_completed", - "marketoActivityId": "100026" - }, - { - "event": "act_createwebinarform_submit", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_style", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_view", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_join", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_addteammember", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_discussions_savediscussion", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_networking_savetime", - "marketoActivityId": "100025" - } - ] - }, - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmMd", - "deleted": false, - "createdAt": "2022-02-10T08:39:32.005Z", - "updatedAt": "2022-09-03T16:22:31.374Z", - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 3 - } - }, - { - "message": { - "type": "identify", - "sentAt": "2022-09-19T10:34:02.002Z", - "userId": "e17c5a5e-5e2f-430b-b497-fe3f1ea3a704", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "2.12.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://accounts.app.t2.broken.com/home", - "path": "/home", - "title": "Home", - "search": "", - "tab_url": "https://accounts.app.t2.broken.com/home", - "referrer": "https://ts50-cvii.core.broken.org/", - "initial_referrer": "https://ts50-cvii.core.broken.org/", - "referring_domain": "ts50-cvii.core.broken.org", - "initial_referring_domain": "ts50-cvii.core.broken.org" - }, - "locale": "en-IN", - "screen": { - "width": 1728, - "height": 1117, - "density": 2, - "innerWidth": 1728, - "innerHeight": 969 - }, - "traits": { - "name": "AM", - "email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "lastName": "M", - "firstName": "A", - "accountName": "MACDEV", - "billingName": "g g", - "companyName": "macDev", - "currentTier": "Webinar Pro 250", - "billingCycle": "Annually", - "lastBillingDate": "2022-06-29T09:40:42.000Z", - "nextBillingDate": "2023-09-09T04:00:00.000Z", - "subscriptionType": "Webinar Pro 250", - "subscriptionStatus": "ACTIVE", - "lastWebinarEventDate": "2022-09-15T20:00:00.000Z", - "nextWebinarEventDate": "2022-09-16T06:15:00.000Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.12.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" - }, - "rudderId": "73dc83ef-587f-4077-90f3-c36083e64019", - "messageId": "1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007", - "timestamp": "2022-09-19T10:34:02.954Z", - "receivedAt": "2022-09-19T10:34:02.956Z", - "request_ip": "11.105.44.120", - "anonymousId": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-09-19T10:34:02.000Z" - }, - "destination": { - "Config": { - "accountId": "unhandled_status_code", - "clientId": "504300cd-76b2-a7l4-bhle-90a07420nx73", - "clientSecret": "3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd", - "trackAnonymousEvents": false, - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "acq_signup_completed", - "marketoActivityId": "100026" - }, - { - "event": "act_createwebinarform_submit", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_style", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_view", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_join", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_addteammember", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_discussions_savediscussion", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_networking_savetime", - "marketoActivityId": "100025" - } - ] - }, - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmMd", - "deleted": false, - "createdAt": "2022-02-10T08:39:32.005Z", - "updatedAt": "2022-09-03T16:22:31.374Z", - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 4 - } - }, - { - "message": { - "type": "identify", - "sentAt": "2022-09-19T10:34:02.002Z", - "userId": "e17c5a5e-5e2f-430b-b497-fe3f1ea3a704", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "2.12.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://accounts.app.t2.broken.com/home", - "path": "/home", - "title": "Home", - "search": "", - "tab_url": "https://accounts.app.t2.broken.com/home", - "referrer": "https://ts50-cvii.core.broken.org/", - "initial_referrer": "https://ts50-cvii.core.broken.org/", - "referring_domain": "ts50-cvii.core.broken.org", - "initial_referring_domain": "ts50-cvii.core.broken.org" - }, - "locale": "en-IN", - "screen": { - "width": 1728, - "height": 1117, - "density": 2, - "innerWidth": 1728, - "innerHeight": 969 - }, - "traits": { - "name": "AM", - "email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "lastName": "M", - "firstName": "A", - "accountName": "MACDEV", - "billingName": "g g", - "companyName": "macDev", - "currentTier": "Webinar Pro 250", - "billingCycle": "Annually", - "lastBillingDate": "2022-06-29T09:40:42.000Z", - "nextBillingDate": "2023-09-09T04:00:00.000Z", - "subscriptionType": "Webinar Pro 250", - "subscriptionStatus": "ACTIVE", - "lastWebinarEventDate": "2022-09-15T20:00:00.000Z", - "nextWebinarEventDate": "2022-09-16T06:15:00.000Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.12.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" - }, - "rudderId": "73dc83ef-587f-4077-90f3-c36083e64019", - "messageId": "1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007", - "timestamp": "2022-09-19T10:34:02.954Z", - "receivedAt": "2022-09-19T10:34:02.956Z", - "request_ip": "11.105.44.120", - "anonymousId": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-09-19T10:34:02.000Z" - }, - "destination": { - "Config": { - "accountId": "successful_identify_transformation", - "clientId": "504300cd-76b2-a7l4-bhle-90a07420nx73", - "clientSecret": "3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd", - "trackAnonymousEvents": false, - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "acq_signup_completed", - "marketoActivityId": "100026" - }, - { - "event": "act_createwebinarform_submit", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_style", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_view", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_join", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_addteammember", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_discussions_savediscussion", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_networking_savetime", - "marketoActivityId": "100025" - } - ] - }, - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmMd", - "deleted": false, - "createdAt": "2022-02-10T08:39:32.005Z", - "updatedAt": "2022-09-03T16:22:31.374Z", - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 5 - } - } + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + anonymousId: 'anon_id_success', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'TestAppName', + namespace: 'com.android.sample', + version: '1.0', + }, + device: { + id: 'anon_id_success', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.1-beta.1', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '8.1.0', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: 'anon_id_success', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)', + }, + event: 'Product Clicked', + integrations: { + All: true, + }, + messageId: 'id1', + properties: { + name: 'Test Product', + product_id: 'prod_1', + }, + originalTimestamp: '2020-12-17T21:00:59.176Z', + type: 'track', + sentAt: '2020-12-17T21:00:59.176Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + accountId: 'marketo_acct_id_success', + clientId: 'marketo_client_id_success', + clientSecret: 'marketo_client_secret_success', + trackAnonymousEvents: true, + customActivityPropertyMap: [ + { + from: 'name', + to: 'productName', + }, + ], + leadTraitMapping: [ + { + from: 'leadScore', + to: 'customLeadScore', + }, + ], + rudderEventsMapping: [ + { + event: 'Product Clicked', + marketoPrimarykey: 'name', + marketoActivityId: '100001', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', ], - destType: 'marketo', + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', }, - method: 'POST', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, }, - }, - output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer access_token_success" - }, - "params": {}, - "body": { - "JSON": { - "input": [ - { - "activityDate": "2020-12-17T21:00:59.176Z", - "activityTypeId": 100001, - "attributes": [], - "leadId": 4, - "primaryAttributeValue": "Test Product" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - }, - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "accountId": "marketo_acct_id_success", - "clientId": "marketo_client_id_success", - "clientSecret": "marketo_client_secret_success", - "trackAnonymousEvents": true, - "customActivityPropertyMap": [ - { - "from": "name", - "to": "productName" - } - ], - "leadTraitMapping": [ - { - "from": "leadScore", - "to": "customLeadScore" - } - ], - "rudderEventsMapping": [ - { - "event": "Product Clicked", - "marketoPrimarykey": "name", - "marketoActivityId": "100001" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer access_token_success" - }, - "params": {}, - "body": { - "JSON": { - "input": [ - { - "activityDate": "2020-12-17T21:00:59.176Z", - "activityTypeId": 100001, - "attributes": [], - "leadId": 4, - "primaryAttributeValue": "Test Product" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - }, - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "accountId": "marketo_acct_id_success", - "clientId": "marketo_client_id_success", - "clientSecret": "marketo_client_secret_success", - "trackAnonymousEvents": true, - "customActivityPropertyMap": [ - { - "from": "name", - "to": "productName" - } - ], - "leadTraitMapping": [ - { - "from": "leadScore", - "to": "customLeadScore" - } - ], - "rudderEventsMapping": [ - { - "event": "Product Clicked", - "marketoPrimarykey": "name", - "marketoActivityId": "100001" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batched": false, - "statusCode": 400, - "error": "{\"message\":\"Request Failed for marketo, Lookup field 'userId' not found (Aborted).[Marketo Transformer]: During lead look up using email\",\"destinationResponse\":{\"response\":{\"requestId\":\"142e4#1835b117b76\",\"success\":false,\"errors\":[{\"code\":\"1006\",\"message\":\"Lookup field 'userId' not found\"}]},\"status\":200}}", - "statTags": { - "errorCategory": "network", - "errorType": "aborted" - }, - "metadata": [ - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - }, - "jobId": 3 - } - ], - "destination": { - "Config": { - "accountId": "valid_account_broken_event", - "clientId": "504300cd-76b2-a7l4-bhle-90a07420nx73", - "clientSecret": "3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd", - "trackAnonymousEvents": false, - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "acq_signup_completed", - "marketoActivityId": "100026" - }, - { - "event": "act_createwebinarform_submit", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_style", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_view", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_join", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_addteammember", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_discussions_savediscussion", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_networking_savetime", - "marketoActivityId": "100025" - } - ] - }, - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmMd", - "deleted": false, - "createdAt": "2022-02-10T08:39:32.005Z", - "updatedAt": "2022-09-03T16:22:31.374Z", - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batched": false, - "statusCode": 400, - "error": "{\"message\":\"Error occurred [Marketo Transformer]: During lead look up using email -> some other problem\",\"destinationResponse\":{\"response\":{\"requestId\":\"142e4#1835b117b76\",\"success\":false,\"errors\":[{\"code\":\"random_marketo_code\",\"message\":\"some other problem\"}]},\"status\":200}}", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "meta": "unhandledStatusCode" - }, - "destination": { - "Config": { - "accountId": "unhandled_status_code", - "clientId": "504300cd-76b2-a7l4-bhle-90a07420nx73", - "clientSecret": "3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd", - "trackAnonymousEvents": false, - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "acq_signup_completed", - "marketoActivityId": "100026" - }, - { - "event": "act_createwebinarform_submit", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_style", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_view", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_join", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_addteammember", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_discussions_savediscussion", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_networking_savetime", - "marketoActivityId": "100025" - } - ] - }, - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmMd", - "deleted": false, - "createdAt": "2022-02-10T08:39:32.005Z", - "updatedAt": "2022-09-03T16:22:31.374Z", - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": [ - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - }, - "jobId": 4 - } - ] - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://successful_identify_transformation.mktorest.com/rest/v1/leads.json", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer access_token_success" - }, - "params": {}, - "body": { - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "Email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "FirstName": "A", - "LastName": "M", - "id": 4, - "userId": "e17c5a5e-5e2f-430b-b497-fe3f1ea3a704" - } - ], - "lookupField": "id" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - }, - "jobId": 5 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "accountId": "successful_identify_transformation", - "clientId": "504300cd-76b2-a7l4-bhle-90a07420nx73", - "clientSecret": "3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd", - "trackAnonymousEvents": false, - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "acq_signup_completed", - "marketoActivityId": "100026" - }, - { - "event": "act_createwebinarform_submit", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_style", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_view", - "marketoActivityId": "100025" - }, - { - "event": "act_webinar_join", - "marketoActivityId": "100025" - }, - { - "event": "act_presentation_addteammember", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_discussions_savediscussion", - "marketoActivityId": "100025" - }, - { - "event": "act_engagement_networking_savetime", - "marketoActivityId": "100025" - } - ] - }, - "destinationDefinition": { - "config": { - "destConfig": { - "defaultConfig": [ - "accountId", - "clientId", - "clientSecret", - "trackAnonymousEvents", - "rudderEventsMapping", - "customActivityPropertyMap", - "leadTraitMapping" - ] - }, - "secretKeys": [ - "clientSecret" - ], - "excludeKeys": [], - "includeKeys": [], - "routerTransform": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative" - ] - }, - "responseRules": { - "responseType": "JSON", - "rules": { - "retryable": [ - { - "success": "false", - "errors.0.code": 600 - }, - { - "success": "false", - "errors.0.code": 601 - }, - { - "success": "false", - "errors.0.code": 602 - }, - { - "success": "false", - "errors.0.code": 604 - }, - { - "success": "false", - "errors.0.code": 606 - }, - { - "success": "false", - "errors.0.code": 607 - }, - { - "success": "false", - "errors.0.code": 608 - }, - { - "success": "false", - "errors.0.code": 611 - } - ], - "abortable": [ - { - "success": "false", - "errors.0.code": 603 - }, - { - "success": "false", - "errors.0.code": 605 - }, - { - "success": "false", - "errors.0.code": 609 - }, - { - "success": "false", - "errors.0.code": 610 - } - ] - } - }, - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "MARKETO", - "displayName": "Marketo", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVke", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmMd", - "deleted": false, - "createdAt": "2022-02-10T08:39:32.005Z", - "updatedAt": "2022-09-03T16:22:31.374Z", - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } + { + message: { + type: 'identify', + sentAt: '2022-09-19T10:34:02.002Z', + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '2.12.1', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'https://accounts.app.t2.broken.com/home', + path: '/home', + title: 'Home', + search: '', + tab_url: 'https://accounts.app.t2.broken.com/home', + referrer: 'https://ts50-cvii.core.broken.org/', + initial_referrer: 'https://ts50-cvii.core.broken.org/', + referring_domain: 'ts50-cvii.core.broken.org', + initial_referring_domain: 'ts50-cvii.core.broken.org', + }, + locale: 'en-IN', + screen: { + width: 1728, + height: 1117, + density: 2, + innerWidth: 1728, + innerHeight: 969, + }, + traits: { + name: 'AM', + email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + lastName: 'M', + firstName: 'A', + accountName: 'MACDEV', + billingName: 'g g', + companyName: 'macDev', + currentTier: 'Webinar Pro 250', + billingCycle: 'Annually', + lastBillingDate: '2022-06-29T09:40:42.000Z', + nextBillingDate: '2023-09-09T04:00:00.000Z', + subscriptionType: 'Webinar Pro 250', + subscriptionStatus: 'ACTIVE', + lastWebinarEventDate: '2022-09-15T20:00:00.000Z', + nextWebinarEventDate: '2022-09-16T06:15:00.000Z', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.12.1', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + rudderId: '73dc83ef-587f-4077-90f3-c36083e64019', + messageId: '1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007', + timestamp: '2022-09-19T10:34:02.954Z', + receivedAt: '2022-09-19T10:34:02.956Z', + request_ip: '11.105.44.120', + anonymousId: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040', + integrations: { + All: true, + }, + originalTimestamp: '2022-09-19T10:34:02.000Z', + }, + destination: { + Config: { + accountId: 'valid_account_broken_event', + clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', + clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + trackAnonymousEvents: false, + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'acq_signup_completed', + marketoActivityId: '100026', + }, + { + event: 'act_createwebinarform_submit', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_style', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_view', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_join', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_addteammember', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_discussions_savediscussion', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_networking_savetime', + marketoActivityId: '100025', + }, + ], + }, + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd', + deleted: false, + createdAt: '2022-02-10T08:39:32.005Z', + updatedAt: '2022-09-03T16:22:31.374Z', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 3, + }, + }, + { + message: { + type: 'identify', + sentAt: '2022-09-19T10:34:02.002Z', + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '2.12.1', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'https://accounts.app.t2.broken.com/home', + path: '/home', + title: 'Home', + search: '', + tab_url: 'https://accounts.app.t2.broken.com/home', + referrer: 'https://ts50-cvii.core.broken.org/', + initial_referrer: 'https://ts50-cvii.core.broken.org/', + referring_domain: 'ts50-cvii.core.broken.org', + initial_referring_domain: 'ts50-cvii.core.broken.org', + }, + locale: 'en-IN', + screen: { + width: 1728, + height: 1117, + density: 2, + innerWidth: 1728, + innerHeight: 969, + }, + traits: { + name: 'AM', + email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + lastName: 'M', + firstName: 'A', + accountName: 'MACDEV', + billingName: 'g g', + companyName: 'macDev', + currentTier: 'Webinar Pro 250', + billingCycle: 'Annually', + lastBillingDate: '2022-06-29T09:40:42.000Z', + nextBillingDate: '2023-09-09T04:00:00.000Z', + subscriptionType: 'Webinar Pro 250', + subscriptionStatus: 'ACTIVE', + lastWebinarEventDate: '2022-09-15T20:00:00.000Z', + nextWebinarEventDate: '2022-09-16T06:15:00.000Z', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.12.1', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + rudderId: '73dc83ef-587f-4077-90f3-c36083e64019', + messageId: '1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007', + timestamp: '2022-09-19T10:34:02.954Z', + receivedAt: '2022-09-19T10:34:02.956Z', + request_ip: '11.105.44.120', + anonymousId: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040', + integrations: { + All: true, + }, + originalTimestamp: '2022-09-19T10:34:02.000Z', + }, + destination: { + Config: { + accountId: 'unhandled_status_code', + clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', + clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + trackAnonymousEvents: false, + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'acq_signup_completed', + marketoActivityId: '100026', + }, + { + event: 'act_createwebinarform_submit', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_style', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_view', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_join', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_addteammember', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_discussions_savediscussion', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_networking_savetime', + marketoActivityId: '100025', + }, + ], + }, + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd', + deleted: false, + createdAt: '2022-02-10T08:39:32.005Z', + updatedAt: '2022-09-03T16:22:31.374Z', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 4, + }, + }, + { + message: { + type: 'identify', + sentAt: '2022-09-19T10:34:02.002Z', + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '2.12.1', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'https://accounts.app.t2.broken.com/home', + path: '/home', + title: 'Home', + search: '', + tab_url: 'https://accounts.app.t2.broken.com/home', + referrer: 'https://ts50-cvii.core.broken.org/', + initial_referrer: 'https://ts50-cvii.core.broken.org/', + referring_domain: 'ts50-cvii.core.broken.org', + initial_referring_domain: 'ts50-cvii.core.broken.org', + }, + locale: 'en-IN', + screen: { + width: 1728, + height: 1117, + density: 2, + innerWidth: 1728, + innerHeight: 969, + }, + traits: { + name: 'AM', + email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + lastName: 'M', + firstName: 'A', + accountName: 'MACDEV', + billingName: 'g g', + companyName: 'macDev', + currentTier: 'Webinar Pro 250', + billingCycle: 'Annually', + lastBillingDate: '2022-06-29T09:40:42.000Z', + nextBillingDate: '2023-09-09T04:00:00.000Z', + subscriptionType: 'Webinar Pro 250', + subscriptionStatus: 'ACTIVE', + lastWebinarEventDate: '2022-09-15T20:00:00.000Z', + nextWebinarEventDate: '2022-09-16T06:15:00.000Z', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.12.1', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + rudderId: '73dc83ef-587f-4077-90f3-c36083e64019', + messageId: '1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007', + timestamp: '2022-09-19T10:34:02.954Z', + receivedAt: '2022-09-19T10:34:02.956Z', + request_ip: '11.105.44.120', + anonymousId: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040', + integrations: { + All: true, + }, + originalTimestamp: '2022-09-19T10:34:02.000Z', + }, + destination: { + Config: { + accountId: 'successful_identify_transformation', + clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', + clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + trackAnonymousEvents: false, + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'acq_signup_completed', + marketoActivityId: '100026', + }, + { + event: 'act_createwebinarform_submit', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_style', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_view', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_join', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_addteammember', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_discussions_savediscussion', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_networking_savetime', + marketoActivityId: '100025', + }, + ], + }, + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd', + deleted: false, + createdAt: '2022-02-10T08:39:32.005Z', + updatedAt: '2022-09-03T16:22:31.374Z', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 5, + }, }, + ], + destType: 'marketo', }, + method: 'POST', + }, }, - { - name: 'marketo', - description: 'processMetadataForRouter function specific test', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer access_token_success', + }, + params: {}, + body: { + JSON: { + input: [ + { + activityDate: '2020-12-17T21:00:59.176Z', + activityTypeId: 100001, + attributes: [], + leadId: 4, + primaryAttributeValue: 'Test Product', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + destInfo: { + authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + }, + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + accountId: 'marketo_acct_id_success', + clientId: 'marketo_client_id_success', + clientSecret: 'marketo_client_secret_success', + trackAnonymousEvents: true, + customActivityPropertyMap: [ + { + from: 'name', + to: 'productName', + }, + ], + leadTraitMapping: [ + { + from: 'leadScore', + to: 'customLeadScore', + }, + ], + rudderEventsMapping: [ + { + event: 'Product Clicked', + marketoPrimarykey: 'name', + marketoActivityId: '100001', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer access_token_success', + }, + params: {}, body: { + JSON: { input: [ + { + activityDate: '2020-12-17T21:00:59.176Z', + activityTypeId: 100001, + attributes: [], + leadId: 4, + primaryAttributeValue: 'Test Product', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + destInfo: { + authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + }, + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + accountId: 'marketo_acct_id_success', + clientId: 'marketo_client_id_success', + clientSecret: 'marketo_client_secret_success', + trackAnonymousEvents: true, + customActivityPropertyMap: [ + { + from: 'name', + to: 'productName', + }, + ], + leadTraitMapping: [ + { + from: 'leadScore', + to: 'customLeadScore', + }, + ], + rudderEventsMapping: [ + { + event: 'Product Clicked', + marketoPrimarykey: 'name', + marketoActivityId: '100001', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, { - "message": { - "anonymousId": "anon_id_success", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "TestAppName", - "namespace": "com.android.sample", - "version": "1.0" - }, - "device": { - "id": "anon_id_success", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.1-beta.1" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "8.1.0" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "anon_id_success" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "id1", - "properties": { - "name": "Test Product", - "product_id": "prod_1" - }, - "originalTimestamp": "2020-12-17T21:00:59.176Z", - "type": "track", - "sentAt": "2020-12-17T21:00:59.176Z" - }, - "destination": { - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "Config": { - "accountId": "marketo_acct_id_success", - "clientId": "marketo_client_id_success", - "clientSecret": "marketo_client_secret_success", - "trackAnonymousEvents": true, - "customActivityPropertyMap": [ - { - "from": "name", - "to": "productName" - }, - { - "from": "product_id", - "to": "productId" - } - ], - "leadTraitMapping": [ - { - "from": "leadScore", - "to": "customLeadScore" - } - ], - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "Product Clicked", - "marketoPrimarykey": "name", - "marketoActivityId": "100001" - } - ] - } - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 1 - }, - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - } + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batched: false, + statusCode: 400, + error: + '{"message":"Request Failed for marketo, Lookup field \'userId\' not found (Aborted).[Marketo Transformer]: During lead look up using email","destinationResponse":{"response":{"requestId":"142e4#1835b117b76","success":false,"errors":[{"code":"1006","message":"Lookup field \'userId\' not found"}]},"status":200}}', + statTags: { + errorCategory: 'network', + errorType: 'aborted', + }, + metadata: [ + { + destInfo: { + authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + }, + jobId: 3, + }, + ], + destination: { + Config: { + accountId: 'valid_account_broken_event', + clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', + clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + trackAnonymousEvents: false, + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'acq_signup_completed', + marketoActivityId: '100026', + }, + { + event: 'act_createwebinarform_submit', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_style', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_view', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_join', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_addteammember', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_discussions_savediscussion', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_networking_savetime', + marketoActivityId: '100025', + }, + ], + }, + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', ], - destType: 'marketo', + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd', + deleted: false, + createdAt: '2022-02-10T08:39:32.005Z', + updatedAt: '2022-09-03T16:22:31.374Z', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batched: false, + statusCode: 400, + error: + '{"message":"Error occurred [Marketo Transformer]: During lead look up using email -> some other problem","destinationResponse":{"response":{"requestId":"142e4#1835b117b76","success":false,"errors":[{"code":"random_marketo_code","message":"some other problem"}]},"status":200}}', + statTags: { + errorCategory: 'network', + errorType: 'aborted', + meta: 'unhandledStatusCode', + }, + destination: { + Config: { + accountId: 'unhandled_status_code', + clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', + clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + trackAnonymousEvents: false, + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'acq_signup_completed', + marketoActivityId: '100026', + }, + { + event: 'act_createwebinarform_submit', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_style', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_view', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_join', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_addteammember', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_discussions_savediscussion', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_networking_savetime', + marketoActivityId: '100025', + }, + ], + }, + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd', + deleted: false, + createdAt: '2022-02-10T08:39:32.005Z', + updatedAt: '2022-09-03T16:22:31.374Z', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: [ + { + destInfo: { + authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + }, + jobId: 4, }, + ], + }, + { + batchedRequest: { + version: '1', + type: 'REST', method: 'POST', + endpoint: + 'https://successful_identify_transformation.mktorest.com/rest/v1/leads.json', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer access_token_success', + }, + params: {}, + body: { + JSON: { + action: 'createOrUpdate', + input: [ + { + Email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + FirstName: 'A', + LastName: 'M', + id: 4, + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + }, + ], + lookupField: 'id', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + destInfo: { + authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + }, + jobId: 5, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + accountId: 'successful_identify_transformation', + clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', + clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + trackAnonymousEvents: false, + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'acq_signup_completed', + marketoActivityId: '100026', + }, + { + event: 'act_createwebinarform_submit', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_style', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_view', + marketoActivityId: '100025', + }, + { + event: 'act_webinar_join', + marketoActivityId: '100025', + }, + { + event: 'act_presentation_addteammember', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_discussions_savediscussion', + marketoActivityId: '100025', + }, + { + event: 'act_engagement_networking_savetime', + marketoActivityId: '100025', + }, + ], + }, + destinationDefinition: { + config: { + destConfig: { + defaultConfig: [ + 'accountId', + 'clientId', + 'clientSecret', + 'trackAnonymousEvents', + 'rudderEventsMapping', + 'customActivityPropertyMap', + 'leadTraitMapping', + ], + }, + secretKeys: ['clientSecret'], + excludeKeys: [], + includeKeys: [], + routerTransform: true, + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + responseRules: { + responseType: 'JSON', + rules: { + retryable: [ + { + success: 'false', + 'errors.0.code': 600, + }, + { + success: 'false', + 'errors.0.code': 601, + }, + { + success: 'false', + 'errors.0.code': 602, + }, + { + success: 'false', + 'errors.0.code': 604, + }, + { + success: 'false', + 'errors.0.code': 606, + }, + { + success: 'false', + 'errors.0.code': 607, + }, + { + success: 'false', + 'errors.0.code': 608, + }, + { + success: 'false', + 'errors.0.code': 611, + }, + ], + abortable: [ + { + success: 'false', + 'errors.0.code': 603, + }, + { + success: 'false', + 'errors.0.code': 605, + }, + { + success: 'false', + 'errors.0.code': 609, + }, + { + success: 'false', + 'errors.0.code': 610, + }, + ], + }, + }, + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'MARKETO', + displayName: 'Marketo', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke', + name: 'Marketo', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd', + deleted: false, + createdAt: '2022-02-10T08:39:32.005Z', + updatedAt: '2022-09-03T16:22:31.374Z', + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + }, + }, + { + name: 'marketo', + description: 'processMetadataForRouter function specific test', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: 'anon_id_success', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'TestAppName', + namespace: 'com.android.sample', + version: '1.0', + }, + device: { + id: 'anon_id_success', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.1-beta.1', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '8.1.0', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: 'anon_id_success', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)', + }, + event: 'Product Clicked', + integrations: { + All: true, + }, + messageId: 'id1', + properties: { + name: 'Test Product', + product_id: 'prod_1', + }, + originalTimestamp: '2020-12-17T21:00:59.176Z', + type: 'track', + sentAt: '2020-12-17T21:00:59.176Z', + }, + destination: { + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + Config: { + accountId: 'marketo_acct_id_success', + clientId: 'marketo_client_id_success', + clientSecret: 'marketo_client_secret_success', + trackAnonymousEvents: true, + customActivityPropertyMap: [ + { + from: 'name', + to: 'productName', + }, + { + from: 'product_id', + to: 'productId', + }, + ], + leadTraitMapping: [ + { + from: 'leadScore', + to: 'customLeadScore', + }, + ], + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'Product Clicked', + marketoPrimarykey: 'name', + marketoActivityId: '100001', + }, + ], + }, + }, + metadata: [ + { + jobId: 1, + }, + { + jobId: 1, + }, + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, }, + ], + destType: 'marketo', }, - output: { - response: { - status: 200, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', + headers: { + Authorization: 'Bearer access_token_success', + 'Content-Type': 'application/json', + }, + params: {}, body: { - "output": [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json", - "headers": { - "Authorization": "Bearer access_token_success", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "input": [ - { - "activityDate": "2020-12-17T21:00:59.176Z", - "activityTypeId": 100001, - "attributes": [ - { - "name": "productId", - "value": "prod_1" - } - ], - "leadId": 4, - "primaryAttributeValue": "Test Product" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - [ - { - "jobId": 1 - }, - { - "jobId": 1 - }, - { - "jobId": 1 - } - ] - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "Config": { - "accountId": "marketo_acct_id_success", - "clientId": "marketo_client_id_success", - "clientSecret": "marketo_client_secret_success", - "trackAnonymousEvents": true, - "customActivityPropertyMap": [ - { - "from": "name", - "to": "productName" - }, - { - "from": "product_id", - "to": "productId" - } - ], - "leadTraitMapping": [ - { - "from": "leadScore", - "to": "customLeadScore" - } - ], - "createIfNotExist": true, - "rudderEventsMapping": [ - { - "event": "Product Clicked", - "marketoPrimarykey": "name", - "marketoActivityId": "100001" - } - ] - } - } - } + JSON: { + input: [ + { + activityDate: '2020-12-17T21:00:59.176Z', + activityTypeId: 100001, + attributes: [ + { + name: 'productId', + value: 'prod_1', + }, + ], + leadId: 4, + primaryAttributeValue: 'Test Product', + }, ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, + files: {}, + }, + metadata: [ + [ + { + jobId: 1, + }, + { + jobId: 1, + }, + { + jobId: 1, + }, + ], + ], + batched: false, + statusCode: 200, + destination: { + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + Config: { + accountId: 'marketo_acct_id_success', + clientId: 'marketo_client_id_success', + clientSecret: 'marketo_client_secret_success', + trackAnonymousEvents: true, + customActivityPropertyMap: [ + { + from: 'name', + to: 'productName', + }, + { + from: 'product_id', + to: 'productId', + }, + ], + leadTraitMapping: [ + { + from: 'leadScore', + to: 'customLeadScore', + }, + ], + createIfNotExist: true, + rudderEventsMapping: [ + { + event: 'Product Clicked', + marketoPrimarykey: 'name', + marketoActivityId: '100001', + }, + ], + }, + }, }, + ], }, - } + }, + }, + }, ]; diff --git a/test/integrations/destinations/monday/network.ts b/test/integrations/destinations/monday/network.ts new file mode 100644 index 0000000000..f23b9061f8 --- /dev/null +++ b/test/integrations/destinations/monday/network.ts @@ -0,0 +1,242 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.monday.com/v2', + method: 'POST', + headers: { + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + }, + }, + httpRes: { + data: { + data: { + boards: [ + { + name: 'Planning', + columns: [ + { + id: 'name', + title: 'Name', + type: 'name', + description: null, + settings_str: '{}', + }, + { + id: 'subitems', + title: 'Subitems', + type: 'subtasks', + description: null, + settings_str: + '{"allowMultipleItems":true,"itemTypeName":"column.subtasks.title","displayType":"BOARD_INLINE","boardIds":[3160974974]}', + }, + { + id: 'person', + title: 'Person', + type: 'multiple-person', + description: null, + settings_str: '{}', + }, + { + id: 'status', + title: 'Status', + type: 'color', + description: null, + settings_str: + '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_positions_v2":{"0":0,"1":2,"2":1,"5":3},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + }, + { + id: 'date4', + title: 'Date', + type: 'date', + description: null, + settings_str: '{}', + }, + { + id: 'checkbox', + title: 'Checkbox', + type: 'boolean', + description: null, + settings_str: '{}', + }, + { + id: 'connect_boards', + title: 'Connect boards', + type: 'board-relation', + description: null, + settings_str: '{"allowCreateReflectionColumn":false}', + }, + { + id: 'status_1', + title: 'Other', + type: 'color', + description: null, + settings_str: + '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + }, + { + id: 'date_1', + title: 'Date 1', + type: 'date', + description: null, + settings_str: '{"hide_footer":false}', + }, + { + id: 'status_12', + title: 'new status', + type: 'color', + description: null, + settings_str: + '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + }, + { + id: 'numbers', + title: 'Numbers', + type: 'numeric', + description: null, + settings_str: '{}', + }, + { + id: 'text', + title: 'Name', + type: 'text', + description: null, + settings_str: '{}', + }, + { + id: 'country', + title: 'Country', + type: 'country', + description: null, + settings_str: '{}', + }, + { + id: 'dropdown', + title: 'Dropdown', + type: 'dropdown', + description: null, + settings_str: + '{"hide_footer":false,"labels":[{"id":1,"name":"dropdown"},{"id":2,"name":"dropup"}]}', + }, + { + id: 'email', + title: 'Email', + type: 'email', + description: null, + settings_str: '{}', + }, + { + id: 'location', + title: 'Location', + type: 'location', + description: null, + settings_str: '{}', + }, + { + id: 'phone', + title: 'Phone', + type: 'phone', + description: null, + settings_str: '{}', + }, + { + id: 'rating', + title: 'Rating', + type: 'rating', + description: null, + settings_str: '{}', + }, + { + id: 'timeline', + title: 'Timeline', + type: 'timerange', + description: null, + settings_str: '{"hide_footer":false}', + }, + { + id: 'dependent_on', + title: 'Dependent On', + type: 'dependency', + description: + 'Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically', + settings_str: + '{"boardIds":[3142482015],"dependencyNewInfra":true,"allowMultipleItems":true}', + }, + { + id: 'long_text', + title: 'Long Text', + type: 'long-text', + description: null, + settings_str: '{}', + }, + { + id: 'link', + title: 'Link', + type: 'link', + description: null, + settings_str: '{}', + }, + { + id: 'tags', + title: 'Tags', + type: 'tag', + description: null, + settings_str: '{"hide_footer":false}', + }, + { + id: 'label', + title: 'Label', + type: 'color', + description: '', + settings_str: + '{"done_colors":[1],"labels":{"3":"Label 2","105":"Label 1","156":"Label 3"},"labels_positions_v2":{"3":1,"5":3,"105":0,"156":2},"labels_colors":{"3":{"color":"#0086c0","border":"#3DB0DF","var_name":"blue-links"},"105":{"color":"#9AADBD","border":"#9AADBD","var_name":"winter"},"156":{"color":"#9D99B9","border":"#9D99B9","var_name":"purple_gray"}}}', + }, + { + id: 'world_clock', + title: 'World Clock', + type: 'timezone', + description: null, + settings_str: '{}', + }, + { + id: 'week', + title: 'Week', + type: 'week', + description: null, + settings_str: '{}', + }, + ], + groups: [ + { + id: 'topics', + title: 'This month', + }, + { + id: 'group_title', + title: 'Next month', + }, + ], + }, + ], + }, + account_id: 13215538, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.monday.com/v2', + method: 'POST', + headers: { + Authorization: 'failedApiToken', + }, + }, + httpRes: { + data: { + boards: [], + }, + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/monday/processor/data.ts b/test/integrations/destinations/monday/processor/data.ts new file mode 100644 index 0000000000..4e5280efcb --- /dev/null +++ b/test/integrations/destinations/monday/processor/data.ts @@ -0,0 +1,1399 @@ +export const data = [ + { + name: 'monday', + description: 'Track call with empty columnToPropertyMapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + query: + 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.monday.com/v2', + files: {}, + headers: { + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + 'Content-Type': 'application/json', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Track call with undefined columnToPropertyMapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + query: + 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.monday.com/v2', + files: {}, + headers: { + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + 'Content-Type': 'application/json', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Check Unsupported message type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type identify is not supported', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Check for empty message type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: '', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type is required', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Check for empty API Token', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: '', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'ApiToken is a required field', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Check for empty board Id', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'boardId is a required field', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Check for event name', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: '', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event is a required field and should be a string', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Track call with columnToPropertyMapping and with empty groupTitle', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + ], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.monday.com/v2', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + }, + params: {}, + body: { + JSON: { + query: + 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"}}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Track call with columnToPropertyMapping and with groupTitle', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next month', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + ], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.monday.com/v2', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + }, + params: {}, + body: { + JSON: { + query: + 'mutation { create_item (board_id: 339283933, group_id: group_title item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"}}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'Non-existing group title check', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next year', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + ], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: "Group Next year doesn't exist in the board", + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'check for item name', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next month', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + ], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: '', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Item name is required to create an item', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: + 'Track call with columnToPropertyMapping and with groupTitle with all supported columns', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next month', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + { + from: 'Checkbox', + to: 'checked', + }, + { + from: 'Numbers', + to: 'number', + }, + { + from: 'Name', + to: 'textKey', + }, + { + from: 'Country', + to: 'countryName', + }, + { + from: 'Location', + to: 'address', + }, + { + from: 'Phone', + to: 'phone', + }, + { + from: 'Rating', + to: 'rating', + }, + { + from: 'Link', + to: 'url', + }, + { + from: 'Long Text', + to: 'description', + }, + { + from: 'World Clock', + to: 'timezone', + }, + ], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + countryCode: 'US', + latitude: '51.23', + longitude: '35.3', + rating: '3', + linkText: 'websiteLink', + checked: 'true', + number: '45', + textKey: 'texting', + countryName: 'Unites States', + countryShortName: 'US', + address: 'New York', + phone: '2626277272', + url: 'demo.com', + description: 'property description', + timezone: 'America/New_York', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.monday.com/v2', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + }, + params: {}, + body: { + JSON: { + query: + 'mutation { create_item (board_id: 339283933, group_id: group_title item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"},\\"checkbox\\":{\\"checked\\":true},\\"numbers\\":\\"45\\",\\"text\\":\\"texting\\",\\"country\\":{\\"countryName\\":\\"Unites States\\",\\"countryCode\\":\\"US\\"},\\"location\\":{\\"address\\":\\"New York\\",\\"lat\\":\\"51.23\\",\\"lng\\":\\"35.3\\"},\\"phone\\":{\\"phone\\":\\"2626277272\\",\\"countryShortName\\":\\"US\\"},\\"rating\\":3,\\"link\\":{\\"url\\":\\"demo.com\\",\\"text\\":\\"websiteLink\\"},\\"long_text\\":{\\"text\\":\\"property description\\"},\\"world_clock\\":{\\"timezone\\":\\"America/New_York\\"}}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'check for allowed event name from UI', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next month', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: '', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event Discarded. To allow this event, add this in Allowlist', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'check for deleted boards (configured boards are deleted)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: 'failedApiToken', + boardId: '339283934', + groupTitle: 'Next year', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { + from: 'Email', + to: 'emailId', + }, + ], + whitelistedEvents: [ + { + eventName: 'create an item', + }, + ], + }, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'The board with boardId 339283934 does not exist', + statTags: { + destType: 'MONDAY', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/monday/router/data.ts b/test/integrations/destinations/monday/router/data.ts new file mode 100644 index 0000000000..eefc106274 --- /dev/null +++ b/test/integrations/destinations/monday/router/data.ts @@ -0,0 +1,228 @@ +export const data = [ + { + name: 'monday', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [{ eventName: 'create an item' }], + }, + }, + metadata: { + jobId: 1, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + { + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next month', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { from: 'Email', to: 'emailId' }, + ], + whitelistedEvents: [{ eventName: 'create an item' }], + }, + }, + metadata: { + jobId: 2, + }, + message: { + event: 'create an item', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + name: 'Task 1', + status: 'Done', + emailId: 'abc@email.com', + emailText: 'emailId', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + destType: 'monday', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + body: { + FORM: {}, + JSON: { + query: + 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.monday.com/v2', + files: {}, + headers: { + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + 'Content-Type': 'application/json', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: '', + columnToPropertyMapping: [], + whitelistedEvents: [{ eventName: 'create an item' }], + }, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.monday.com/v2', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + }, + params: {}, + body: { + JSON: { + query: + 'mutation { create_item (board_id: 339283933, group_id: group_title item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"}}") {id}}', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiToken: + 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + boardId: '339283933', + groupTitle: 'Next month', + columnToPropertyMapping: [ + { + from: 'Status', + to: 'status', + }, + { from: 'Email', to: 'emailId' }, + ], + whitelistedEvents: [{ eventName: 'create an item' }], + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/profitwell/network.ts b/test/integrations/destinations/profitwell/network.ts new file mode 100644 index 0000000000..e4e7247c74 --- /dev/null +++ b/test/integrations/destinations/profitwell/network.ts @@ -0,0 +1,94 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/pwu_Oea7HXV3bnTP/', + method: 'GET', + }, + httpRes: { + data: [ + { + user_id: 'pwu_Oea7HXV3bnTP', + subscription_id: 'pws_FecTCEyo17rV', + user_alias: 'spiderman_1a', + subscription_alias: 'spiderman_sub_1a', + email: 'spiderman@profitwell.com', + plan_id: 'web_plan', + plan_interval: 'month', + plan_currency: 'usd', + status: 'active', + value: 5000, + effective_date: 1514764800, + meta: {}, + }, + ], + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/spiderman_1a/', + method: 'GET', + }, + httpRes: { + data: [ + { + user_id: 'pwu_Oea7HXV3bnTP', + subscription_id: 'pws_FecTCEyo17rV', + user_alias: 'spiderman_1a', + subscription_alias: 'spiderman_sub_1a', + email: 'spiderman@profitwell.com', + plan_id: 'web_plan', + plan_interval: 'month', + plan_currency: 'usd', + status: 'active', + value: 5000, + effective_date: 1514764800, + meta: {}, + }, + ], + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/23453/', + method: 'GET', + }, + httpRes: { + status: 404, + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/sp_245/', + method: 'GET', + }, + httpRes: { + message: 'Request failed with status code 404', + status: 404, + statusText: 'Not Found', + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/1234/', + method: 'GET', + }, + httpRes: { + message: 'Request failed with status code 404', + status: 404, + statusText: 'Not Found', + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/samual/', + method: 'GET', + }, + httpRes: { + message: 'Request failed with status code 404', + status: 404, + statusText: 'Not Found', + }, + }, +]; diff --git a/test/integrations/destinations/profitwell/processor/data.ts b/test/integrations/destinations/profitwell/processor/data.ts new file mode 100644 index 0000000000..58bd2ed35f --- /dev/null +++ b/test/integrations/destinations/profitwell/processor/data.ts @@ -0,0 +1,1241 @@ +export const data = [ + { + name: 'profitwell', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'userId or userAlias is required for identify', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + context: { + externalId: [ + { + type: 'profitwellUserId', + id: '23453', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No user found for profitwell user_id', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.profitwell.com/v2/subscriptions/', + headers: { + 'Content-Type': 'application/json', + Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + params: {}, + body: { + JSON: { + subscription_alias: 'samual', + email: 'sample@sample.com', + plan_id: '23', + plan_interval: 'month', + plan_currency: 'usd', + status: 'active', + value: '23', + user_alias: 'sp_245', + effective_date: 1630917906, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'subscriptionId or subscriptionAlias is required for identify', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: '1234', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No user found for profitwell user_id', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.profitwell.com/v2/subscriptions/', + headers: { + 'Content-Type': 'application/json', + Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + params: {}, + body: { + JSON: { + subscription_alias: 'samual', + email: 'sample@sample.com', + plan_id: '23', + plan_interval: 'month', + plan_currency: 'usd', + status: 'active', + value: '23', + user_id: 'pwu_Oea7HXV3bnTP', + user_alias: 'sp_245', + effective_date: 1630917906, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + { + type: 'profitwellSubscriptionId', + id: 'pws_FecTCEyo17rV', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Missing required value from ["traits.effectiveDate","context.traits.effectiveDate"]', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + { + type: 'profitwellSubscriptionId', + id: 'pws_FecTCEyo17rV', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + effectiveDate: '1609748705', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/', + headers: { + 'Content-Type': 'application/json', + Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + params: {}, + body: { + JSON: { + plan_id: '23', + plan_interval: 'month', + value: '23', + status: 'active', + effective_date: 1609748705, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + { + type: 'profitwellSubscriptionId', + id: 'pws_FecTCEyo17rV', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'monthly', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + effectiveDate: '1609748705', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'invalid format for planInterval. Aborting', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + { + type: 'profitwellSubscriptionId', + id: 'pws_FecTCEyo17rV', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'activate', + effectiveDate: '1609748705', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/', + headers: { + 'Content-Type': 'application/json', + Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + params: {}, + body: { + JSON: { + plan_id: '23', + plan_interval: 'month', + value: '23', + effective_date: 1609748705, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: {}, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + { + type: 'profitwellSubscriptionId', + id: 'pws_FecTCEyo17rV', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + effectiveDate: '1609748705', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Private API Key not found. Aborting.', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'profitwellUserId', + id: 'pwu_Oea7HXV3bnTP', + }, + { + type: 'profitwellSubscriptionId', + id: 'pws_FecTCEyo17', + }, + ], + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + effectiveDate: '1609748705', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Profitwell subscription_id not found', + statTags: { + destType: 'PROFITWELL', + errorCategory: 'network', + errorType: 'aborted', + feature: 'processor', + implementation: 'native', + meta: 'instrumentation', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'profitwell', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + message: { + channel: 'web', + userId: 'sp_245', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + effectiveDate: 1609748705, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-09-06T14:15:06.798+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.profitwell.com/v2/subscriptions/', + headers: { + 'Content-Type': 'application/json', + Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + params: {}, + body: { + JSON: { + subscription_alias: 'samual', + email: 'sample@sample.com', + plan_id: '23', + plan_interval: 'month', + plan_currency: 'usd', + status: 'active', + value: '23', + effective_date: 1609748705, + user_alias: 'sp_245', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/profitwell/router/data.ts b/test/integrations/destinations/profitwell/router/data.ts new file mode 100644 index 0000000000..11f08c2139 --- /dev/null +++ b/test/integrations/destinations/profitwell/router/data.ts @@ -0,0 +1,113 @@ +export const data = [ + { + name: 'profitwell', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + metadata: { + jobId: 2, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { name: '', version: '' }, + screen: { density: 2 }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'identify', + userId: 'samual', + traits: { + email: 'sample@sample.com', + planId: '23', + planInterval: 'month', + planCurrency: 'usd', + value: '23', + subscriptionAlias: 'samual', + status: 'active', + }, + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + destType: 'profitwell', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + body: { + XML: {}, + FORM: {}, + JSON: { + subscription_alias: 'samual', + email: 'sample@sample.com', + plan_id: '23', + plan_interval: 'month', + plan_currency: 'usd', + status: 'active', + value: '23', + user_alias: 'samual', + effective_date: 1571043797, + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + version: '1', + endpoint: 'https://api.profitwell.com/v2/subscriptions/', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/sendgrid/network.ts b/test/integrations/destinations/sendgrid/network.ts index c97bf7e66e..29cfbf8446 100644 --- a/test/integrations/destinations/sendgrid/network.ts +++ b/test/integrations/destinations/sendgrid/network.ts @@ -112,159 +112,159 @@ const deleteNwData = [ url: 'https://api.sendgrid.com/v3/marketing/field_definitions', headers: { Authorization: 'Bearer apikey', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', }, }, httpRes: { status: 200, statusText: 'OK', data: { - "custom_fields": [ + custom_fields: [ { - "id": "w1_T", - "name": "user_name", - "field_type": "Text", - "_metadata": { - "self": "https://api.sendgrid.com/v3/marketing/field_definitions/w1_T" - } - } + id: 'w1_T', + name: 'user_name', + field_type: 'Text', + _metadata: { + self: 'https://api.sendgrid.com/v3/marketing/field_definitions/w1_T', + }, + }, ], - "reserved_fields": [ + reserved_fields: [ { - "id": "_rf0_T", - "name": "first_name", - "field_type": "Text" + id: '_rf0_T', + name: 'first_name', + field_type: 'Text', }, { - "id": "_rf1_T", - "name": "last_name", - "field_type": "Text" + id: '_rf1_T', + name: 'last_name', + field_type: 'Text', }, { - "id": "_rf2_T", - "name": "email", - "field_type": "Text" + id: '_rf2_T', + name: 'email', + field_type: 'Text', }, { - "id": "_rf3_T", - "name": "alternate_emails", - "field_type": "Text" + id: '_rf3_T', + name: 'alternate_emails', + field_type: 'Text', }, { - "id": "_rf4_T", - "name": "address_line_1", - "field_type": "Text" + id: '_rf4_T', + name: 'address_line_1', + field_type: 'Text', }, { - "id": "_rf5_T", - "name": "address_line_2", - "field_type": "Text" + id: '_rf5_T', + name: 'address_line_2', + field_type: 'Text', }, { - "id": "_rf6_T", - "name": "city", - "field_type": "Text" + id: '_rf6_T', + name: 'city', + field_type: 'Text', }, { - "id": "_rf7_T", - "name": "state_province_region", - "field_type": "Text" + id: '_rf7_T', + name: 'state_province_region', + field_type: 'Text', }, { - "id": "_rf8_T", - "name": "postal_code", - "field_type": "Text" + id: '_rf8_T', + name: 'postal_code', + field_type: 'Text', }, { - "id": "_rf9_T", - "name": "country", - "field_type": "Text" + id: '_rf9_T', + name: 'country', + field_type: 'Text', }, { - "id": "_rf10_T", - "name": "phone_number", - "field_type": "Text" + id: '_rf10_T', + name: 'phone_number', + field_type: 'Text', }, { - "id": "_rf11_T", - "name": "whatsapp", - "field_type": "Text" + id: '_rf11_T', + name: 'whatsapp', + field_type: 'Text', }, { - "id": "_rf12_T", - "name": "line", - "field_type": "Text" + id: '_rf12_T', + name: 'line', + field_type: 'Text', }, { - "id": "_rf13_T", - "name": "facebook", - "field_type": "Text" + id: '_rf13_T', + name: 'facebook', + field_type: 'Text', }, { - "id": "_rf14_T", - "name": "unique_name", - "field_type": "Text" + id: '_rf14_T', + name: 'unique_name', + field_type: 'Text', }, { - "id": "_rf15_T", - "name": "email_domains", - "field_type": "Text", - "read_only": true + id: '_rf15_T', + name: 'email_domains', + field_type: 'Text', + read_only: true, }, { - "id": "_rf16_D", - "name": "last_clicked", - "field_type": "Date", - "read_only": true + id: '_rf16_D', + name: 'last_clicked', + field_type: 'Date', + read_only: true, }, { - "id": "_rf17_D", - "name": "last_opened", - "field_type": "Date", - "read_only": true + id: '_rf17_D', + name: 'last_opened', + field_type: 'Date', + read_only: true, }, { - "id": "_rf18_D", - "name": "last_emailed", - "field_type": "Date", - "read_only": true + id: '_rf18_D', + name: 'last_emailed', + field_type: 'Date', + read_only: true, }, { - "id": "_rf19_T", - "name": "singlesend_id", - "field_type": "Text", - "read_only": true + id: '_rf19_T', + name: 'singlesend_id', + field_type: 'Text', + read_only: true, }, { - "id": "_rf20_T", - "name": "automation_id", - "field_type": "Text", - "read_only": true + id: '_rf20_T', + name: 'automation_id', + field_type: 'Text', + read_only: true, }, { - "id": "_rf21_D", - "name": "created_at", - "field_type": "Date", - "read_only": true + id: '_rf21_D', + name: 'created_at', + field_type: 'Date', + read_only: true, }, { - "id": "_rf22_D", - "name": "updated_at", - "field_type": "Date", - "read_only": true + id: '_rf22_D', + name: 'updated_at', + field_type: 'Date', + read_only: true, }, { - "id": "_rf23_T", - "name": "contact_id", - "field_type": "Text", - "read_only": true - } + id: '_rf23_T', + name: 'contact_id', + field_type: 'Text', + read_only: true, + }, ], - "_metadata": { - "self": "https://api.sendgrid.com/v3/marketing/field_definitions" - } + _metadata: { + self: 'https://api.sendgrid.com/v3/marketing/field_definitions', + }, }, }, - } + }, ]; export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/sendgrid/processor/data.ts b/test/integrations/destinations/sendgrid/processor/data.ts index 3047d484ec..b1550787b5 100644 --- a/test/integrations/destinations/sendgrid/processor/data.ts +++ b/test/integrations/destinations/sendgrid/processor/data.ts @@ -1,1533 +1,1544 @@ export const data = [ - { - "name": "sendgrid", - "description": "Identify call without an email", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "IPPoolName": "", - "apiKey": "apikey", - "attachments": [ - { - "content": "", - "contentId": "", - "disposition": "", - "filename": "", - "type": "" - } - ], - "clickTracking": true, - "clickTrackingEnableText": true, - "contents": [ - { - "type": "text/html", - "value": "
Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "eventDelivery": false, - "eventDeliveryTS": 1668424218224, - "eventNamesSettings": [ - { - "event": "open" - } - ], - "footer": false, - "fromEmail": "a@g.com", - "fromName": "", - "ganalytics": false, - "group": "", - "groupsToDisplay": [ - { - "groupId": "" - } - ], - "html": "", - "listId": "list111", - "mailFromTraits": false, - "openTracking": false, - "openTrackingSubstitutionTag": "", - "replyToEmail": "", - "replyToName": "", - "sandboxMode": false, - "subject": "hello there from webflow", - "subscriptionTracking": false, - "substitutionTag": "", - "templateId": "", - "text": "" - } - }, - "message": { - "type": "identify", - "userId": "user@1", - "context": { - "traits": { - "age": "25", - "city": "Surat", - "phone": "+91 9876543210", - "lastName": "test", - "firstName": "rudder", - "state": "Gujarat" - } - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Parameter mail is required", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SENDGRID", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + { + name: 'sendgrid', + description: 'Identify call without an email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + IPPoolName: '', + apiKey: 'apikey', + attachments: [ + { + content: '', + contentId: '', + disposition: '', + filename: '', + type: '', + }, + ], + clickTracking: true, + clickTrackingEnableText: true, + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + eventDelivery: false, + eventDeliveryTS: 1668424218224, + eventNamesSettings: [ + { + event: 'open', + }, + ], + footer: false, + fromEmail: 'a@g.com', + fromName: '', + ganalytics: false, + group: '', + groupsToDisplay: [ + { + groupId: '', + }, + ], + html: '', + listId: 'list111', + mailFromTraits: false, + openTracking: false, + openTrackingSubstitutionTag: '', + replyToEmail: '', + replyToName: '', + sandboxMode: false, + subject: 'hello there from webflow', + subscriptionTracking: false, + substitutionTag: '', + templateId: '', + text: '', + }, + }, + message: { + type: 'identify', + userId: 'user@1', + context: { + traits: { + age: '25', + city: 'Surat', + phone: '+91 9876543210', + lastName: 'test', + firstName: 'rudder', + state: 'Gujarat', + }, + }, + }, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Identify call with list_id configured from web-app", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "IPPoolName": "", - "apiKey": "apikey", - "attachments": [ - { - "content": "", - "contentId": "", - "disposition": "", - "filename": "", - "type": "" - } - ], - "clickTracking": true, - "clickTrackingEnableText": true, - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "eventDelivery": false, - "eventDeliveryTS": 1668424218224, - "eventNamesSettings": [ - { - "event": "open" - } - ], - "footer": false, - "fromEmail": "a@g.com", - "fromName": "", - "ganalytics": false, - "group": "", - "groupsToDisplay": [ - { - "groupId": "" - } - ], - "html": "", - "listId": "list111", - "mailFromTraits": false, - "openTracking": false, - "openTrackingSubstitutionTag": "", - "replyToEmail": "", - "replyToName": "", - "sandboxMode": false, - "subject": "hello there from webflow", - "subscriptionTracking": false, - "substitutionTag": "", - "templateId": "", - "text": "" - } - }, - "message": { - "type": "identify", - "userId": "user@1", - "context": { - "traits": { - "age": "25", - "city": "Surat", - "email": "test@rudderstack.com", - "phone": "+91 9876543210", - "lastName": "test", - "firstName": "rudder", - "state": "Gujarat" - } - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.sendgrid.com/v3/marketing/contacts", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "contactDetails": { - "email": "test@rudderstack.com", - "phone_number": "+91 9876543210", - "first_name": "rudder", - "last_name": "test", - "custom_fields": {} - }, - "contactListIds": "list111" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Parameter mail is required', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'SENDGRID', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Identify call with no list-id given", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "2HOQOO6wWKaKjeQrEABXgiH6cmU", - "Config": { - "IPPoolName": "", - "apiKey": "apikey", - "attachments": [ - { - "content": "", - "contentId": "", - "disposition": "", - "filename": "", - "type": "" - } - ], - "clickTracking": true, - "clickTrackingEnableText": true, - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "customFieldsMapping": [ - { - "from": "name", - "to": "user_name" - } - ], - "eventDelivery": false, - "eventDeliveryTS": 1668424218224, - "eventNamesSettings": [ - { - "event": "open" - } - ], - "footer": false, - "fromEmail": "a@g.com", - "fromName": "", - "ganalytics": false, - "group": "", - "groupsToDisplay": [ - { - "groupId": "" - } - ], - "html": "", - "mailFromTraits": false, - "openTracking": false, - "openTrackingSubstitutionTag": "", - "replyToEmail": "", - "replyToName": "", - "sandboxMode": false, - "subject": "hello there from webflow", - "subscriptionTracking": false, - "substitutionTag": "", - "templateId": "", - "text": "" - } - }, - "message": { - "type": "identify", - "userId": "user@1", - "context": { - "traits": { - "age": "25", - "city": "Surat", - "name": "rudder test", - "email": "test@rudderstack.com", - "phone": "+91 9876543210", - "lastName": "test", - "firstName": "rudder", - "state": "Gujarat" - } - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [{ - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "contactDetails": { - "email": "test@rudderstack.com", - "last_name": "test", - "first_name": "rudder", - "unique_name": "rudder test", - "phone_number": "+91 9876543210", - "custom_fields": { - "w1_T": "rudder test" - } - }, - "contactListIds": "" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "userId": "", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "version": "1", - "endpoint": "https://api.sendgrid.com/v3/marketing/contacts" + }, + { + name: 'sendgrid', + description: 'Identify call with list_id configured from web-app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + IPPoolName: '', + apiKey: 'apikey', + attachments: [ + { + content: '', + contentId: '', + disposition: '', + filename: '', + type: '', + }, + ], + clickTracking: true, + clickTrackingEnableText: true, + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + eventDelivery: false, + eventDeliveryTS: 1668424218224, + eventNamesSettings: [ + { + event: 'open', + }, + ], + footer: false, + fromEmail: 'a@g.com', + fromName: '', + ganalytics: false, + group: '', + groupsToDisplay: [ + { + groupId: '', + }, + ], + html: '', + listId: 'list111', + mailFromTraits: false, + openTracking: false, + openTrackingSubstitutionTag: '', + replyToEmail: '', + replyToName: '', + sandboxMode: false, + subject: 'hello there from webflow', + subscriptionTracking: false, + substitutionTag: '', + templateId: '', + text: '', + }, + }, + message: { + type: 'identify', + userId: 'user@1', + context: { + traits: { + age: '25', + city: 'Surat', + email: 'test@rudderstack.com', + phone: '+91 9876543210', + lastName: 'test', + firstName: 'rudder', + state: 'Gujarat', + }, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + contactDetails: { + email: 'test@rudderstack.com', + phone_number: '+91 9876543210', + first_name: 'rudder', + last_name: 'test', + custom_fields: {}, + }, + contactListIds: 'list111', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Identify call with no list-id given', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', + Config: { + IPPoolName: '', + apiKey: 'apikey', + attachments: [ + { + content: '', + contentId: '', + disposition: '', + filename: '', + type: '', + }, + ], + clickTracking: true, + clickTrackingEnableText: true, + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + customFieldsMapping: [ + { + from: 'name', + to: 'user_name', + }, + ], + eventDelivery: false, + eventDeliveryTS: 1668424218224, + eventNamesSettings: [ + { + event: 'open', + }, + ], + footer: false, + fromEmail: 'a@g.com', + fromName: '', + ganalytics: false, + group: '', + groupsToDisplay: [ + { + groupId: '', + }, + ], + html: '', + mailFromTraits: false, + openTracking: false, + openTrackingSubstitutionTag: '', + replyToEmail: '', + replyToName: '', + sandboxMode: false, + subject: 'hello there from webflow', + subscriptionTracking: false, + substitutionTag: '', + templateId: '', + text: '', + }, + }, + message: { + type: 'identify', + userId: 'user@1', + context: { + traits: { + age: '25', + city: 'Surat', + name: 'rudder test', + email: 'test@rudderstack.com', + phone: '+91 9876543210', + lastName: 'test', + firstName: 'rudder', + state: 'Gujarat', + }, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + contactDetails: { + email: 'test@rudderstack.com', + last_name: 'test', + first_name: 'rudder', + unique_name: 'rudder test', + phone_number: '+91 9876543210', + custom_fields: { + w1_T: 'rudder test', }, - "statusCode": 200 - } - - ] - } - } + }, + contactListIds: '', + }, + JSON_ARRAY: {}, + }, + type: 'REST', + userId: '', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + version: '1', + endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', + }, + statusCode: 200, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false, - "text": null, - "utmContent": null - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.sendgrid.com/v3/mail/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "from": { - "email": "ankit@rudderstack.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "subject": "A sample subject", - "reply_to": { - "email": "ankit@rudderstack.com" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } + }, + { + name: 'sendgrid', + description: 'Track Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + text: null, + utmContent: null, + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + from: { + email: 'ankit@rudderstack.com', + }, + personalizations: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "footerText": "some text", - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false - } + to: [ + { + email: 'a@g.com', }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "replyTo": { - "email": "testing@gmail.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + ], + subject: 'hey there', + }, + ], + content: [ { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.sendgrid.com/v3/mail/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "from": { - "email": "ankit@rudderstack.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "reply_to": { - "email": "testing@gmail.com" - }, - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "subject": "A sample subject" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + subject: 'A sample subject', + reply_to: { + email: 'ankit@rudderstack.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + }, + { + name: 'sendgrid', + description: 'Track Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + footerText: 'some text', + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + replyTo: { + email: 'testing@gmail.com', + }, + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + from: { + email: 'ankit@rudderstack.com', + }, + personalizations: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "footerText": "some text", - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false, - "group": "12345", - "groupsToDisplay": [ - { - "groupId": "12345" - }, - { - "groupId": "abc" - }, - { - "groupId": "12346" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "replyTo": { - "email": "testing@gmail.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - } - }, - "integrations": { - "All": true + to: [ + { + email: 'a@g.com', }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + ], + subject: 'hey there', + }, + ], + reply_to: { + email: 'testing@gmail.com', + }, + content: [ { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.sendgrid.com/v3/mail/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "from": { - "email": "ankit@rudderstack.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "reply_to": { - "email": "testing@gmail.com" - }, - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "subject": "A sample subject", - "asm": { - "group_id": 12345, - "groups_to_display": [ - 12345, - 12346 - ] - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + subject: 'A sample subject', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track call without an event name", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + }, + { + name: 'sendgrid', + description: 'Track Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + footerText: 'some text', + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + group: '12345', + groupsToDisplay: [ + { + groupId: '12345', + }, + { + groupId: 'abc', + }, + { + groupId: '12346', + }, + ], + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + replyTo: { + email: 'testing@gmail.com', + }, + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + from: { + email: 'ankit@rudderstack.com', + }, + personalizations: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "footerText": "some text", - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false, - "group": "12345", - "groupsToDisplay": [ - { - "groupId": "12345" - }, - { - "groupId": "abc" - }, - { - "groupId": "12346" - } - ] - } + to: [ + { + email: 'a@g.com', }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "new event", - "properties": { - "replyTo": { - "email": "testing@gmail.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + ], + subject: 'hey there', + }, + ], + reply_to: { + email: 'testing@gmail.com', + }, + content: [ { - "statusCode": 400, - "error": "Event not configured on dashboard", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "SENDGRID", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + subject: 'A sample subject', + asm: { + group_id: 12345, + groups_to_display: [12345, 12346], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Track call without an event name', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + footerText: 'some text', + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + group: '12345', + groupsToDisplay: [ + { + groupId: '12345', + }, + { + groupId: 'abc', + }, + { + groupId: '12346', + }, + ], + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'new event', + properties: { + replyTo: { + email: 'testing@gmail.com', + }, + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Event not configured on dashboard', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'SENDGRID', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Track Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + footerText: 'some text', + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + group: '12345', + groupsToDisplay: [ + { + groupId: '12345', + }, + { + groupId: 'abc', + }, + { + groupId: '12346', + }, + ], + attachments: [ + { + content: 'YXNkZ2FmZ3FlcmRxZ2Iua2puYWRrbGpuYWtqc2Rmbg==', + filename: 'index.html', + }, + ], + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + replyTo: { + email: 'testing@gmail.com', + }, + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + from: { + email: 'ankit@rudderstack.com', + }, + personalizations: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "footerText": "some text", - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false, - "group": "12345", - "groupsToDisplay": [ - { - "groupId": "12345" - }, - { - "groupId": "abc" - }, - { - "groupId": "12346" - } - ], - "attachments": [ - { - "content": "YXNkZ2FmZ3FlcmRxZ2Iua2puYWRrbGpuYWtqc2Rmbg==", - "filename": "index.html" - } - ] - } + to: [ + { + email: 'a@g.com', }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "replyTo": { - "email": "testing@gmail.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + ], + subject: 'hey there', + }, + ], + reply_to: { + email: 'testing@gmail.com', + }, + attachments: [ { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.sendgrid.com/v3/mail/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "from": { - "email": "ankit@rudderstack.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "reply_to": { - "email": "testing@gmail.com" - }, - "attachments": [ - { - "content": "YXNkZ2FmZ3FlcmRxZ2Iua2puYWRrbGpuYWtqc2Rmbg==", - "filename": "index.html" - } - ], - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "subject": "A sample subject", - "asm": { - "group_id": 12345, - "groups_to_display": [ - 12345, - 12346 - ] - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } + content: 'YXNkZ2FmZ3FlcmRxZ2Iua2puYWRrbGpuYWtqc2Rmbg==', + filename: 'index.html', + }, + ], + content: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + subject: 'A sample subject', + asm: { + group_id: 12345, + groups_to_display: [12345, 12346], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendgrid', + description: 'Track Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + footerText: 'some text', + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + group: '12345', + groupsToDisplay: [ + { + groupId: '12345', + }, + { + groupId: 'abc', + }, + { + groupId: '12346', + }, + ], + attachments: [ + { + content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=', + filename: 'index.html', + }, + { + content: 'bGFqa3NtZGZrZ2hxaWVybmtsYSBmZGtvamx3bWVGTC5NQW5kcy5rbmtmYWtkZg==', + }, + ], + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + replyTo: { + email: 'testing@gmail.com', + }, + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + from: { + email: 'ankit@rudderstack.com', + }, + personalizations: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "footerText": "some text", - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false, - "group": "12345", - "groupsToDisplay": [ - { - "groupId": "12345" - }, - { - "groupId": "abc" - }, - { - "groupId": "12346" - } - ], - "attachments": [ - { - "content": "YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=", - "filename": "index.html" - }, - { - "content": "bGFqa3NtZGZrZ2hxaWVybmtsYSBmZGtvamx3bWVGTC5NQW5kcy5rbmtmYWtkZg==" - } - ] - } + to: [ + { + email: 'a@g.com', }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "replyTo": { - "email": "testing@gmail.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + ], + subject: 'hey there', + }, + ], + reply_to: { + email: 'testing@gmail.com', + }, + attachments: [ { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.sendgrid.com/v3/mail/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "from": { - "email": "ankit@rudderstack.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "reply_to": { - "email": "testing@gmail.com" - }, - "attachments": [ - { - "content": "YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=", - "filename": "index.html" - } - ], - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "subject": "A sample subject", - "asm": { - "group_id": 12345, - "groups_to_display": [ - 12345, - 12346 - ] - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } + content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=', + filename: 'index.html', + }, + ], + content: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + subject: 'A sample subject', + asm: { + group_id: 12345, + groups_to_display: [12345, 12346], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, }, - { - "name": "sendgrid", - "description": "Track Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + }, + { + name: 'sendgrid', + description: 'Track Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [ + { + event: 'testing', + }, + { + event: 'clicked', + }, + ], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + footerText: 'some text', + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + group: '12345', + groupsToDisplay: [ + { + groupId: '12345', + }, + { + groupId: 'abc', + }, + { + groupId: '12346', + }, + ], + attachments: [ + { + content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=', + filename: 'index.html', + }, + { + content: 'bGFqa3NtZGZrZ2hxaWVybmtsYSBmZGtvamx3bWVGTC5NQW5kcy5rbmtmYWtkZg==', + }, + ], + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + replyTo: { + email: 'testing@gmail.com', + }, + mailSettings: { + bypassListManagement: true, + footer: true, + }, + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + params: {}, + body: { + JSON: { + from: { + email: 'ankit@rudderstack.com', + }, + personalizations: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [ - { - "event": "testing" - }, - { - "event": "clicked" - } - ], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "footerText": "some text", - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false, - "group": "12345", - "groupsToDisplay": [ - { - "groupId": "12345" - }, - { - "groupId": "abc" - }, - { - "groupId": "12346" - } - ], - "attachments": [ - { - "content": "YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=", - "filename": "index.html" - }, - { - "content": "bGFqa3NtZGZrZ2hxaWVybmtsYSBmZGtvamx3bWVGTC5NQW5kcy5rbmtmYWtkZg==" - } - ] - } + to: [ + { + email: 'a@g.com', }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "replyTo": { - "email": "testing@gmail.com" - }, - "mailSettings": { - "bypassListManagement": true, - "footer": true - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + ], + subject: 'hey there', + }, + ], + reply_to: { + email: 'testing@gmail.com', + }, + attachments: [ { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.sendgrid.com/v3/mail/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer apikey" - }, - "params": {}, - "body": { - "JSON": { - "from": { - "email": "ankit@rudderstack.com" - }, - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "reply_to": { - "email": "testing@gmail.com" - }, - "attachments": [ - { - "content": "YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=", - "filename": "index.html" - } - ], - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "subject": "A sample subject", - "asm": { - "group_id": 12345, - "groups_to_display": [ - 12345, - 12346 - ] - }, - "mail_settings": { - "bypass_list_management": { - "enable": true - }, - "footer": { - "enable": true, - "text": "some text" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=', + filename: 'index.html', + }, + ], + content: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + subject: 'A sample subject', + asm: { + group_id: 12345, + groups_to_display: [12345, 12346], + }, + mail_settings: { + bypass_list_management: { + enable: true, + }, + footer: { + enable: true, + text: 'some text', + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/sendgrid/router/data.ts b/test/integrations/destinations/sendgrid/router/data.ts index f10a6f0cab..6d79e556eb 100644 --- a/test/integrations/destinations/sendgrid/router/data.ts +++ b/test/integrations/destinations/sendgrid/router/data.ts @@ -1,173 +1,177 @@ import { FEATURES } from '../../../../../src/v0/util/tags'; export const data = [ - { - name: 'sendgrid', - description: 'Router Test Case', - feature: FEATURES.ROUTER, - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ + { + name: 'sendgrid', + description: 'Router Test Case', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, + }, + }, + metadata: { + jobId: 2, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { name: '', version: '' }, + screen: { density: 2 }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + type: 'track', + event: 'testing', + properties: { + personalizations: [ + { + to: [ { - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [{ "event": "testing" }, { "event": "clicked" }], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { "name": "", "version": "" }, - "screen": { "density": 2 } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "testing", - "properties": { - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - }, - { - "name": "hello" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - } - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ], - destType: 'sendgrid', + email: 'a@g.com', + }, + { + name: 'hello', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, }, - method: 'POST', + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, }, + ], + destType: 'sendgrid', }, - output: { - response: { - status: 200, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { body: { - output: [ - { - "batchedRequest": { - "body": { - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {}, - "JSON": { - "personalizations": [ - { - "to": [ - { - "email": "a@g.com" - } - ], - "subject": "hey there" - } - ], - "from": { - "email": "ankit@rudderstack.com" - }, - "reply_to": { "email": "ankit@rudderstack.com" }, - "subject": "A sample subject", - "content": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ] - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Authorization": "Bearer apikey", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.sendgrid.com/v3/mail/send" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "apikey", - "eventNamesSettings": [{ "event": "testing" }, { "event": "clicked" }], - "subject": "A sample subject", - "replyToEmail": "ankit@rudderstack.com", - "contents": [ - { - "type": "text/html", - "value": "Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
" - } - ], - "footer": false, - "bypassListManagement": false, - "sandboxMode": false, - "clickTracking": false, - "openTracking": false, - "ganalytics": false, - "subscriptionTracking": false, - "clickTrackingEnableText": false - } - } - } + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + JSON: { + personalizations: [ + { + to: [ + { + email: 'a@g.com', + }, + ], + subject: 'hey there', + }, + ], + from: { + email: 'ankit@rudderstack.com', + }, + reply_to: { email: 'ankit@rudderstack.com' }, + subject: 'A sample subject', + content: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, ], + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + Authorization: 'Bearer apikey', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.sendgrid.com/v3/mail/send', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'apikey', + eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }], + subject: 'A sample subject', + replyToEmail: 'ankit@rudderstack.com', + contents: [ + { + type: 'text/html', + value: + 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
', + }, + ], + footer: false, + bypassListManagement: false, + sandboxMode: false, + clickTracking: false, + openTracking: false, + ganalytics: false, + subscriptionTracking: false, + clickTrackingEnableText: false, }, + }, }, + ], }, - } + }, + }, + }, ]; diff --git a/test/integrations/destinations/sendinblue/network.ts b/test/integrations/destinations/sendinblue/network.ts new file mode 100644 index 0000000000..f4f7e84fa7 --- /dev/null +++ b/test/integrations/destinations/sendinblue/network.ts @@ -0,0 +1,92 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.sendinblue.com/v3/contacts/gordon_pittman%40example.com', + method: 'GET', + }, + httpRes: { + data: { + email: 'gordon_pittman@example.com', + id: 42, + emailBlacklisted: false, + smsBlacklisted: false, + createdAt: '2022-12-04T18:22:48.384+05:30', + modifiedAt: '2022-12-18T14:06:20.515+05:30', + attributes: { + LASTNAME: 'Pittman', + FIRSTNAME: 'Gordon', + AGE: 33, + }, + listIds: [5], + statistics: {}, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.sendinblue.com/v3/contacts/42', + method: 'GET', + }, + httpRes: { + data: { + email: 'gordon_pittman@example.com', + id: 42, + emailBlacklisted: false, + smsBlacklisted: false, + createdAt: '2022-12-04T18:22:48.384+05:30', + modifiedAt: '2022-12-18T14:06:20.515+05:30', + attributes: { + LASTNAME: 'Pittman', + FIRSTNAME: 'Gordon', + AGE: 33, + }, + listIds: [5], + statistics: {}, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.sendinblue.com/v3/contacts/john_doe%40example.com', + method: 'GET', + }, + httpRes: { + status: 404, + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/sp_245/', + method: 'GET', + }, + httpRes: { + message: 'Request failed with status code 404', + status: 404, + statusText: 'Not Found', + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/1234/', + method: 'GET', + }, + httpRes: { + message: 'Request failed with status code 404', + status: 404, + statusText: 'Not Found', + }, + }, + { + httpReq: { + url: 'https://api.profitwell.com/v2/users/samual/', + method: 'GET', + }, + httpRes: { + message: 'Request failed with status code 404', + status: 404, + statusText: 'Not Found', + }, + }, +]; diff --git a/test/integrations/destinations/sendinblue/processor/data.ts b/test/integrations/destinations/sendinblue/processor/data.ts new file mode 100644 index 0000000000..e50bb9c003 --- /dev/null +++ b/test/integrations/destinations/sendinblue/processor/data.ts @@ -0,0 +1,1722 @@ +export const data = [ + { + name: 'sendinblue', + description: 'Page call without email or phone', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + name: 'New Page', + properties: { + url: 'https://www.google.com/', + title: 'Google home', + }, + context: { + traits: {}, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'At least one of `email` or `phone` is required', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Page call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + name: 'New Page', + properties: { + url: 'https://www.google.com/', + title: 'Google home', + }, + context: { + traits: { + email: 'john_doe@example.com', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: false, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + page: 'https://www.google.com/', + properties: { + ma_path: '/Testing/test/ourSdk.html', + ma_referrer: 'http://127.0.0.1:7307/Testing/test/', + ma_title: 'Google home', + sib_name: 'New Page', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackPage', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track call without email or phone', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'Order Completed', + properties: {}, + context: { + traits: { + first_name: 'John', + lastName: 'Doe', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'At least one of `email` or `phone` is required', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track call without event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + properties: {}, + context: {}, + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event name is required', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track events with sendTraitsInTrack flag set to true', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'Order Completed', + properties: {}, + context: { + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + sendTraitsInTrack: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + event: 'Order Completed', + eventdata: {}, + properties: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + SMS: '+919876543210', + age: 19, + location: 'Mumbai', + role: 'SDE', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track events with contactAttributeMapping provided in webapp', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'Order Completed', + properties: {}, + context: { + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + sendTraitsInTrack: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + event: 'Order Completed', + eventdata: {}, + properties: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + LOCATION: 'Mumbai', + SMS: '+919876543210', + age: 19, + role: 'SDE', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track events with propertiesIdKey provided in integration object', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'Order Completed', + properties: { + orderId: '1341394-3812392190', + products: [ + { + product_id: 1234, + product_name: 'Track Pants', + amount: 1, + price: 220, + }, + { + product_id: 5768, + product_name: 'T-Shirt', + amount: 5, + price: 1058, + }, + ], + }, + context: { + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + }, + integrations: { + All: true, + sendinblue: { + propertiesIdKey: 'orderId', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + sendTraitsInTrack: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + event: 'Order Completed', + eventdata: { + data: { + orderId: '1341394-3812392190', + products: [ + { + amount: 1, + price: 220, + product_id: 1234, + product_name: 'Track Pants', + }, + { + amount: 5, + price: 1058, + product_id: 5768, + product_name: 'T-Shirt', + }, + ], + }, + id: '1341394-3812392190', + }, + properties: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + LOCATION: 'Mumbai', + SMS: '+919876543210', + age: 19, + role: 'SDE', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track events with eventdata.id taken from messageId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'Order Completed', + properties: { + orderId: '1341394-3812392190', + products: [ + { + product_id: 1234, + product_name: 'Track Pants', + amount: 1, + price: 220, + }, + { + product_id: 5768, + product_name: 'T-Shirt', + amount: 5, + price: 1058, + }, + ], + }, + context: { + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + sendTraitsInTrack: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + event: 'Order Completed', + eventdata: { + data: { + orderId: '1341394-3812392190', + products: [ + { + amount: 1, + price: 220, + product_id: 1234, + product_name: 'Track Pants', + }, + { + amount: 5, + price: 1058, + product_id: 5768, + product_name: 'T-Shirt', + }, + ], + }, + id: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + }, + properties: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + LOCATION: 'Mumbai', + SMS: '+919876543210', + age: 19, + role: 'SDE', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track link without email or phone', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'trackLink', + properties: { + link: 'https://www.google.com/gmail/', + emailCount: 19, + }, + context: { + traits: {}, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'At least one of `email` or `phone` is required', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track link without link', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'trackLink', + properties: {}, + context: { + traits: { + phone: '+919507545089', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Missing required value from "properties.link"', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Track link', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'trackLink', + properties: { + link: 'https://www.google.com/gmail/', + emailCount: 19, + }, + context: { + traits: { + phone: '+919507545089', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + email: '919507545089@mailin-sms.com', + link: 'https://www.google.com/gmail/', + properties: { + emailCount: 19, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackLink', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call with invalid email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + email: 'abc.com', + }, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'The provided email is invalid', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call with invalid phone number', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + phone: '99999999', + }, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'The provided phone number is invalid', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to create or update a contact without email or phone', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'At least one of `email` or `phone` is required', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to create or update a contact', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + newEmail: 'alex_root@example.com', + role: 'SDE', + }, + context: { + externalId: [ + { + type: 'sendinblueIncludeListIds', + id: [1, 2], + }, + ], + }, + integrations: { + All: true, + sendinblue: { + emailBlacklisted: true, + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + attributes: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + LOCATION: 'Mumbai', + SMS: '+919876543210', + EMAIL: 'alex_root@example.com', + age: 19, + role: 'SDE', + }, + email: 'john_doe@example.com', + emailBlacklisted: true, + listIds: [1, 2], + updateEnabled: true, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to create DOI contact with templatedId from externalId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + context: { + externalId: [ + { + type: 'sendinblueIncludeListIds', + id: [1, 2], + }, + { + type: 'sendinblueUnlinkListIds', + id: [5], + }, + { + type: 'sendinblueTemplateId', + id: 2, + }, + ], + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + attributes: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + SMS: '+919876543210', + age: 19, + location: 'Mumbai', + role: 'SDE', + }, + email: 'john_doe@example.com', + includeListIds: [1, 2], + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + templateId: 3, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts/doubleOptinConfirmation', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to create DOI contact without include list Ids', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'sendinblueIncludeListIds is required to create a contact using DOI', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to create DOI contact without template Id', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'templateId is required to create a contact using DOI', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to update a DOI contact without an email or contact ID', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'Gordon', + lastName: 'Pittman', + age: 19, + location: 'Mumbai', + role: 'SDE', + }, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'At least one of `email` or `contactId` is required to update the contact using DOI', + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: + 'Identify call to update a DOI contact using contactId as an Identifier and without include list Ids', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + age: 36, + location: 'Mumbai', + role: 'SDE 2', + }, + context: { + externalId: [ + { + type: 'sendinblueContactId', + id: 42, + }, + ], + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + attributes: { + age: 36, + location: 'Mumbai', + role: 'SDE 2', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts/42', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'PUT', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: + 'Identify call to update a DOI contact using email as an Identifier and without include list Ids', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + age: 36, + location: 'Mumbai', + role: 'SDE 2', + phone: '+918888888888', + email: 'gordon_pittman@example.com', + newEmail: 'gordon_pittman007@example.com', + }, + context: { + externalId: [ + { + type: 'sendinblueIncludeListIds', + id: [1], + }, + { + type: 'sendinblueUnlinkListIds', + id: [2], + }, + ], + }, + integrations: { + All: true, + sendinblue: { + emailBlacklisted: true, + smsBlacklisted: false, + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + attributes: { + age: 36, + location: 'Mumbai', + role: 'SDE 2', + SMS: '+918888888888', + EMAIL: 'gordon_pittman007@example.com', + }, + emailBlacklisted: true, + smsBlacklisted: false, + listIds: [1], + unlinkListIds: [2], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts/gordon_pittman%40example.com', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'PUT', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'sendinblue', + description: 'Identify call to unlink a contact from given lists', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + email: 'eric_kim@example.com', + }, + context: { + externalId: [ + { + type: 'sendinblueUnlinkListIds', + id: [2, 5], + }, + ], + }, + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + emails: ['eric_kim@example.com'], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts/lists/2/contacts/remove', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + { + output: { + body: { + FORM: {}, + JSON: { + emails: ['eric_kim@example.com'], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts/lists/5/contacts/remove', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/sendinblue/router/data.ts b/test/integrations/destinations/sendinblue/router/data.ts new file mode 100644 index 0000000000..31781e4c4f --- /dev/null +++ b/test/integrations/destinations/sendinblue/router/data.ts @@ -0,0 +1,410 @@ +export const data = [ + { + name: 'sendinblue', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + event: 'Order Completed', + properties: { + orderId: '1341394-3812392190', + products: [ + { + product_id: 1234, + product_name: 'Track Pants', + amount: 1, + price: 220, + }, + { + product_id: 5768, + product_name: 'T-Shirt', + amount: 5, + price: 1058, + }, + ], + }, + context: { + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + sendTraitsInTrack: true, + }, + }, + }, + { + message: { + type: 'page', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + name: 'New Page', + properties: { + url: 'https://www.google.com/', + title: 'Google home', + }, + context: { + traits: { + email: 'john_doe@example.com', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: false, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + newEmail: 'alex_root@example.com', + role: 'SDE', + }, + context: { + externalId: [ + { + type: 'sendinblueIncludeListIds', + id: [1, 2], + }, + ], + }, + integrations: { + All: true, + sendinblue: { + emailBlacklisted: true, + }, + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + }, + }, + }, + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + channel: 'web', + traits: { + first_name: 'John', + lastName: 'Doe', + age: 19, + email: 'john_doe@example.com', + phone: '+919876543210', + location: 'Mumbai', + role: 'SDE', + }, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + destType: 'sendinblue', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + event: 'Order Completed', + eventdata: { + data: { + orderId: '1341394-3812392190', + products: [ + { + amount: 1, + price: 220, + product_id: 1234, + product_name: 'Track Pants', + }, + { + amount: 5, + price: 1058, + product_id: 5768, + product_name: 'T-Shirt', + }, + ], + }, + id: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + }, + properties: { + FIRSTNAME: 'John', + LASTNAME: 'Doe', + LOCATION: 'Mumbai', + SMS: '+919876543210', + age: 19, + role: 'SDE', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + doi: false, + sendTraitsInTrack: true, + }, + }, + metadata: [ + { + jobId: 1, + }, + ], + statusCode: 200, + }, + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + email: 'john_doe@example.com', + page: 'https://www.google.com/', + properties: { + ma_path: '/Testing/test/ourSdk.html', + ma_referrer: 'http://127.0.0.1:7307/Testing/test/', + ma_title: 'Google home', + sib_name: 'New Page', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://in-automate.sendinblue.com/api/v2/trackPage', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'ma-key': 'clientKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + doi: false, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + templateId: 3, + }, + }, + metadata: [ + { + jobId: 2, + }, + ], + statusCode: 200, + }, + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + attributes: { + EMAIL: 'alex_root@example.com', + FIRSTNAME: 'John', + LASTNAME: 'Doe', + LOCATION: 'Mumbai', + SMS: '+919876543210', + age: 19, + role: 'SDE', + }, + email: 'john_doe@example.com', + emailBlacklisted: true, + listIds: [1, 2], + updateEnabled: true, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.sendinblue.com/v3/contacts', + files: {}, + headers: { + 'Content-Type': 'application/json', + 'api-key': 'apiKey123', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + contactAttributeMapping: [ + { + from: 'location', + to: 'LOCATION', + }, + ], + doi: false, + }, + }, + metadata: [ + { + jobId: 3, + }, + ], + statusCode: 200, + }, + { + batched: false, + error: 'sendinblueIncludeListIds is required to create a contact using DOI', + metadata: [ + { + jobId: 4, + }, + ], + statTags: { + destType: 'SENDINBLUE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + destination: { + Config: { + apiKey: 'apiKey123', + clientKey: 'clientKey123', + templateId: 3, + doi: true, + redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard', + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/stormly/processor/data.ts b/test/integrations/destinations/stormly/processor/data.ts index cfa16beced..52356ba9e0 100644 --- a/test/integrations/destinations/stormly/processor/data.ts +++ b/test/integrations/destinations/stormly/processor/data.ts @@ -1,566 +1,566 @@ export const data = [ - { - "name": "stormly", - "description": "Identify call without userId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "identify", - "context": { - "traits": { - "name": "John Doe", - "email": "johndoe@gmail.com", - "age": 25 - } - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Missing required value from \"userIdOnly\"", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "STORMLY", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "stormly", - "description": "Identify call with userId, traits", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "channel": "web", - "userId": "5136633649", - "context": { - "traits": { - "name": "John Doe", - "email": "johndoe@gmail.com", - "age": 25 - } - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/identify", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "userId": "5136633649", - "timestamp": "2022-01-20T13:39:21.032Z", - "traits": { - "name": "John Doe", - "email": "johndoe@gmail.com", - "age": 25 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "stormly", - "description": "Track call without userId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more.", - "groupId": "91Yb32830" - }, - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Missing required value from \"userIdOnly\"", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "STORMLY", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "stormly", - "description": "Track call without groupId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "userId": "5136633649", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more." - }, - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/track", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "userId": "5136633649", - "event": "Product Reviewed", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more." - }, - "timestamp": "2022-01-20T13:39:21.032Z" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "stormly", - "description": "Track call without properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "userId": "5136633649", - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/track", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "userId": "5136633649", - "event": "Product Reviewed", - "timestamp": "2022-01-20T13:39:21.032Z" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "stormly", - "description": "Track call with userId, groupId and properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "userId": "5136633649", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more.", - "groupId": "91Yb32830" - }, - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/track", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "userId": "5136633649", - "event": "Product Reviewed", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more." - }, - "timestamp": "2022-01-20T13:39:21.032Z", - "context": { - "groupId": "91Yb32830" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "stormly", - "description": "Track call with userId, groupId (from externalId) and properties", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "userId": "5136633649", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more.", - "groupId": "test-12345" - }, - "context": { - "externalId": [ - { - "type": "stormlyGroupId", - "id": "91Yb32830" - } - ] - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/track", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "userId": "5136633649", - "event": "Product Reviewed", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3, - "review_body": "Average product, expected much more." - }, - "timestamp": "2022-01-20T13:39:21.032Z", - "context": { - "groupId": "91Yb32830" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "stormly", - "description": "Group call with userId, groupId and traits", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "message": { - "type": "group", - "userId": "5136633649", - "traits": { - "name": "Initech", - "employees": 500, - "headquarters": "Redwood City, California, United States", - "ceo": "John Doe", - "revenue": 70000000, - "currency": "USD", - "groupId": "9230AUbd2138h" - }, - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/group", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "userId": "5136633649", - "groupId": "9230AUbd2138h", - "timestamp": "2022-01-20T13:39:21.032Z", - "traits": { - "name": "Initech", - "employees": 500, - "headquarters": "Redwood City, California, United States", - "ceo": "John Doe", - "revenue": 70000000, - "currency": "USD" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'stormly', + description: 'Identify call without userId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'identify', + context: { + traits: { + name: 'John Doe', + email: 'johndoe@gmail.com', + age: 25, + }, + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Missing required value from "userIdOnly"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'STORMLY', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Identify call with userId, traits', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'identify', + sentAt: '2022-01-20T13:39:21.033Z', + channel: 'web', + userId: '5136633649', + context: { + traits: { + name: 'John Doe', + email: 'johndoe@gmail.com', + age: 25, + }, + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dummyApiKey', + }, + params: {}, + body: { + JSON: { + userId: '5136633649', + timestamp: '2022-01-20T13:39:21.032Z', + traits: { + name: 'John Doe', + email: 'johndoe@gmail.com', + age: 25, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Track call without userId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'track', + event: 'Product Reviewed', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + groupId: '91Yb32830', + }, + context: {}, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Missing required value from "userIdOnly"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'STORMLY', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Track call without groupId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'track', + event: 'Product Reviewed', + userId: '5136633649', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + }, + context: {}, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dummyApiKey', + }, + params: {}, + body: { + JSON: { + userId: '5136633649', + event: 'Product Reviewed', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + }, + timestamp: '2022-01-20T13:39:21.032Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Track call without properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'track', + event: 'Product Reviewed', + userId: '5136633649', + context: {}, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dummyApiKey', + }, + params: {}, + body: { + JSON: { + userId: '5136633649', + event: 'Product Reviewed', + timestamp: '2022-01-20T13:39:21.032Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Track call with userId, groupId and properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'track', + event: 'Product Reviewed', + userId: '5136633649', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + groupId: '91Yb32830', + }, + context: {}, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dummyApiKey', + }, + params: {}, + body: { + JSON: { + userId: '5136633649', + event: 'Product Reviewed', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + }, + timestamp: '2022-01-20T13:39:21.032Z', + context: { + groupId: '91Yb32830', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Track call with userId, groupId (from externalId) and properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'track', + event: 'Product Reviewed', + userId: '5136633649', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + groupId: 'test-12345', + }, + context: { + externalId: [ + { + type: 'stormlyGroupId', + id: '91Yb32830', + }, + ], + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dummyApiKey', + }, + params: {}, + body: { + JSON: { + userId: '5136633649', + event: 'Product Reviewed', + properties: { + review_id: '12345', + product_id: '123', + rating: 3, + review_body: 'Average product, expected much more.', + }, + timestamp: '2022-01-20T13:39:21.032Z', + context: { + groupId: '91Yb32830', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'stormly', + description: 'Group call with userId, groupId and traits', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + message: { + type: 'group', + userId: '5136633649', + traits: { + name: 'Initech', + employees: 500, + headquarters: 'Redwood City, California, United States', + ceo: 'John Doe', + revenue: 70000000, + currency: 'USD', + groupId: '9230AUbd2138h', + }, + context: {}, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/group', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dummyApiKey', + }, + params: {}, + body: { + JSON: { + userId: '5136633649', + groupId: '9230AUbd2138h', + timestamp: '2022-01-20T13:39:21.032Z', + traits: { + name: 'Initech', + employees: 500, + headquarters: 'Redwood City, California, United States', + ceo: 'John Doe', + revenue: 70000000, + currency: 'USD', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/stormly/router/data.ts b/test/integrations/destinations/stormly/router/data.ts index bbc9c7af2e..efdae153e4 100644 --- a/test/integrations/destinations/stormly/router/data.ts +++ b/test/integrations/destinations/stormly/router/data.ts @@ -1,148 +1,148 @@ import { FEATURES } from '../../../../../src/v0/util/tags'; export const data = [ - { - name: 'stormly', - description: 'Test 0', - feature: FEATURES.ROUTER, - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "metadata": { - "jobId": 1 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "channel": "web", - "userId": "5136633649", - "context": { - "traits": { - "name": "John Doe", - "email": "johndoe@gmail.com", - "age": 25 - } - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "metadata": { - "jobId": 2 - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3.0, - "review_body": "Average product, expected much more.", - "groupId": "91Yb32830" - }, - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } - ], - destType: 'stormly', + { + name: 'stormly', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + apiKey: 'dummyApiKey', }, - method: 'POST', + ID: 'stormly123', + }, + metadata: { + jobId: 1, + }, + message: { + type: 'identify', + sentAt: '2022-01-20T13:39:21.033Z', + channel: 'web', + userId: '5136633649', + context: { + traits: { + name: 'John Doe', + email: 'johndoe@gmail.com', + age: 25, + }, + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, }, + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + metadata: { + jobId: 2, + }, + message: { + type: 'track', + event: 'Product Reviewed', + properties: { + review_id: '12345', + product_id: '123', + rating: 3.0, + review_body: 'Average product, expected much more.', + groupId: '91Yb32830', + }, + context: {}, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + originalTimestamp: '2022-01-20T13:39:21.032Z', + }, + }, + ], + destType: 'stormly', }, - output: { - response: { - status: 200, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { body: { - output: [ - { - "batched": false, - "batchedRequest": { - "body": { - "FORM": {}, - "JSON": { - "timestamp": "2022-01-20T13:39:21.032Z", - "traits": { - "age": 25, - "email": "johndoe@gmail.com", - "name": "John Doe" - }, - "userId": "5136633649" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/identify", - "files": {}, - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "metadata": [ - { - "jobId": 1 - } - ], - "statusCode": 200 - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "batched": false, - "error": "Missing required value from \"userIdOnly\"", - "metadata": [ - { - "jobId": 2 - } - ], - "statTags": { - "destType": "STORMLY", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "router", - "implementation": "native", - "module": "destination", - }, - "statusCode": 400 - } - ], + FORM: {}, + JSON: { + timestamp: '2022-01-20T13:39:21.032Z', + traits: { + age: 25, + email: 'johndoe@gmail.com', + name: 'John Doe', + }, + userId: '5136633649', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify', + files: {}, + headers: { + Authorization: 'Basic dummyApiKey', + 'Content-Type': 'application/json', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + metadata: [ + { + jobId: 1, + }, + ], + statusCode: 200, + }, + { + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + ID: 'stormly123', + }, + batched: false, + error: 'Missing required value from "userIdOnly"', + metadata: [ + { + jobId: 2, }, + ], + statTags: { + destType: 'STORMLY', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, }, + ], }, - } + }, + }, + }, ];