From 6ac9e912652f79643108c81ec0a70febba162316 Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Mon, 18 Dec 2023 11:11:31 +0530 Subject: [PATCH 1/3] fix: converting event names to string before lowercasing --- src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml index 7bcb804126..677886c70d 100644 --- a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml +++ b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml @@ -175,7 +175,7 @@ steps: name: eventNamesForOthers template: | let event = .message.event ?? .message.name; - let eventInLowerCase = event.toLowerCase(); + let eventInLowerCase = event.toString().toLowerCase(); let eventNames = .destination.Config.eventsMapping.(){.from === event}.to[] ?? []; eventNames = $.convertToSnakeCase(eventNames); eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? []; From 0c91d9c9799c889d58cd29cc9da9c21b4f8311b8 Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Mon, 18 Dec 2023 12:03:22 +0530 Subject: [PATCH 2/3] fix: small edit and adding test cases --- .../pinterest_tag/procWorkflow.yaml | 6 +- src/v0/destinations/pinterest_tag/utils.js | 2 +- .../pinterest_tag/processor/data.ts | 3432 +---------------- .../destinations/pinterest_tag/step/data.ts | 158 + 4 files changed, 165 insertions(+), 3433 deletions(-) diff --git a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml index 677886c70d..724c53c83d 100644 --- a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml +++ b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml @@ -175,12 +175,13 @@ steps: name: eventNamesForOthers template: | let event = .message.event ?? .message.name; - let eventInLowerCase = event.toString().toLowerCase(); + let stringifiedEvent = event.toString(); + let eventInLowerCase = stringifiedEvent.toLowerCase(); let eventNames = .destination.Config.eventsMapping.(){.from === event}.to[] ?? []; eventNames = $.convertToSnakeCase(eventNames); eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? []; (eventNames.length === 0 && .destination.Config.sendAsCustomEvent) ? eventNames = ["custom"]; - eventNames.length === 0 ? eventNames = [event]; + eventNames.length === 0 ? eventNames = [event.toString()]; eventNames; - name: payload @@ -226,6 +227,7 @@ steps: name: buildResponseForProcessTransformationV5 description: build response using V5 API template: | + console.log(JSON.stringify($.outputs.payload)) $.outputs.payload.().({ "body": { "JSON": ., diff --git a/src/v0/destinations/pinterest_tag/utils.js b/src/v0/destinations/pinterest_tag/utils.js index c1493e9dbd..ca9759a8ea 100644 --- a/src/v0/destinations/pinterest_tag/utils.js +++ b/src/v0/destinations/pinterest_tag/utils.js @@ -166,7 +166,7 @@ const deduceTrackScreenEventName = (message, Config) => { let eventName; const { event, name } = message; const { eventsMapping, sendAsCustomEvent } = Config; - const trackEventOrScreenName = event || name; + const trackEventOrScreenName = event.toString() || name.toString(); if (!trackEventOrScreenName) { throw new InstrumentationError('event_name could not be mapped. Aborting'); } diff --git a/test/integrations/destinations/pinterest_tag/processor/data.ts b/test/integrations/destinations/pinterest_tag/processor/data.ts index 17ab83b2e9..dab9faba16 100644 --- a/test/integrations/destinations/pinterest_tag/processor/data.ts +++ b/test/integrations/destinations/pinterest_tag/processor/data.ts @@ -1,3346 +1,4 @@ export const data = [ - { - name: 'pinterest_tag', - description: 'Test 0', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'ABC Searched', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - gender: 'non-binary', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - optOutType: 'LDP', - clickId: 'dummy_clickId', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - tagId: '123456789', - advertiserId: '429047995', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendAsTestEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: { test: true }, - body: { - JSON: { - action_source: 'web', - event_name: 'watch_video', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - click_id: 'dummy_clickId', - ge: ['1b16b1df538ba12dc3f97edbb85caa7050d46c148134290feba80f8236c83db9'], - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - opt_out_type: 'LDP', - num_items: 3, - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 1', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'Order completed', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '429047995', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - action_source: 'web', - event_name: 'checkout', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - num_items: 3, - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 2', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'product added', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - product_id: '123', - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '429047995', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_name: 'add_to_cart', - action_source: 'web', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - num_items: 2, - content_ids: ['123'], - contents: [{ quantity: 2, item_price: '25' }], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'Product List Filtered', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - destinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: - 'Advertiser Id not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Advertiser Id not found. Aborting', - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'configuration', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 4', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'Product List Filtered', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '429047995', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - error: - 'It is required at least one of em, hashed_maids or pair of client_ip_address and client_user_agent: Workflow: procWorkflow, Step: validateUserFields, ChildStep: undefined, OriginalError: It is required at least one of em, hashed_maids or pair of client_ip_address and client_user_agent', - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 5', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'ABC Searched', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - numOfItems: 2, - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '429047995', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_name: 'watch_video', - event_time: 1597383030, - action_source: 'web', - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - num_items: 2, - order_id: '50314b8e9bcf000000000000', - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 6', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'ABC Searched', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - numOfItems: 2, - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: - 'Advertiser Id not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Advertiser Id not found. Aborting', - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'configuration', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 7', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'group', - event: 'ABC Searched', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - numOfItems: 2, - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - enhancedMatch: true, - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: - 'message type group is not supported: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message type group is not supported', - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 8', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'ABC Searched', - channel: 'abc', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - numOfItems: 2, - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - error: - 'Action source must be one of app_android, app_ios, web, offline: Workflow: procWorkflow, Step: validateCommonFields, ChildStep: undefined, OriginalError: Action source must be one of app_android, app_ios, web, offline', - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 9', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'custom event', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - numOfItems: 2, - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_name: 'custom', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - action_source: 'web', - advertiser_id: '123456', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - num_items: 2, - order_id: '50314b8e9bcf000000000000', - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 10', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'page', - name: 'ApplicationLoaded', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { path: '', referrer: '', search: '', title: '', url: '' }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - action_source: 'web', - event_name: 'page_visit', - app_id: '429047995', - advertiser_id: '123456', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 11', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'page', - name: 'ApplicationLoaded', - category: 'test category', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { path: '', referrer: '', search: '', title: '', url: '' }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - action_source: 'web', - event_name: 'view_category', - app_id: '429047995', - advertiser_id: '123456', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 12', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'page', - name: 'ApplicationLoaded', - category: 'test category', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123', adTrackingEnabled: true }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { path: '', referrer: '', search: '', title: '', url: '' }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_time: 1597383030, - opt_out: false, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - action_source: 'web', - event_name: 'view_category', - app_id: '429047995', - advertiser_id: '123456', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 13', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'page', - name: 'ApplicationLoaded', - category: 'test category', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - ip: '127.0.0.0', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { adTrackingEnabled: false }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { path: '', referrer: '', search: '', title: '', url: '' }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_time: 1597383030, - opt_out: true, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - action_source: 'web', - event_name: 'view_category', - app_id: '429047995', - advertiser_id: '123456', - user_data: { - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - client_ip_address: '127.0.0.0', - client_user_agent: 'chrome', - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 14', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'page', - name: 'ApplicationLoaded', - category: 'test category', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - requestIP: '127.0.0.0', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - phone: 'Hashed phone', - gender: 'Hashed Gender', - dob: 'Hashed DB', - lastname: 'Hashed Lastname', - firstName: 'Hashed FirstName', - address: { - city: 'Hashed City', - state: 'Hashed State', - zip: 'Hashed Zip', - country: 'Hashed country', - }, - }, - device: { adTrackingEnabled: false, advertisingId: 'Hashed maids' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { path: '', referrer: '', search: '', title: '', url: '' }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: false, - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_time: 1597383030, - action_source: 'web', - opt_out: true, - event_name: 'view_category', - app_id: '429047995', - advertiser_id: '123456', - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - user_data: { - ph: ['Hashed phone'], - db: ['Hashed DB'], - ln: ['Hashed Lastname'], - fn: ['Hashed FirstName'], - ct: ['Hashed City'], - st: ['Hashed State'], - zp: ['Hashed Zip'], - country: ['Hashed country'], - hashed_maids: ['Hashed maids'], - ge: ['Hashed Gender'], - client_user_agent: 'chrome', - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 15', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'page', - name: 'ApplicationLoaded', - category: 'test category', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - requestIP: '127.0.0.0', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - phone: ['Hashed phone', 'Hashed phone1'], - gender: ['Hashed Gender', 'Hashed Gender1'], - dob: ['Hashed DB', 'Hashed DB1'], - lastname: ['Hashed Lastname', 'Hashed Lastname1'], - firstName: ['Hashed FirstName', 'Hashed FirstName1'], - address: { - city: ['Hashed City', 'Hashed City1'], - state: ['Hashed State', 'Hashed State1'], - zip: ['Hashed Zip', 'Hashed Zip1'], - country: ['Hashed country', 'Hashed country1'], - }, - }, - device: { adTrackingEnabled: false, advertisingId: 'Hashed maids' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { path: '', referrer: '', search: '', title: '', url: '' }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: false, - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_time: 1597383030, - action_source: 'web', - opt_out: true, - event_name: 'view_category', - app_id: '429047995', - advertiser_id: '123456', - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - user_data: { - ph: ['Hashed phone', 'Hashed phone1'], - db: ['Hashed DB', 'Hashed DB1'], - ln: ['Hashed Lastname', 'Hashed Lastname1'], - fn: ['Hashed FirstName', 'Hashed FirstName1'], - ct: ['Hashed City', 'Hashed City1'], - st: ['Hashed State', 'Hashed State1'], - zp: ['Hashed Zip', 'Hashed Zip1'], - country: ['Hashed country', 'Hashed country1'], - hashed_maids: ['Hashed maids'], - ge: ['Hashed Gender', 'Hashed Gender1'], - client_user_agent: 'chrome', - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 16', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - name: 'Test Tool', - type: 'page', - sentAt: '2023-02-01T00:00:00.379Z', - userId: '', - channel: 'web', - context: { - os: { name: '', version: '' }, - app: { - name: 'RudderLabs JavaScript SDK', - version: '2.22.3', - namespace: 'com.rudderlabs.javascript', - }, - page: { - url: 'https://www.abc.com/s598907', - path: '/test-path/s598907', - title: 'Test Tool + Reviews | Rudderstack', - search: '', - tab_url: 'https://www.abc.com/s598907', - referrer: '$direct', - initial_referrer: '$direct', - referring_domain: '', - initial_referring_domain: '', - }, - locale: 'en-US', - screen: { - width: 1024, - height: 1024, - density: 1, - innerWidth: 1024, - innerHeight: 1024, - }, - traits: {}, - library: { name: 'RudderLabs JavaScript SDK', version: '2.22.3' }, - campaign: {}, - doNotSell: false, - sessionId: 1675209600203, - userAgent: - 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/109.0.5414.101 Safari/537.36', - gaClientId: { - integrations: { - 'Google Ads': { gclid: '' }, - 'Google Analytics': { clientId: '1518934611.1234569600' }, - }, - }, - sessionStart: true, - }, - rudderId: '7291a10f-e7dd-49f9-94ce-0154f53897y6', - messageId: '1c77a616-13a7-4a2e-a8e7-e1a0971897y6', - timestamp: '2023-02-01T12:47:30.030Z', - properties: { - sku: '45790-32', - url: 'https://www.abc.com/23rty', - name: 'Test Tool', - path: '/test-path/tool', - email: '', - title: 'Test Tool + Reviews | Rudderstack', - review: { reviewCount: 2, averageReview: 5, reviewContentID: ['238300132'] }, - search: '', - tab_url: 'https://www.abc/com', - pageInfo: { - pageId: 's592897', - category: { - pageType: 'product', - subCategory: 'Dining & Kitchen Furniture', - pageTemplate: 'product detail grouper', - primaryCategory: 'Furniture', - }, - brandType: 'new brand', - }, - referrer: '', - subCategory: 'Dining & Kitchen Furniture', - primaryCategory: 'Furniture', - initial_referrer: '$direct', - referring_domain: '', - initial_referring_domain: '', - }, - receivedAt: '2023-02-01T12:47:30.038Z', - request_ip: '66.249.72.218', - anonymousId: 'a61c77a6-1613-474a-aee8-e7e1a0971047', - integrations: { All: true }, - originalTimestamp: '2023-02-01T00:00:00.371Z', - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123478671210', - sendingUnHashedData: false, - enableDeduplication: false, - eventsMapping: [ - { from: 'Product Added', to: 'AddToCart' }, - { from: 'Order Completed', to: 'Checkout' }, - { from: 'Product Viewed', to: 'PageVisit' }, - { from: 'Lead', to: 'Lead' }, - { from: 'Signup', to: 'Signup' }, - ], - enhancedMatch: true, - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - body: { - JSON: { - event_time: 1675255650, - event_source_url: 'https://www.abc.com/s598907', - action_source: 'web', - app_name: 'RudderLabs JavaScript SDK', - app_version: '2.22.3', - language: 'en-US', - event_id: '1c77a616-13a7-4a2e-a8e7-e1a0971897y6', - advertiser_id: '123478671210', - user_data: { - client_ip_address: '66.249.72.218', - client_user_agent: - 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/109.0.5414.101 Safari/537.36', - }, - event_name: 'page_visit', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 17', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'test', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - sku: '1234', - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_name: 'custom', - event_time: 1597383030, - action_source: 'web', - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '123456', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - num_items: 0, - content_ids: ['1234'], - contents: [{ quantity: 1, item_price: 'undefined' }], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 18', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'custom event', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - sku: '1234', - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - ], - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - event_name: 'custom', - event_time: 1597383030, - action_source: 'web', - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '123456', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - num_items: 1, - content_ids: ['507f1f77bcf86cd799439011'], - contents: [{ quantity: 1, item_price: '19' }], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 19', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: 'custom event', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '123456', - appId: '429047995', - sendingUnHashedData: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - enhancedMatch: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - body: { - FORM: {}, - JSON: { - action_source: 'web', - advertiser_id: '123456', - app_id: '429047995', - custom_data: { - contents: [{ item_price: 'undefined', quantity: 1 }], - currency: 'USD', - num_items: 0, - order_id: '50314b8e9bcf000000000000', - value: '27.5', - }, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - event_name: 'custom event', - event_time: 1597383030, - user_data: { - client_user_agent: 'chrome', - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - }, - }, - JSON_ARRAY: {}, - XML: {}, - }, - endpoint: 'https://ct.pinterest.com/events/v3', - files: {}, - headers: { 'Content-Type': 'application/json' }, - method: 'POST', - params: {}, - type: 'REST', - version: '1', - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 20', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - description: 'Track call with v5 Api version and send external_id toggle enabled', - message: { - type: 'track', - event: 'ABC Searched', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - optOutType: 'LDP', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - apiVersion: 'newApi', - adAccountId: 'accountId123', - conversionToken: 'conversionToken123', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendExternalId: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', - headers: { - 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', - }, - params: {}, - body: { - JSON: { - action_source: 'web', - event_name: 'watch_video', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - external_id: [ - '3217d71a74c219d6e31e28267b313a7ceb6a2c032db1a091c9416b25b2ae2bc8', - ], - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - opt_out_type: 'LDP', - num_items: 3, - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 21', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - description: 'Custom event with v5 Api version', - message: { - type: 'track', - event: 'random', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - optOutType: 'LDP', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - apiVersion: 'newApi', - adAccountId: 'accountId123', - conversionToken: 'conversionToken123', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', - headers: { - 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', - }, - params: {}, - body: { - JSON: { - action_source: 'web', - event_name: 'custom', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - opt_out_type: 'LDP', - num_items: 3, - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 22', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - description: - 'Custom event with v5 Api version, with unhashed User Data and the values are an array of strings', - message: { - type: 'track', - event: 'random', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: ['abc@gmail.com', 'def@gmail.com'], - phone: ['+1234589947', '+1234589948'], - ge: ['male', 'male'], - db: ['19950715', '19970615'], - lastname: ['Rudderlabs', 'Xu'], - firstName: ['Test', 'Alex'], - address: { - city: ['Kolkata', 'Mumbai'], - state: ['WB', 'MH'], - zip: ['700114', '700115'], - country: ['IN', 'IN'], - }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - optOutType: 'LDP', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - apiVersion: 'newApi', - adAccountId: 'accountId123', - conversionToken: 'conversionToken123', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', - headers: { - 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', - }, - params: {}, - body: { - JSON: { - action_source: 'web', - event_name: 'custom', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - user_data: { - em: [ - '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', - 'c392e50ebeca7bea4405e9c545023451ac56620031f81263f681269bde14218b', - ], - ph: [ - 'd164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b', - '22bdde2594851294f2a6f4c34af704e68b398b03129ea9ceb58f0ffe33f6db52', - ], - ln: [ - 'dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251', - '9c2f138690fca4890c3c4a6691610fbbbdf32091cc001f7355cfdf574baa52b9', - ], - fn: [ - '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', - '4135aa9dc1b842a653dea846903ddb95bfb8c5a10c504a7fa16e10bc31d1fdf0', - ], - ct: [ - '6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85', - 'd209bcc17778fd19fd2bc0c99a3868bf011da5162d3a75037a605768ebc276e2', - ], - st: [ - '3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd', - '1b0316ed1cfed044035c55363e02ccafab26d66b1c2746b94d17285f043324aa', - ], - zp: [ - '1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c', - '4d6755aa1e85517191f06cc91448696c173e1195ae51f94a1670116ac7b5c47b', - ], - country: [ - '582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf', - '582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf', - ], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - opt_out_type: 'LDP', - num_items: 3, - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 23', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - description: 'Ad Account Id check in V5', - message: { - type: 'track', - event: 'random', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - apiVersion: 'newApi', - adAccountId: '', - conversionToken: 'conversionToken123', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: - 'Ad Account ID not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Ad Account ID not found. Aborting', - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'configuration', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pinterest_tag', - description: 'Test 24', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - description: 'Conversion Token check in V5', - message: { - type: 'track', - event: 'random', - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - apiVersion: 'newApi', - adAccountId: 'accountId123', - conversionToken: '', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendAsCustomEvent: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: - 'Conversion Token not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Conversion Token not found. Aborting', - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'configuration', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, { name: 'pinterest_tag', description: 'Test 25', @@ -3353,7 +11,7 @@ export const data = [ { message: { type: 'track', - event: 'custom event', + event: [1, 2, 3, 4], channel: 'web', sentAt: '2020-08-14T05:30:30.118Z', context: { @@ -3459,7 +117,7 @@ export const data = [ value: '27.5', order_id: '50314b8e9bcf000000000000', }, - event_name: 'custom event', + event_name: '1,2,3,4', }, JSON_ARRAY: {}, XML: {}, @@ -3483,90 +141,4 @@ export const data = [ }, }, }, - { - name: 'pinterest_tag', - description: 'Test 26', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - channel: 'web', - sentAt: '2020-08-14T05:30:30.118Z', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - ge: 'male', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - DestinationDefinition: { Config: { cdkV2Enabled: true } }, - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - apiVersion: 'newApi', - adAccountId: 'accountId123', - conversionToken: 'conversionToken123', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - sendAsCustomEvent: false, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: - 'event_name could not be mapped. Aborting.: Workflow: procWorkflow, Step: validateInputForTrack, ChildStep: undefined, OriginalError: event_name could not be mapped. Aborting.', - metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, - statTags: { - destType: 'PINTEREST_TAG', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'cdkV2', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, ]; diff --git a/test/integrations/destinations/pinterest_tag/step/data.ts b/test/integrations/destinations/pinterest_tag/step/data.ts index cbd0b243bb..cded8423b2 100644 --- a/test/integrations/destinations/pinterest_tag/step/data.ts +++ b/test/integrations/destinations/pinterest_tag/step/data.ts @@ -3396,4 +3396,162 @@ export const data = [ }, }, }, + { + name: 'pinterest_tag', + description: 'Test 26 : convert non string event name to string', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: [1, 2, 3, 4], + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + gender: 'non-binary', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + optOutType: 'LDP', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '429047995', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + action_source: 'web', + event_name: '1,2,3,4', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + ge: ['1b16b1df538ba12dc3f97edbb85caa7050d46c148134290feba80f8236c83db9'], + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + opt_out_type: 'LDP', + num_items: 3, + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; From 8bbae29a29e942dba154a5c72b9cc9ea2e11ad7c Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Mon, 18 Dec 2023 13:08:13 +0530 Subject: [PATCH 3/3] fix: small edit and adding test cases --- .../pinterest_tag/procWorkflow.yaml | 11 +- src/v0/destinations/pinterest_tag/utils.js | 4 +- .../pinterest_tag/processor/data.ts | 3557 ++++++++++++++++- .../destinations/pinterest_tag/step/data.ts | 158 - 4 files changed, 3564 insertions(+), 166 deletions(-) diff --git a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml index 724c53c83d..8a956e905c 100644 --- a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml +++ b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml @@ -9,6 +9,8 @@ bindings: path: ../../../../v0/util - name: removeUndefinedAndNullAndEmptyValues path: ../../../../v0/util + - name: validateEventName + path: ../../../../v0/util steps: - name: checkIfProcessed condition: .message.statusCode @@ -175,13 +177,13 @@ steps: name: eventNamesForOthers template: | let event = .message.event ?? .message.name; - let stringifiedEvent = event.toString(); - let eventInLowerCase = stringifiedEvent.toLowerCase(); + $.validateEventName(event); + let eventInLowerCase = event.toLowerCase(); let eventNames = .destination.Config.eventsMapping.(){.from === event}.to[] ?? []; eventNames = $.convertToSnakeCase(eventNames); eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? []; (eventNames.length === 0 && .destination.Config.sendAsCustomEvent) ? eventNames = ["custom"]; - eventNames.length === 0 ? eventNames = [event.toString()]; + eventNames.length === 0 ? eventNames = [event]; eventNames; - name: payload @@ -227,7 +229,6 @@ steps: name: buildResponseForProcessTransformationV5 description: build response using V5 API template: | - console.log(JSON.stringify($.outputs.payload)) $.outputs.payload.().({ "body": { "JSON": ., @@ -245,4 +246,4 @@ steps: }, "params": $.outputs.checkSendTestEventConfig, "files": {} - })[] + })[] \ No newline at end of file diff --git a/src/v0/destinations/pinterest_tag/utils.js b/src/v0/destinations/pinterest_tag/utils.js index ca9759a8ea..340fba498e 100644 --- a/src/v0/destinations/pinterest_tag/utils.js +++ b/src/v0/destinations/pinterest_tag/utils.js @@ -8,6 +8,7 @@ const { isDefined, getHashFromArrayWithDuplicate, removeUndefinedAndNullValues, + validateEventName, } = require('../../util'); const { COMMON_CONFIGS, CUSTOM_CONFIGS, API_VERSION } = require('./config'); @@ -166,10 +167,11 @@ const deduceTrackScreenEventName = (message, Config) => { let eventName; const { event, name } = message; const { eventsMapping, sendAsCustomEvent } = Config; - const trackEventOrScreenName = event.toString() || name.toString(); + const trackEventOrScreenName = event || name; if (!trackEventOrScreenName) { throw new InstrumentationError('event_name could not be mapped. Aborting'); } + validateEventName(trackEventOrScreenName); /* Step 1: If the event is not amongst the above list of ecommerce events, will look for diff --git a/test/integrations/destinations/pinterest_tag/processor/data.ts b/test/integrations/destinations/pinterest_tag/processor/data.ts index dab9faba16..65b33e7740 100644 --- a/test/integrations/destinations/pinterest_tag/processor/data.ts +++ b/test/integrations/destinations/pinterest_tag/processor/data.ts @@ -1,4 +1,3346 @@ export const data = [ + { + name: 'pinterest_tag', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + gender: 'non-binary', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + optOutType: 'LDP', + clickId: 'dummy_clickId', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + tagId: '123456789', + advertiserId: '429047995', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendAsTestEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: { test: true }, + body: { + JSON: { + action_source: 'web', + event_name: 'watch_video', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + click_id: 'dummy_clickId', + ge: ['1b16b1df538ba12dc3f97edbb85caa7050d46c148134290feba80f8236c83db9'], + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + opt_out_type: 'LDP', + num_items: 3, + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Order completed', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '429047995', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + action_source: 'web', + event_name: 'checkout', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + num_items: 3, + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'product added', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + product_id: '123', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '429047995', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_name: 'add_to_cart', + action_source: 'web', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + num_items: 2, + content_ids: ['123'], + contents: [{ quantity: 2, item_price: '25' }], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product List Filtered', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + destinationDefinition: { Config: { cdkV2Enabled: true } }, + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Advertiser Id not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Advertiser Id not found. Aborting', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product List Filtered', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '429047995', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + error: + 'It is required at least one of em, hashed_maids or pair of client_ip_address and client_user_agent: Workflow: procWorkflow, Step: validateUserFields, ChildStep: undefined, OriginalError: It is required at least one of em, hashed_maids or pair of client_ip_address and client_user_agent', + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + numOfItems: 2, + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '429047995', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_name: 'watch_video', + event_time: 1597383030, + action_source: 'web', + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + num_items: 2, + order_id: '50314b8e9bcf000000000000', + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + numOfItems: 2, + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Advertiser Id not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Advertiser Id not found. Aborting', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'group', + event: 'ABC Searched', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + numOfItems: 2, + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + enhancedMatch: true, + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'message type group is not supported: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message type group is not supported', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + channel: 'abc', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + numOfItems: 2, + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + error: + 'Action source must be one of app_android, app_ios, web, offline: Workflow: procWorkflow, Step: validateCommonFields, ChildStep: undefined, OriginalError: Action source must be one of app_android, app_ios, web, offline', + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'custom event', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + numOfItems: 2, + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_name: 'custom', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + action_source: 'web', + advertiser_id: '123456', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + num_items: 2, + order_id: '50314b8e9bcf000000000000', + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'ApplicationLoaded', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { path: '', referrer: '', search: '', title: '', url: '' }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + action_source: 'web', + event_name: 'page_visit', + app_id: '429047995', + advertiser_id: '123456', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'ApplicationLoaded', + category: 'test category', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { path: '', referrer: '', search: '', title: '', url: '' }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + action_source: 'web', + event_name: 'view_category', + app_id: '429047995', + advertiser_id: '123456', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'ApplicationLoaded', + category: 'test category', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123', adTrackingEnabled: true }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { path: '', referrer: '', search: '', title: '', url: '' }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_time: 1597383030, + opt_out: false, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + action_source: 'web', + event_name: 'view_category', + app_id: '429047995', + advertiser_id: '123456', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'ApplicationLoaded', + category: 'test category', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + ip: '127.0.0.0', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { adTrackingEnabled: false }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { path: '', referrer: '', search: '', title: '', url: '' }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_time: 1597383030, + opt_out: true, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + action_source: 'web', + event_name: 'view_category', + app_id: '429047995', + advertiser_id: '123456', + user_data: { + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + client_ip_address: '127.0.0.0', + client_user_agent: 'chrome', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'ApplicationLoaded', + category: 'test category', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + requestIP: '127.0.0.0', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + phone: 'Hashed phone', + gender: 'Hashed Gender', + dob: 'Hashed DB', + lastname: 'Hashed Lastname', + firstName: 'Hashed FirstName', + address: { + city: 'Hashed City', + state: 'Hashed State', + zip: 'Hashed Zip', + country: 'Hashed country', + }, + }, + device: { adTrackingEnabled: false, advertisingId: 'Hashed maids' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { path: '', referrer: '', search: '', title: '', url: '' }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: false, + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_time: 1597383030, + action_source: 'web', + opt_out: true, + event_name: 'view_category', + app_id: '429047995', + advertiser_id: '123456', + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + user_data: { + ph: ['Hashed phone'], + db: ['Hashed DB'], + ln: ['Hashed Lastname'], + fn: ['Hashed FirstName'], + ct: ['Hashed City'], + st: ['Hashed State'], + zp: ['Hashed Zip'], + country: ['Hashed country'], + hashed_maids: ['Hashed maids'], + ge: ['Hashed Gender'], + client_user_agent: 'chrome', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 15', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + name: 'ApplicationLoaded', + category: 'test category', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + requestIP: '127.0.0.0', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + phone: ['Hashed phone', 'Hashed phone1'], + gender: ['Hashed Gender', 'Hashed Gender1'], + dob: ['Hashed DB', 'Hashed DB1'], + lastname: ['Hashed Lastname', 'Hashed Lastname1'], + firstName: ['Hashed FirstName', 'Hashed FirstName1'], + address: { + city: ['Hashed City', 'Hashed City1'], + state: ['Hashed State', 'Hashed State1'], + zip: ['Hashed Zip', 'Hashed Zip1'], + country: ['Hashed country', 'Hashed country1'], + }, + }, + device: { adTrackingEnabled: false, advertisingId: 'Hashed maids' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { path: '', referrer: '', search: '', title: '', url: '' }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: false, + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_time: 1597383030, + action_source: 'web', + opt_out: true, + event_name: 'view_category', + app_id: '429047995', + advertiser_id: '123456', + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + user_data: { + ph: ['Hashed phone', 'Hashed phone1'], + db: ['Hashed DB', 'Hashed DB1'], + ln: ['Hashed Lastname', 'Hashed Lastname1'], + fn: ['Hashed FirstName', 'Hashed FirstName1'], + ct: ['Hashed City', 'Hashed City1'], + st: ['Hashed State', 'Hashed State1'], + zp: ['Hashed Zip', 'Hashed Zip1'], + country: ['Hashed country', 'Hashed country1'], + hashed_maids: ['Hashed maids'], + ge: ['Hashed Gender', 'Hashed Gender1'], + client_user_agent: 'chrome', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + name: 'Test Tool', + type: 'page', + sentAt: '2023-02-01T00:00:00.379Z', + userId: '', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + version: '2.22.3', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'https://www.abc.com/s598907', + path: '/test-path/s598907', + title: 'Test Tool + Reviews | Rudderstack', + search: '', + tab_url: 'https://www.abc.com/s598907', + referrer: '$direct', + initial_referrer: '$direct', + referring_domain: '', + initial_referring_domain: '', + }, + locale: 'en-US', + screen: { + width: 1024, + height: 1024, + density: 1, + innerWidth: 1024, + innerHeight: 1024, + }, + traits: {}, + library: { name: 'RudderLabs JavaScript SDK', version: '2.22.3' }, + campaign: {}, + doNotSell: false, + sessionId: 1675209600203, + userAgent: + 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/109.0.5414.101 Safari/537.36', + gaClientId: { + integrations: { + 'Google Ads': { gclid: '' }, + 'Google Analytics': { clientId: '1518934611.1234569600' }, + }, + }, + sessionStart: true, + }, + rudderId: '7291a10f-e7dd-49f9-94ce-0154f53897y6', + messageId: '1c77a616-13a7-4a2e-a8e7-e1a0971897y6', + timestamp: '2023-02-01T12:47:30.030Z', + properties: { + sku: '45790-32', + url: 'https://www.abc.com/23rty', + name: 'Test Tool', + path: '/test-path/tool', + email: '', + title: 'Test Tool + Reviews | Rudderstack', + review: { reviewCount: 2, averageReview: 5, reviewContentID: ['238300132'] }, + search: '', + tab_url: 'https://www.abc/com', + pageInfo: { + pageId: 's592897', + category: { + pageType: 'product', + subCategory: 'Dining & Kitchen Furniture', + pageTemplate: 'product detail grouper', + primaryCategory: 'Furniture', + }, + brandType: 'new brand', + }, + referrer: '', + subCategory: 'Dining & Kitchen Furniture', + primaryCategory: 'Furniture', + initial_referrer: '$direct', + referring_domain: '', + initial_referring_domain: '', + }, + receivedAt: '2023-02-01T12:47:30.038Z', + request_ip: '66.249.72.218', + anonymousId: 'a61c77a6-1613-474a-aee8-e7e1a0971047', + integrations: { All: true }, + originalTimestamp: '2023-02-01T00:00:00.371Z', + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123478671210', + sendingUnHashedData: false, + enableDeduplication: false, + eventsMapping: [ + { from: 'Product Added', to: 'AddToCart' }, + { from: 'Order Completed', to: 'Checkout' }, + { from: 'Product Viewed', to: 'PageVisit' }, + { from: 'Lead', to: 'Lead' }, + { from: 'Signup', to: 'Signup' }, + ], + enhancedMatch: true, + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + body: { + JSON: { + event_time: 1675255650, + event_source_url: 'https://www.abc.com/s598907', + action_source: 'web', + app_name: 'RudderLabs JavaScript SDK', + app_version: '2.22.3', + language: 'en-US', + event_id: '1c77a616-13a7-4a2e-a8e7-e1a0971897y6', + advertiser_id: '123478671210', + user_data: { + client_ip_address: '66.249.72.218', + client_user_agent: + 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/109.0.5414.101 Safari/537.36', + }, + event_name: 'page_visit', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 17', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'test', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + sku: '1234', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_name: 'custom', + event_time: 1597383030, + action_source: 'web', + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '123456', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + num_items: 0, + content_ids: ['1234'], + contents: [{ quantity: 1, item_price: 'undefined' }], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 18', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'custom event', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + sku: '1234', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + ], + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ct.pinterest.com/events/v3', + headers: { 'Content-Type': 'application/json' }, + params: {}, + body: { + JSON: { + event_name: 'custom', + event_time: 1597383030, + action_source: 'web', + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + advertiser_id: '123456', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + num_items: 1, + content_ids: ['507f1f77bcf86cd799439011'], + contents: [{ quantity: 1, item_price: '19' }], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 19', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'custom event', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + advertiserId: '123456', + appId: '429047995', + sendingUnHashedData: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + enhancedMatch: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + body: { + FORM: {}, + JSON: { + action_source: 'web', + advertiser_id: '123456', + app_id: '429047995', + custom_data: { + contents: [{ item_price: 'undefined', quantity: 1 }], + currency: 'USD', + num_items: 0, + order_id: '50314b8e9bcf000000000000', + value: '27.5', + }, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + event_name: 'custom event', + event_time: 1597383030, + user_data: { + client_user_agent: 'chrome', + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://ct.pinterest.com/events/v3', + files: {}, + headers: { 'Content-Type': 'application/json' }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 20', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'Track call with v5 Api version and send external_id toggle enabled', + message: { + type: 'track', + event: 'ABC Searched', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + optOutType: 'LDP', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: 'accountId123', + conversionToken: 'conversionToken123', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendExternalId: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer conversionToken123', + }, + params: {}, + body: { + JSON: { + action_source: 'web', + event_name: 'watch_video', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + external_id: [ + '3217d71a74c219d6e31e28267b313a7ceb6a2c032db1a091c9416b25b2ae2bc8', + ], + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + opt_out_type: 'LDP', + num_items: 3, + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 21', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'Custom event with v5 Api version', + message: { + type: 'track', + event: 'random', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + optOutType: 'LDP', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: 'accountId123', + conversionToken: 'conversionToken123', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer conversionToken123', + }, + params: {}, + body: { + JSON: { + action_source: 'web', + event_name: 'custom', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + user_data: { + em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], + ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], + ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], + fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], + ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], + st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], + zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], + country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + opt_out_type: 'LDP', + num_items: 3, + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 22', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + 'Custom event with v5 Api version, with unhashed User Data and the values are an array of strings', + message: { + type: 'track', + event: 'random', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: ['abc@gmail.com', 'def@gmail.com'], + phone: ['+1234589947', '+1234589948'], + ge: ['male', 'male'], + db: ['19950715', '19970615'], + lastname: ['Rudderlabs', 'Xu'], + firstName: ['Test', 'Alex'], + address: { + city: ['Kolkata', 'Mumbai'], + state: ['WB', 'MH'], + zip: ['700114', '700115'], + country: ['IN', 'IN'], + }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + optOutType: 'LDP', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: 'accountId123', + conversionToken: 'conversionToken123', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer conversionToken123', + }, + params: {}, + body: { + JSON: { + action_source: 'web', + event_name: 'custom', + event_time: 1597383030, + event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + app_id: '429047995', + user_data: { + em: [ + '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + 'c392e50ebeca7bea4405e9c545023451ac56620031f81263f681269bde14218b', + ], + ph: [ + 'd164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b', + '22bdde2594851294f2a6f4c34af704e68b398b03129ea9ceb58f0ffe33f6db52', + ], + ln: [ + 'dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251', + '9c2f138690fca4890c3c4a6691610fbbbdf32091cc001f7355cfdf574baa52b9', + ], + fn: [ + '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', + '4135aa9dc1b842a653dea846903ddb95bfb8c5a10c504a7fa16e10bc31d1fdf0', + ], + ct: [ + '6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85', + 'd209bcc17778fd19fd2bc0c99a3868bf011da5162d3a75037a605768ebc276e2', + ], + st: [ + '3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd', + '1b0316ed1cfed044035c55363e02ccafab26d66b1c2746b94d17285f043324aa', + ], + zp: [ + '1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c', + '4d6755aa1e85517191f06cc91448696c173e1195ae51f94a1670116ac7b5c47b', + ], + country: [ + '582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf', + '582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf', + ], + hashed_maids: [ + '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', + ], + client_user_agent: 'chrome', + }, + custom_data: { + currency: 'USD', + value: '27.5', + order_id: '50314b8e9bcf000000000000', + opt_out_type: 'LDP', + num_items: 3, + content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + contents: [ + { quantity: 1, item_price: '19' }, + { quantity: 2, item_price: '3' }, + ], + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 23', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'Ad Account Id check in V5', + message: { + type: 'track', + event: 'random', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: '', + conversionToken: 'conversionToken123', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Ad Account ID not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Ad Account ID not found. Aborting', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 24', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'Conversion Token check in V5', + message: { + type: 'track', + event: 'random', + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: 'accountId123', + conversionToken: '', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendAsCustomEvent: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Conversion Token not found. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Conversion Token not found. Aborting', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, { name: 'pinterest_tag', description: 'Test 25', @@ -11,7 +3353,7 @@ export const data = [ { message: { type: 'track', - event: [1, 2, 3, 4], + event: 'custom event', channel: 'web', sentAt: '2020-08-14T05:30:30.118Z', context: { @@ -117,7 +3459,7 @@ export const data = [ value: '27.5', order_id: '50314b8e9bcf000000000000', }, - event_name: '1,2,3,4', + event_name: 'custom event', }, JSON_ARRAY: {}, XML: {}, @@ -141,4 +3483,215 @@ export const data = [ }, }, }, + { + name: 'pinterest_tag', + description: 'Test 26', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + channel: 'web', + sentAt: '2020-08-14T05:30:30.118Z', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: 'accountId123', + conversionToken: 'conversionToken123', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendAsCustomEvent: false, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'event_name could not be mapped. Aborting.: Workflow: procWorkflow, Step: validateInputForTrack, ChildStep: undefined, OriginalError: event_name could not be mapped. Aborting.', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'pinterest_tag', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'Any other format of event except string should be aborted', + message: { + type: 'track', + event: [1, 2, 3], + sentAt: '2020-08-14T05:30:30.118Z', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, + }, + device: { advertisingId: 'abc123' }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + requestIP: '123.0.0.0', + optOutType: 'LDP', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { All: true }, + }, + destination: { + DestinationDefinition: { Config: { cdkV2Enabled: true } }, + ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', + Name: 'PINTEREST_TAG', + Config: { + sendAsTestEvent: false, + tagId: '123456789', + apiVersion: 'newApi', + adAccountId: 'accountId123', + conversionToken: 'conversionToken123', + appId: '429047995', + enhancedMatch: true, + enableDeduplication: true, + deduplicationKey: 'messageId', + sendingUnHashedData: true, + sendExternalId: true, + customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], + eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], + }, + Enabled: true, + Transformations: [], + }, + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Event is a required field and should be a string: Workflow: procWorkflow, Step: eventNames, ChildStep: undefined, OriginalError: Event is a required field and should be a string', + metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' }, + statTags: { + destType: 'PINTEREST_TAG', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/pinterest_tag/step/data.ts b/test/integrations/destinations/pinterest_tag/step/data.ts index cded8423b2..cbd0b243bb 100644 --- a/test/integrations/destinations/pinterest_tag/step/data.ts +++ b/test/integrations/destinations/pinterest_tag/step/data.ts @@ -3396,162 +3396,4 @@ export const data = [ }, }, }, - { - name: 'pinterest_tag', - description: 'Test 26 : convert non string event name to string', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'track', - event: [1, 2, 3, 4], - sentAt: '2020-08-14T05:30:30.118Z', - channel: 'web', - context: { - source: 'test', - userAgent: 'chrome', - traits: { - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - email: 'abc@gmail.com', - phone: '+1234589947', - gender: 'non-binary', - db: '19950715', - lastname: 'Rudderlabs', - firstName: 'Test', - address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' }, - }, - device: { advertisingId: 'abc123' }, - library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' }, - }, - messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - timestamp: '2020-08-14T05:30:30.118Z', - properties: { - tax: 2, - total: 27.5, - coupon: 'hasbros', - revenue: 48, - price: 25, - quantity: 2, - currency: 'USD', - discount: 2.5, - order_id: '50314b8e9bcf000000000000', - requestIP: '123.0.0.0', - optOutType: 'LDP', - products: [ - { - sku: '45790-32', - url: 'https://www.example.com/product/path', - name: 'Monopoly: 3rd Edition', - price: 19, - category: 'Games', - quantity: 1, - image_url: 'https:///www.example.com/product/path.jpg', - product_id: '507f1f77bcf86cd799439011', - }, - { - sku: '46493-32', - name: 'Uno Card Game', - price: 3, - category: 'Games', - quantity: 2, - product_id: '505bd76785ebb509fc183733', - }, - ], - shipping: 3, - subtotal: 22.5, - affiliation: 'Google Store', - checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - }, - anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', - integrations: { All: true }, - }, - destination: { - ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', - Name: 'PINTEREST_TAG', - Config: { - sendAsTestEvent: false, - tagId: '123456789', - advertiserId: '429047995', - appId: '429047995', - enhancedMatch: true, - enableDeduplication: true, - deduplicationKey: 'messageId', - sendingUnHashedData: true, - customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }], - eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }], - }, - Enabled: true, - Transformations: [], - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://ct.pinterest.com/events/v3', - headers: { 'Content-Type': 'application/json' }, - params: {}, - body: { - JSON: { - action_source: 'web', - event_name: '1,2,3,4', - event_time: 1597383030, - event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', - app_id: '429047995', - advertiser_id: '429047995', - user_data: { - em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'], - ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'], - ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'], - fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'], - ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'], - st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'], - zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'], - country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'], - hashed_maids: [ - '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090', - ], - client_user_agent: 'chrome', - ge: ['1b16b1df538ba12dc3f97edbb85caa7050d46c148134290feba80f8236c83db9'], - }, - custom_data: { - currency: 'USD', - value: '27.5', - order_id: '50314b8e9bcf000000000000', - opt_out_type: 'LDP', - num_items: 3, - content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], - contents: [ - { quantity: 1, item_price: '19' }, - { quantity: 2, item_price: '3' }, - ], - }, - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, ];