diff --git a/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts index def947b864..b37e93995d 100644 --- a/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts @@ -1,7 +1,14 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { overrideDestination, generateTrackPayload } from '../../../testUtils'; +import { + overrideDestination, + generateTrackPayload, + generateMetadata, + transformResultBuilder, +} from '../../../testUtils'; +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; -const commonDestination = { +const commonDestination: Destination = { ID: '12335', Name: 'sample-destination', DestinationDefinition: { @@ -80,10 +87,13 @@ const commonPropertiesWithoutProductArray = { const commonTimestamp = new Date('2023-10-14'); -export const configLevelFeaturesTestData = [ +export const configLevelFeaturesTestData: ProcessorTestData[] = [ { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', description: 'config feature : limitedDataUSage switched on', + scenario: 'configuration', + successCriteria: 'Response should contain limitedDataUSage related fields', feature: 'processor', module: 'destination', version: 'v0', @@ -100,6 +110,7 @@ export const configLevelFeaturesTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -110,36 +121,35 @@ export const configLevelFeaturesTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","data_processing_options":"val1","data_processing_options_country":"val2","data_processing_options_state":"val3","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","data_processing_options":"val1","data_processing_options_country":"val2","data_processing_options_state":"val3","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', + scenario: 'configuration', description: 'config feature : ContentCategoryMapping table is filled up, and category is passed with properties', + successCriteria: 'Response should contain category mapped to newClothing', feature: 'processor', module: 'destination', version: 'v0', @@ -156,6 +166,7 @@ export const configLevelFeaturesTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -166,36 +177,34 @@ export const configLevelFeaturesTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","data_processing_options":"val1","data_processing_options_country":"val2","data_processing_options_state":"val3","custom_data":{"category":"clothing","quantity":10,"value":100,"product_id":"12345","content_ids":["clothing"],"content_type":"newClothing","contents":[{"id":"clothing","quantity":1}],"content_category":"clothing","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","data_processing_options":"val1","data_processing_options_country":"val2","data_processing_options_state":"val3","custom_data":{"category":"clothing","quantity":10,"value":100,"product_id":"12345","content_ids":["clothing"],"content_type":"newClothing","contents":[{"id":"clothing","quantity":1}],"content_category":"clothing","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', description: 'config feature : ContentCategoryMapping table is filled up, and category is passed with properties along with contentType via integrations object', + scenario: 'configuration', successCriteria: 'contentType should be used from integrations object', feature: 'processor', module: 'destination', @@ -217,6 +226,7 @@ export const configLevelFeaturesTestData = [ }, }, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -227,36 +237,34 @@ export const configLevelFeaturesTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"clothing","quantity":10,"value":100,"product_id":"12345","content_ids":["clothing"],"content_type":"newClothingFromIntegrationObject","contents":[{"id":"clothing","quantity":1}],"content_category":"clothing","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"clothing","quantity":10,"value":100,"product_id":"12345","content_ids":["clothing"],"content_type":"newClothingFromIntegrationObject","contents":[{"id":"clothing","quantity":1}],"content_category":"clothing","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', description: 'config feature : Config mapped whiteList and blackListed properties with marked hashed within integrations object, along with default pii property email in the properties', + scenario: 'configuration', successCriteria: 'BlackListed properties should not be hashed and default pii property should be deleted from the properties', feature: 'processor', @@ -279,6 +287,7 @@ export const configLevelFeaturesTestData = [ }, }, }), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { whitelistPiiProperties: [ { @@ -303,36 +312,34 @@ export const configLevelFeaturesTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"default-user-id","em":"abc@gmail.com","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"default-user-id","em":"abc@gmail.com","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', description: 'config feature : Config mapped whiteList and blackListed properties without marked hashed within integrations object but marked hashed true from UI, along with default pii property email in the properties', + scenario: 'configuration', successCriteria: 'BlackListed properties should be hashed and default pii property should be deleted from the properties', feature: 'processor', @@ -350,6 +357,7 @@ export const configLevelFeaturesTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { whitelistPiiProperties: [ { @@ -376,36 +384,34 @@ export const configLevelFeaturesTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"528e5290f8ff0eb0325f0472b9c1a9ef4fac0b02ff6094b64d9382af4a10444b","blacklistProp3":"bac8d4414984861d5199b7a97699c728bee36c4084299b2ca905434cf65d8944","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"528e5290f8ff0eb0325f0472b9c1a9ef4fac0b02ff6094b64d9382af4a10444b","blacklistProp3":"bac8d4414984861d5199b7a97699c728bee36c4084299b2ca905434cf65d8944","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', description: 'config feature : Config mapped whiteList and blackListed properties marked hashed within integrations object but marked hashed true from UI, along with default pii property email in the properties', + scenario: 'configuration', successCriteria: 'BlackListed properties should not be hashed again and default pii property should be deleted from the properties', feature: 'processor', @@ -428,6 +434,7 @@ export const configLevelFeaturesTestData = [ }, }, }), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { whitelistPiiProperties: [ { @@ -454,27 +461,23 @@ export const configLevelFeaturesTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"default-user-id","em":"abc@gmail.com","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"default-user-id","em":"abc@gmail.com","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/facebook_pixel/processor/data1.ts b/test/integrations/destinations/facebook_pixel/processor/data1.ts deleted file mode 100644 index 557bc7066c..0000000000 --- a/test/integrations/destinations/facebook_pixel/processor/data1.ts +++ /dev/null @@ -1,6463 +0,0 @@ -import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; - -export const mockFns = (_) => { - // @ts-ignore - jest.useFakeTimers().setSystemTime(new Date('2023-10-15')); -}; - -export const data = [ - { - name: 'facebook_pixel', - description: 'Test 0', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - channel: 'mobile', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: ' aBc@gmail.com ', - address: { - zip: 1234, - }, - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T00:00:00.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - removeExternalId: true, - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1697221800,"action_source":"app","custom_data":{"additional_bet_index":0,"value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 1', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: ' aBc@gmail.com ', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'group', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'Message type group not supported', - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 2', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - traits: { - name: 'Test', - }, - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - ip: '0.0.0.0', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - properties: { - plan: 'standard plan', - name: 'rudder test', - }, - type: 'identify', - messageId: '84e26acc-56a5-4835-8233-591137fca468', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '123456', - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: - 'For identify events, "Advanced Mapping" configuration must be enabled on the RudderStack dashboard', - statTags: { - errorCategory: 'dataValidation', - errorType: 'configuration', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - traits: { - name: 'Rudder Test', - email: 'abc@gmail.com', - firstname: 'Rudder', - lastname: 'Test', - phone: 9000000000, - gender: 'female', - }, - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - ip: '0.0.0.0', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - properties: { - plan: 'standard plan', - name: 'rudder test', - }, - type: 'identify', - messageId: '84e26acc-56a5-4835-8233-591137fca468', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '123456', - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: true, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ph":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","ge":"252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111","ln":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","fn":"2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"identify","event_time":1697278611,"event_id":"84e26acc-56a5-4835-8233-591137fca468","action_source":"website"}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 4', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - traits: { - name: 'Rudder Test', - email: 'abc@gmail.com', - phone: 9000000000, - address: { - postalCode: 1234, - }, - gender: 'female', - }, - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - ip: '0.0.0.0', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - properties: { - plan: 'standard plan', - name: 'rudder test', - }, - type: 'identify', - messageId: '84e26acc-56a5-4835-8233-591137fca468', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '123456', - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: true, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ph":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","ge":"252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36","fn":"2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747","ln":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25"},"event_name":"identify","event_time":1697278611,"event_id":"84e26acc-56a5-4835-8233-591137fca468","action_source":"website"}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 5', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - email: 'abc@gmail.com', - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 6', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - email: 'abc@gmail.com', - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 7', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - email: 'abc@gmail.com', - phone: 9000000000, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: 'phone', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 8', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - email: 'abc@gmail.com', - phone: 9000000000, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: 'phone', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","phone":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 9', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - ip: '0.0.0.0', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'page', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - timestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - path: '/abc', - referrer: 'xyz', - search: 'def', - title: 'ghi', - url: 'jkl', - }, - integrations: { - All: true, - }, - name: 'ApplicationLoaded', - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: 'phone', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Viewed page ApplicationLoaded","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 10', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - ip: '0.0.0.0', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'page', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - path: '/abc', - referrer: 'xyz', - search: 'def', - title: 'ghi', - url: 'jkl', - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: 'phone', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Viewed a page","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 11', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product list viewed', - properties: { - phone: 9000000000, - email: 'abc@gmail.com', - category: 'cat 1', - list_id: '1234', - filters: [ - { - type: 'department', - value: 'beauty', - }, - { - type: 'price', - value: 'under', - }, - ], - sorts: [ - { - type: 'price', - value: 'desc', - }, - ], - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: 'phone', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"phone":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","email":"abc@gmail.com","category":"cat 1","list_id":"1234","filters[0].type":"department","filters[0].value":"beauty","filters[1].type":"price","filters[1].value":"under","sorts[0].type":"price","sorts[0].value":"desc","testDimension":true,"testMetric":true,"content_ids":["cat 1"],"content_type":"product_group","contents":[{"id":"cat 1","quantity":1}],"content_category":"cat 1","value":0,"currency":"USD"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 12', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product list viewed', - properties: { - phone: 9000000000, - email: 'abc@gmail.com', - category: 'cat 1', - list_id: '1234', - filters: [ - { - type: 'department', - value: 'beauty', - }, - { - type: 'price', - value: 'under', - }, - ], - sorts: [ - { - type: 'price', - value: 'desc', - }, - ], - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"category":"cat 1","list_id":"1234","filters[0].type":"department","filters[0].value":"beauty","filters[1].type":"price","filters[1].value":"under","sorts[0].type":"price","sorts[0].value":"desc","testDimension":true,"testMetric":true,"content_ids":["cat 1"],"content_type":"product_group","contents":[{"id":"cat 1","quantity":1}],"content_category":"cat 1","value":0,"currency":"USD"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 13', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product list viewed', - properties: { - email: 'abc@gmail.com', - quantity: 2, - category: 'cat 1', - list_id: '1234', - contentName: 'nutrition', - value: 18.9, - filters: [ - { - type: 'department', - value: 'beauty', - }, - { - type: 'price', - value: 'under', - }, - ], - sorts: [ - { - type: 'price', - value: 'desc', - }, - ], - products: [ - { - product_id: '507f1f77bcf86cd799439011', - productDimension: 'My Product Dimension', - productMetric: 'My Product Metric', - position: 10, - }, - { - product_id: '507f1f77bcf86cdef799439011', - productDimension: 'My Product Dimension1', - productMetric: 'My Product Metric1', - position: -10, - }, - ], - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"quantity":2,"category":"cat 1","list_id":"1234","contentName":"nutrition","value":18.9,"filters[0].type":"department","filters[0].value":"beauty","filters[1].type":"price","filters[1].value":"under","sorts[0].type":"price","sorts[0].value":"desc","products[0].product_id":"507f1f77bcf86cd799439011","products[0].productDimension":"My Product Dimension","products[0].productMetric":"My Product Metric","products[0].position":10,"products[1].product_id":"507f1f77bcf86cdef799439011","products[1].productDimension":"My Product Dimension1","products[1].productMetric":"My Product Metric1","products[1].position":-10,"testDimension":true,"testMetric":true,"content_ids":["507f1f77bcf86cd799439011","507f1f77bcf86cdef799439011"],"content_type":"product","contents":[{"id":"507f1f77bcf86cd799439011","quantity":2},{"id":"507f1f77bcf86cdef799439011","quantity":2}],"content_category":"cat 1","content_name":"nutrition","currency":"USD"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 14', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'my product list', - properties: { - email: 'abc@gmail.com', - quantity: 2, - category: 'cat 1', - list_id: '1234', - filters: [ - { - type: 'department', - value: 'beauty', - }, - { - type: 'price', - value: 'under', - }, - ], - sorts: [ - { - type: 'price', - value: 'desc', - }, - ], - products: [ - { - product_id: '507f1f77bcf86cd799439011', - productDimension: 'My Product Dimension', - productMetric: 'My Product Metric', - position: 10, - }, - { - product_id: '507f1f77bcf86cdef799439011', - productDimension: 'My Product Dimension1', - productMetric: 'My Product Metric1', - position: -10, - }, - ], - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - removeExternalId: false, - eventsToEvents: [ - { - from: 'My product list', - to: 'ViewContent', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: 'list_id', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"quantity":2,"category":"cat 1","list_id":"1234","filters[0].type":"department","filters[0].value":"beauty","filters[1].type":"price","filters[1].value":"under","sorts[0].type":"price","sorts[0].value":"desc","products[0].product_id":"507f1f77bcf86cd799439011","products[0].productDimension":"My Product Dimension","products[0].productMetric":"My Product Metric","products[0].position":10,"products[1].product_id":"507f1f77bcf86cdef799439011","products[1].productDimension":"My Product Dimension1","products[1].productMetric":"My Product Metric1","products[1].position":-10,"testDimension":true,"testMetric":true,"content_ids":["507f1f77bcf86cd799439011","507f1f77bcf86cdef799439011"],"content_type":"product","contents":[{"id":"507f1f77bcf86cd799439011","quantity":2},{"id":"507f1f77bcf86cdef799439011","quantity":2}],"content_category":"cat 1","value":0,"currency":"USD"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 15', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product viewed', - properties: { - currency: 'CAD', - quantity: 1, - price: 24.75, - name: 'my product 1', - category: 'clothing', - sku: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - removeExternalId: true, - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","quantity":1,"price":24.75,"name":"my product 1","category":"clothing","sku":"p-298","testDimension":true,"testMetric":true,"position":4.5,"content_ids":["p-298"],"content_type":"product","content_name":"my product 1","content_category":"clothing","value":24.75,"contents":[{"id":"p-298","quantity":1,"item_price":24.75}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 16', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product added', - properties: { - currency: 'CAD', - quantity: 1, - value: 24.75, - category: 'cat 1', - id: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - removeExternalId: false, - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.value', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"AddToCart","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","quantity":1,"value":24.75,"category":"cat 1","id":"p-298","testDimension":true,"testMetric":true,"position":4.5,"content_ids":["p-298"],"content_type":"product","content_name":"","content_category":"cat 1","contents":[{"id":"p-298","quantity":1}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 17', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'order completed', - properties: { - order_id: 'rudderstackorder1', - total: 99.99, - revenue: 12.24, - shipping: 13.99, - tax: 20.99, - currency: 'INR', - contentName: 'all about nutrition', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 3, - price: 24.75, - name: 'other product', - sku: 'p-299', - }, - ], - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Purchase","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"order_id":"rudderstackorder1","total":99.99,"revenue":12.24,"shipping":13.99,"tax":20.99,"currency":"INR","contentName":"all about nutrition","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[1].quantity":3,"products[1].price":24.75,"products[1].name":"other product","products[1].sku":"p-299","content_ids":["p-298","p-299"],"content_type":"product","value":12.24,"contents":[{"id":"p-298","quantity":1,"item_price":24.75},{"id":"p-299","quantity":3,"item_price":24.75}],"num_items":2,"content_name":"all about nutrition"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 18', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'checkout started', - properties: { - currency: 'CAD', - category: 'clothing', - contentName: 'abc', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 1, - price: 24.75, - name: 'my product 2', - sku: 'p-299', - }, - ], - step: 1, - paymentMethod: 'Visa', - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: 'contentName', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"InitiateCheckout","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","category":"clothing","contentName":"abc","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[1].quantity":1,"products[1].price":24.75,"products[1].name":"my product 2","products[1].sku":"p-299","step":1,"paymentMethod":"Visa","testDimension":true,"testMetric":true,"content_category":"clothing","content_ids":["p-298","p-299"],"content_type":"product","value":0,"contents":[{"id":"p-298","quantity":1,"item_price":24.75},{"id":"p-299","quantity":1,"item_price":24.75}],"num_items":2}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 19', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - dataProcessingOptions: [['LDU'], 1, 1000], - fbc: 'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890', - fbp: 'fb.1.1554763741205.234567890', - fb_login_id: 'fb_id', - lead_id: 'lead_id', - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUSage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","fbc":"fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890","fbp":"fb.1.1554763741205.234567890","lead_id":"lead_id","fb_login_id":"fb_id"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","data_processing_options":["LDU"],"data_processing_options_country":1,"data_processing_options_state":1000,"custom_data":{"additional_bet_index":0,"value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 20', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - dataProcessingOptions: [['LDU'], 1, 1000], - fbc: 'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890', - fbp: 'fb.1.1554763741205.234567890', - fb_login_id: 'fb_id', - lead_id: 'lead_id', - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUSage: false, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","fbc":"fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890","fbp":"fb.1.1554763741205.234567890","lead_id":"lead_id","fb_login_id":"fb_id"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"value":400}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 21', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'products searched', - properties: { - product_id: 'p-298', - quantity: 2, - price: 18.9, - category: 'health', - value: 18.9, - query: 'HDMI cable', - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Search","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"product_id":"p-298","quantity":2,"price":18.9,"category":"health","value":18.9,"query":"HDMI cable","content_ids":["p-298"],"content_category":"health","contents":[{"id":"p-298","quantity":2,"item_price":18.9}],"search_string":"HDMI cable","currency":"USD"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 22', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'products searched', - properties: { - query: 'HDMI cable', - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - testDestination: true, - testEventCode: 'TEST1001', - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Search","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"query":"HDMI cable","content_ids":[],"content_category":"","value":0,"contents":[],"search_string":"HDMI cable","currency":"USD"}}', - ], - test_event_code: 'TEST1001', - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 23', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - ip: '0.0.0.0', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'page', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - path: '/abc', - referrer: 'xyz', - search: 'def', - title: 'ghi', - url: 'jkl', - }, - integrations: { - All: true, - }, - name: 'ApplicationLoaded', - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - standardPageCall: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: 'phone', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: 'url', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: 'email', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"PageView","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 24', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'track page', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: 'track page', - to: 'PageView', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: 'additional_bet_index', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"PageView","event_time":1697278611,"action_source":"other","custom_data":{"revenue":400,"additional_bet_index":0}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 25', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'my product list', - properties: { - email: 'abc@gmail.com', - quantity: 2, - category: 'cat 1', - list_id: '1234', - filters: [ - { - type: 'department', - value: 'beauty', - }, - { - type: 'price', - value: 'under', - }, - ], - sorts: [ - { - type: 'price', - value: 'desc', - }, - ], - products: [ - { - product_id: '507f1f77bcf86cd799439011', - productDimension: 'My Product Dimension', - productMetric: 'My Product Metric', - position: 10, - }, - { - product_id: '507f1f77bcf86cdef799439011', - productDimension: 'My Product Dimension1', - productMetric: 'My Product Metric1', - position: -10, - }, - ], - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: 'My product list', - to: 'Schedule', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: 'list_id', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Schedule","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"quantity":2,"category":"cat 1","list_id":"1234","filters[0].type":"department","filters[0].value":"beauty","filters[1].type":"price","filters[1].value":"under","sorts[0].type":"price","sorts[0].value":"desc","products[0].product_id":"507f1f77bcf86cd799439011","products[0].productDimension":"My Product Dimension","products[0].productMetric":"My Product Metric","products[0].position":10,"products[1].product_id":"507f1f77bcf86cdef799439011","products[1].productDimension":"My Product Dimension1","products[1].productMetric":"My Product Metric1","products[1].position":-10,"testDimension":true,"testMetric":true}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 26', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: "'event' is required", - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 27', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product added', - properties: { - currency: 'CAD', - quantity: 1, - value: '35.753', - category: 'cat 1', - id: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.value', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"AddToCart","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","quantity":1,"value":35.75,"category":"cat 1","id":"p-298","testDimension":true,"testMetric":true,"position":4.5,"content_ids":["p-298"],"content_type":"product","content_name":"","content_category":"cat 1","contents":[{"id":"p-298","quantity":1}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 28', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product added', - properties: { - currency: 'CAD', - quantity: 1, - value: '35.7A3', - category: 'cat 1', - id: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.value', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"AddToCart","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","quantity":1,"value":35.7,"category":"cat 1","id":"p-298","testDimension":true,"testMetric":true,"position":4.5,"content_ids":["p-298"],"content_type":"product","content_name":"","content_category":"cat 1","contents":[{"id":"p-298","quantity":1}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 29', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product added', - properties: { - currency: 'CAD', - quantity: 1, - value: 'ABC', - category: 'cat 1', - id: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.value', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'Revenue could not be converted to number', - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 30', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'order completed', - properties: { - category: ['clothing', 'fishing'], - order_id: 'rudderstackorder1', - total: 99.99, - revenue: 12.24, - shipping: 13.99, - tax: 20.99, - currency: 'INR', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 3, - price: 24.75, - name: 'other product', - sku: 'p-299', - }, - ], - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Purchase","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"category[0]":"clothing","category[1]":"fishing","order_id":"rudderstackorder1","total":99.99,"revenue":12.24,"shipping":13.99,"tax":20.99,"currency":"INR","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[1].quantity":3,"products[1].price":24.75,"products[1].name":"other product","products[1].sku":"p-299","content_category":"clothing,fishing","content_ids":["p-298","p-299"],"content_type":"product","value":12.24,"contents":[{"id":"p-298","quantity":1,"item_price":24.75},{"id":"p-299","quantity":3,"item_price":24.75}],"num_items":2}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 31', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'order completed', - properties: { - category: 100, - order_id: 'rudderstackorder1', - total: 99.99, - revenue: 12.24, - shipping: 13.99, - tax: 20.99, - currency: 'INR', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 3, - price: 24.75, - name: 'other product', - sku: 'p-299', - }, - ], - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Purchase","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"category":100,"order_id":"rudderstackorder1","total":99.99,"revenue":12.24,"shipping":13.99,"tax":20.99,"currency":"INR","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[1].quantity":3,"products[1].price":24.75,"products[1].name":"other product","products[1].sku":"p-299","content_category":"100","content_ids":["p-298","p-299"],"content_type":"product","value":12.24,"contents":[{"id":"p-298","quantity":1,"item_price":24.75},{"id":"p-299","quantity":3,"item_price":24.75}],"num_items":2}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 32', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'order completed', - properties: { - category: { - category1: '1', - }, - order_id: 'rudderstackorder1', - total: 99.99, - revenue: 12.24, - shipping: 13.99, - tax: 20.99, - currency: 'INR', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 3, - price: 24.75, - name: 'other product', - sku: 'p-299', - }, - ], - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: "'properties.category' must be either be a string or an array", - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 33', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2023-10-14T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: 'spin_result', - to: 'Schedule', - }, - { - to: 'Schedule', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"6dc8118ec743f5f3b758939714193f547f4a674c68757fa80d7c9564dc093b0a","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"Schedule","event_time":1697278611,"action_source":"other","custom_data":{"revenue":400,"additional_bet_index":0}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 34', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - timestamp: '2019-08-24T15:46:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: 'spin_result', - to: 'Schedule', - }, - { - to: 'Schedule', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: - 'Events must be sent within seven days of their occurrence or up to one minute in the future.', - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 35', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - }, - originalTimestamp: '2019-04-16T15:50:51.693229+05:30', - type: 'track', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: 'validToken', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: true, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: - 'Events must be sent within seven days of their occurrence or up to one minute in the future.', - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 36', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'products searched', - properties: { - query: { - key1: 'HDMI cable', - }, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: "'query' should be in string format only", - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 37', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'products searched', - properties: { - query: 50, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Search","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"query":50,"content_ids":[],"content_category":"","value":0,"contents":[],"search_string":50,"currency":"USD"}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 38', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - page: { - url: 'https://theminimstory.com/collections/summer-of-pearls?utm_source=facebook&utm_medium=paidsocial&utm_campaign=carousel&utm_content=ad1-jul&fbclid=IwAR2SsDcjzd_TLZN-e93kxOeGBYO4pQ3AiyeXSheHW5emDeLw8uTvo6lTMPI', - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'checkout started', - properties: { - currency: 'CAD', - category: 'clothing', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 1, - price: 24.75, - name: 'my product 2', - sku: 'p-299', - }, - ], - step: 1, - paymentMethod: 'Visa', - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36","fbc":"fb.1.1697278611693.IwAR2SsDcjzd_TLZN-e93kxOeGBYO4pQ3AiyeXSheHW5emDeLw8uTvo6lTMPI"},"event_name":"InitiateCheckout","event_time":1697278611,"event_source_url":"https://theminimstory.com/collections/summer-of-pearls?utm_source=facebook&utm_medium=paidsocial&utm_campaign=carousel&utm_content=ad1-jul&fbclid=IwAR2SsDcjzd_TLZN-e93kxOeGBYO4pQ3AiyeXSheHW5emDeLw8uTvo6lTMPI","event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","category":"clothing","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[1].quantity":1,"products[1].price":24.75,"products[1].name":"my product 2","products[1].sku":"p-299","step":1,"paymentMethod":"Visa","testDimension":true,"testMetric":true,"content_category":"clothing","content_ids":["p-298","p-299"],"content_type":"product","value":0,"contents":[{"id":"p-298","quantity":1,"item_price":24.75},{"id":"p-299","quantity":1,"item_price":24.75}],"num_items":2}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 39', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - page: { - url: 'https://theminimstory.com/collections/summer-of-pearls?utm_source=facebook&utm_medium=paidsocial&utm_campaign=carousel&utm_content=ad1-jul&fbclid=IwAR2SsDcjzd_TLZN-e93kxOeGBYO4pQ3AiyeXSheHW5emDeLw8uTvo6lTMPI', - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: { - name: 'checkout started', - }, - properties: { - currency: 'CAD', - category: 'clothing', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 1, - price: 24.75, - name: 'my product 2', - sku: 'p-299', - }, - ], - step: 1, - paymentMethod: 'Visa', - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'event name should be string', - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 40', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - page: { - url: 'url in wrong format', - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'checkout started', - properties: { - currency: 'CAD', - category: 'clothing', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - { - quantity: 1, - price: 24.75, - name: 'my product 2', - sku: 'p-299', - }, - ], - step: 1, - paymentMethod: 'Visa', - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"InitiateCheckout","event_time":1697278611,"event_source_url":"url in wrong format","event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","category":"clothing","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[1].quantity":1,"products[1].price":24.75,"products[1].name":"my product 2","products[1].sku":"p-299","step":1,"paymentMethod":"Visa","testDimension":true,"testMetric":true,"content_category":"clothing","content_ids":["p-298","p-299"],"content_type":"product","value":0,"contents":[{"id":"p-298","quantity":1,"item_price":24.75},{"id":"p-299","quantity":1,"item_price":24.75}],"num_items":2}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 41', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product viewed', - properties: { - currency: 'CAD', - quantity: 1, - price: 24.75, - name: 'my product 1', - category: 'clothing', - sku: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - Facebook_Pixel: { - contentType: 'sending dedicated content type for this particular payload', - }, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - removeExternalId: true, - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","quantity":1,"price":24.75,"name":"my product 1","category":"clothing","sku":"p-298","testDimension":true,"testMetric":true,"position":4.5,"content_ids":["p-298"],"content_type":"sending dedicated content type for this particular payload","content_name":"my product 1","content_category":"clothing","value":24.75,"contents":[{"id":"p-298","quantity":1,"item_price":24.75}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 42', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product viewed', - properties: { - currency: 'CAD', - quantity: 1, - price: 24.75, - value: 18.9, - name: 'my product 1', - category: 'clothing', - sku: 'p-298', - testDimension: true, - testMetric: true, - position: 4.5, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - removeExternalId: true, - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.value', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"ViewContent","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"currency":"CAD","quantity":1,"price":24.75,"value":18.9,"name":"my product 1","category":"clothing","sku":"p-298","testDimension":true,"testMetric":true,"position":4.5,"content_ids":["p-298"],"content_type":"product","content_name":"my product 1","content_category":"clothing","contents":[{"id":"p-298","quantity":1,"item_price":24.75}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 43', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'order completed', - properties: { - order_id: 'rudderstackorder1', - total: 99.99, - revenue: 12.24, - shipping: 13.99, - tax: 20.99, - currency: 'INR', - contentName: 'all about nutrition', - products: { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - }, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: "'properties.products' is not sent as an Array", - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 44', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'product list viewed', - properties: { - email: 'abc@gmail.com', - quantity: 2, - category: 'cat 1', - list_id: '1234', - contentName: 'nutrition', - value: 18.9, - products: [ - { - product_id: '507f1f77bcf86cd799439011', - productDimension: 'My Product Dimension', - productMetric: 'My Product Metric', - position: 10, - }, - [ - { - product_id: '507f1f77bcf86cdef799439011', - productDimension: 'My Product Dimension1', - productMetric: 'My Product Metric1', - position: -10, - }, - ], - ], - testDimension: true, - testMetric: true, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: "'properties.products[1]' is not an object", - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 45', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'custom', - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - pixelId: 'dummyPixelId', - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'Access token not found. Aborting', - statTags: { - errorCategory: 'dataValidation', - errorType: 'configuration', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 46', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'custom', - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'Pixel Id not found. Aborting', - statTags: { - errorCategory: 'dataValidation', - errorType: 'configuration', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 47', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - metadata: { - jobId: 12, - }, - destination: { - secretConfig: {}, - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [], - limitedDataUSage: false, - accessToken: 'dummyAccessToken', - testDestination: false, - testEventCode: '', - standardPageCall: false, - blacklistedEvents: [], - whitelistedEvents: [], - eventFilteringOption: 'disable', - removeExternalId: false, - useUpdatedMapping: false, - oneTrustCookieCategories: [], - useNativeSDK: false, - eventDelivery: false, - eventDeliveryTS: 1686748039135, - }, - liveEventsConfig: { - eventDelivery: false, - eventDeliveryTS: 1686748039135, - }, - id: 'destId1', - workspaceId: 'wsp2', - transformations: [], - isConnectionEnabled: true, - isProcessorEnabled: true, - name: 'san-fb_pixel', - enabled: true, - deleted: false, - createdAt: '2023-06-06T13:36:08.579Z', - updatedAt: '2023-06-14T13:07:19.136Z', - revisionId: 'revId2', - secretVersion: 3, - }, - message: { - type: 'page', - sentAt: '2023-10-14T15:46:51.000Z', - userId: 'user@19', - channel: 'web', - context: { - os: { - name: '', - version: '', - }, - app: { - name: 'RudderLabs JavaScript SDK', - version: 'dev-snapshot', - namespace: 'com.rudderlabs.javascript', - }, - page: { - url: 'http://127.0.0.1:8888/', - path: '/', - title: 'Document', - search: '', - tab_url: 'http://127.0.0.1:8888/', - referrer: 'http://127.0.0.1:8888/', - initial_referrer: '$direct', - referring_domain: '127.0.0.1:8888', - initial_referring_domain: '', - }, - locale: 'en-GB', - screen: { - width: 1728, - height: 1117, - density: 2, - innerWidth: 547, - innerHeight: 915, - }, - traits: { - name: false, - source: 'rudderstack', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: 'dev-snapshot', - }, - campaign: {}, - sessionId: 1687769234506, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', - }, - rudderId: '6bbfd003-c074-4ee9-8674-c132ded9ff04', - timestamp: '2023-10-14T15:46:51.000Z', - properties: { - url: 'http://127.0.0.1:8888/', - path: '/', - title: 'Document', - search: '', - tab_url: 'http://127.0.0.1:8888/', - referrer: 'http://127.0.0.1:8888/', - initial_referrer: '$direct', - referring_domain: '127.0.0.1:8888', - initial_referring_domain: '', - }, - receivedAt: '2023-10-14T15:46:51.000Z', - request_ip: '49.206.54.243', - anonymousId: '700ab220-faad-4cdf-8484-63e4c6bce6fe', - integrations: { - All: true, - }, - originalTimestamp: '2023-10-14T15:46:51.000Z', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=dummyAccessToken`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"72fd46c9ecb386f6747664a3e1d524294a3d7a2c8ae4aeb22b1e578b75093635","client_ip_address":"49.206.54.243","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"},"event_name":"PageView","event_time":1697298411,"event_source_url":"http://127.0.0.1:8888/","action_source":"website","custom_data":{"url":"http://127.0.0.1:8888/","path":"/","title":"Document","search":"","tab_url":"http://127.0.0.1:8888/","referrer":"http://127.0.0.1:8888/","initial_referrer":"$direct","referring_domain":"127.0.0.1:8888","initial_referring_domain":""}}', - ], - }, - }, - files: {}, - userId: '', - }, - metadata: { - jobId: 12, - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 48', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { - email: 'test@rudderstack.com', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - }, - type: 'track', - messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', - originalTimestamp: '2023-10-14T15:46:51.693229+05:30', - anonymousId: '00000000000000000000000000', - userId: '12345', - event: 'order completed', - properties: { - category: ['clothing', 'fishing'], - order_id: 'rudderstackorder1', - total: 99.99, - revenue: 12.24, - shipping: 13.99, - tax: 20.99, - currency: 'INR', - products: [ - { - quantity: 1, - price: 24.75, - name: 'my product', - sku: 'p-298', - delivery_category: 'home_delivery', - }, - { - quantity: 3, - price: 24.75, - name: 'other product', - sku: 'p-299', - delivery_category: 'home_delivery', - }, - ], - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - destination: { - Config: { - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: true, - }, - ], - categoryToContent: [ - { - from: 'clothing', - to: 'product', - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - valueFieldIdentifier: 'properties.price', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","em":"1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Purchase","event_time":1697278611,"event_id":"ec5481b6-a926-4d2e-b293-0b3a77c4d3be","action_source":"website","custom_data":{"category[0]":"clothing","category[1]":"fishing","order_id":"rudderstackorder1","total":99.99,"revenue":12.24,"shipping":13.99,"tax":20.99,"currency":"INR","products[0].quantity":1,"products[0].price":24.75,"products[0].name":"my product","products[0].sku":"p-298","products[0].delivery_category":"home_delivery","products[1].quantity":3,"products[1].price":24.75,"products[1].name":"other product","products[1].sku":"p-299","products[1].delivery_category":"home_delivery","content_category":"clothing,fishing","content_ids":["p-298","p-299"],"content_type":"product","value":12.24,"contents":[{"id":"p-298","quantity":1,"item_price":24.75,"delivery_category":"home_delivery"},{"id":"p-299","quantity":3,"item_price":24.75,"delivery_category":"home_delivery"}],"num_items":2}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 49', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - channel: 'mobile', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: ' aBc@gmail.com ', - address: { - zip: 1234, - }, - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - content_ids: ['prod1', 'prod2'], - }, - timestamp: '2023-10-14T00:00:00.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - removeExternalId: true, - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1697221800,"action_source":"app","custom_data":{"additional_bet_index":0,"value":400,"content_ids":["prod1","prod2"]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'facebook_pixel', - description: 'Test 50', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - channel: 'mobile', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: ' aBc@gmail.com ', - address: { - zip: 1234, - }, - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, - contents: [ - { - id: 'prod1', - quantity: 5, - item_price: 55, - }, - ], - }, - timestamp: '2023-10-14T00:00:00.693229+05:30', - type: 'track', - }, - destination: { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - removeExternalId: true, - valueFieldIdentifier: '', - advancedMapping: false, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, - headers: {}, - params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1697221800,"action_source":"app","custom_data":{"additional_bet_index":0,"value":400,"contents":[{"id":"prod1","quantity":5,"item_price":55}]}}', - ], - }, - }, - files: {}, - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, -].map((d) => ({ ...d, mockFns })); diff --git a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts index 689be3a6d5..65aa441a75 100644 --- a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts @@ -1,7 +1,9 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { generateTrackPayload } from '../../../testUtils'; +import { generateTrackPayload, generateMetadata, transformResultBuilder } from '../../../testUtils'; +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; -const commonDestination = { +const commonDestination: Destination = { ID: '12335', Name: 'sample-destination', DestinationDefinition: { @@ -100,11 +102,13 @@ const commonStatTags = { feature: 'processor', }; -export const ecommTestData = [ +export const ecommTestData: ProcessorTestData[] = [ { + id: 'facebook_pixel-test-1', name: 'facebook_pixel', description: 'Track call : product list viewed event call with properties without product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to ViewContent, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -122,6 +126,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -132,37 +137,35 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-2', name: 'facebook_pixel', description: 'Track call : product list viewed event call with properties with product array', successCriteria: 'It should be internally mapped to ViewContent, with necessary mapping from message.properties and from products array and should be sent to the destination', + scenario: 'ecommerce', feature: 'processor', module: 'destination', version: 'v0', @@ -178,6 +181,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -188,35 +192,33 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"content_category":"dummy","value":0,"currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"content_category":"dummy","value":0,"currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-3', name: 'facebook_pixel', description: 'Track call : product viewed event call with properties without product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to ViewContent, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -234,6 +236,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -244,35 +247,33 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_ids":["12345"],"content_type":"product","content_name":"","content_category":"dummy","currency":"USD","contents":[{"id":"12345","quantity":10}]}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_ids":["12345"],"content_type":"product","content_name":"","content_category":"dummy","currency":"USD","contents":[{"id":"12345","quantity":10}]}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-4', name: 'facebook_pixel', description: 'Track call : product added event call with properties without product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to AddToCart, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -290,6 +291,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -300,35 +302,33 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"AddToCart","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_ids":["12345"],"content_type":"product","content_name":"","content_category":"dummy","currency":"USD","contents":[{"id":"12345","quantity":10}]}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"AddToCart","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_ids":["12345"],"content_type":"product","content_name":"","content_category":"dummy","currency":"USD","contents":[{"id":"12345","quantity":10}]}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-5', name: 'facebook_pixel', description: 'Track call : order completed event call with properties without product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to purchase, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -346,6 +346,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -356,35 +357,33 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"Purchase","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_category":"dummy","content_ids":[],"content_type":"product","currency":"USD","contents":[],"num_items":0}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"Purchase","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_category":"dummy","content_ids":[],"content_type":"product","currency":"USD","contents":[],"num_items":0}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-6', name: 'facebook_pixel', description: 'Track call : order completed event call with properties with product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to purchase, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -402,6 +401,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -412,35 +412,33 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"Purchase","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_category":"dummy","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","currency":"USD","value":100,"contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"num_items":2}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"Purchase","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_category":"dummy","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","currency":"USD","value":100,"contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"num_items":2}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-7', name: 'facebook_pixel', description: 'Track call : products searched event call with properties', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to Search, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -458,6 +456,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -468,36 +467,34 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"Search","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","query":"dummy","content_ids":["12345"],"content_category":"dummy","contents":[{"id":"12345","quantity":10}],"search_string":"dummy","currency":"USD"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"Search","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","query":"dummy","content_ids":["12345"],"content_category":"dummy","contents":[{"id":"12345","quantity":10}],"search_string":"dummy","currency":"USD"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-8', name: 'facebook_pixel', description: 'Track call : products searched event call with properties and unsupported query type', + scenario: 'ecommerce', successCriteria: 'Error : It should throw an error as the query is not a string or an array of strings', feature: 'processor', @@ -515,6 +512,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -527,15 +525,22 @@ export const ecommTestData = [ { statusCode: 400, error: "'query' should be in string format only", - statTags: commonStatTags, + statTags: { + ...commonStatTags, + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-9', name: 'facebook_pixel', description: 'Track call : checkout started event call with properties without product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to InitiateCheckout, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -553,6 +558,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -563,35 +569,33 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"InitiateCheckout","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_category":"dummy","content_ids":[],"content_type":"product","currency":"USD","contents":[],"num_items":0}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"InitiateCheckout","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"dummy","quantity":10,"value":0,"product_id":"12345","content_category":"dummy","content_ids":[],"content_type":"product","currency":"USD","contents":[],"num_items":0}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-10', name: 'facebook_pixel', description: 'Track call : checkout started event call with properties with product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to InitiateCheckout, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -609,6 +613,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -619,36 +624,34 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"InitiateCheckout","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_category":"dummy","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","currency":"USD","value":100,"contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"num_items":2}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"InitiateCheckout","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_category":"dummy","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","currency":"USD","value":100,"contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"num_items":2}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-test-11', name: 'facebook_pixel', description: 'Track call : custom event ABC Started event call with properties with product array', + scenario: 'ecommerce', successCriteria: 'It should be internally mapped to InitiateCheckout, with necessary mapping from message.properties and should be sent to the destination', feature: 'processor', @@ -666,6 +669,7 @@ export const ecommTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -676,27 +680,23 @@ export const ecommTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"InitiateCheckout","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_category":"dummy","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","currency":"USD","value":100,"contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"num_items":2}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"InitiateCheckout","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"products[0].product_id":"017c6f5d5cf86a4b22432066","products[0].sku":"8732-98","products[0].name":"Just Another Game","products[0].price":22,"products[0].position":2,"products[0].category":"Games and Entertainment","products[0].url":"https://www.myecommercewebsite.com/product","products[0].image_url":"https://www.myecommercewebsite.com/product/path.jpg","products[1].product_id":"89ac6f5d5cf86a4b64eac145","products[1].sku":"1267-01","products[1].name":"Wrestling Trump Cards","products[1].price":4,"products[1].position":21,"products[1].category":"Card Games","category":"dummy","quantity":10,"revenue":100,"price":50,"product_id":"12345","order_id":"23456","content_category":"dummy","content_ids":["017c6f5d5cf86a4b22432066","89ac6f5d5cf86a4b64eac145"],"content_type":"product","currency":"USD","value":100,"contents":[{"id":"017c6f5d5cf86a4b22432066","quantity":10,"item_price":22},{"id":"89ac6f5d5cf86a4b64eac145","quantity":10,"item_price":4}],"num_items":2}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts index 2582192476..6ee6837b7c 100644 --- a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts @@ -1,7 +1,9 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { overrideDestination } from '../../../testUtils'; +import { Destination } from '../../../../../src/types'; +import { generateMetadata, transformResultBuilder, overrideDestination } from '../../../testUtils'; +import { ProcessorTestData } from '../../../testTypes'; -const commonDestination = { +const commonDestination: Destination = { ID: '12335', Name: 'sample-destination', DestinationDefinition: { @@ -98,7 +100,7 @@ const commonStatTags = { feature: 'processor', }; -export const identifyTestData = [ +export const identifyTestData: ProcessorTestData[] = [ { id: 'fbPixel-identify-test-1', name: 'facebook_pixel', @@ -114,6 +116,7 @@ export const identifyTestData = [ body: [ { message: commonMessage, + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { advancedMapping: false }), }, ], @@ -127,15 +130,22 @@ export const identifyTestData = [ statusCode: 400, error: 'For identify events, "Advanced Mapping" configuration must be enabled on the RudderStack dashboard', - statTags: commonStatTags, + statTags: { + ...commonStatTags, + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'fbPixel-identify-test-2', name: 'facebook_pixel', description: 'Identify event happy flow : without integrations object hashed true', + scenario: 'Business', successCriteria: ' Response should contain status code 200 and body should contain unhashed user traits', feature: 'processor', @@ -146,6 +156,7 @@ export const identifyTestData = [ body: [ { message: commonMessage, + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -156,27 +167,23 @@ export const identifyTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ph":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","ge":"252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111","ln":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","fn":"2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"identify","event_time":1697278611,"event_id":"84e26acc-56a5-4835-8233-591137fca468","action_source":"website"}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ph":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","ge":"252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111","ln":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","fn":"2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"identify","event_time":1697278611,"event_id":"84e26acc-56a5-4835-8233-591137fca468","action_source":"website"}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts b/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts index 58465296e6..0058a6f9cf 100644 --- a/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts @@ -1,6 +1,14 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { generateSimplifiedPageOrScreenPayload, overrideDestination } from '../../../testUtils'; -const commonDestination = { +import { + generateSimplifiedPageOrScreenPayload, + overrideDestination, + generateMetadata, + transformResultBuilder, +} from '../../../testUtils'; +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; + +const commonDestination: Destination = { ID: '12335', Name: 'sample-destination', DestinationDefinition: { @@ -89,11 +97,23 @@ const commonPageMessage = { ...commonMessage, type: 'page' }; const commonScreenMessage = { ...commonMessage, type: 'screen' }; -export const pageScreenTestData = [ +const commonStatTags = { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'FACEBOOK_PIXEL', + module: 'destination', + implementation: 'native', + feature: 'processor', +}; + +export const pageScreenTestData: ProcessorTestData[] = [ { + id: 'facebook_pixel-page-test-1', name: 'facebook_pixel', description: 'Page call : Happy flow without standard page switched on and with name and properties', + scenario: 'Page', + successCriteria: 'Response should contain status code 200 and no error message', feature: 'processor', module: 'destination', version: 'v0', @@ -102,6 +122,7 @@ export const pageScreenTestData = [ body: [ { message: commonPageMessage, + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -112,35 +133,35 @@ export const pageScreenTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Viewed page ApplicationLoaded","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"Viewed page ApplicationLoaded","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-page-test-2', name: 'facebook_pixel', description: 'Page call : with standard page switched on and no properties and no name', + scenario: 'Page', + successCriteria: + 'Response should contain error message and status code should be 400, as we are not sending any other properties other than standard page properties', feature: 'processor', module: 'destination', version: 'v0', @@ -162,6 +183,7 @@ export const pageScreenTestData = [ }, 'page', ), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], @@ -174,13 +196,11 @@ export const pageScreenTestData = [ { error: "After excluding opt_out,event_id,action_source, no fields are present in 'properties' for a standard event", + metadata: generateMetadata(1), statTags: { - destType: 'FACEBOOK_PIXEL', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', + ...commonStatTags, + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', }, statusCode: 400, }, @@ -189,8 +209,11 @@ export const pageScreenTestData = [ }, }, { + id: 'facebook_pixel-page-test-3', name: 'facebook_pixel', description: 'Page call : with standard page switched on and properties', + scenario: 'Page', + successCriteria: 'Response should contain status code 200 and no error message', feature: 'processor', module: 'destination', version: 'v0', @@ -218,6 +241,7 @@ export const pageScreenTestData = [ }, 'page', ), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], @@ -228,35 +252,34 @@ export const pageScreenTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-page-test-4', name: 'facebook_pixel', description: 'Page call : with standard page switched off and with properties but no page name', + scenario: 'Page', + successCriteria: 'Response should contain status code 200 and no error message', feature: 'processor', module: 'destination', version: 'v0', @@ -284,6 +307,7 @@ export const pageScreenTestData = [ }, 'page', ), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -294,36 +318,35 @@ export const pageScreenTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-screen-test-1', name: 'facebook_pixel', description: 'Screen call : Happy flow without standard page switched on and with name and properties', + scenario: 'Screen', + successCriteria: 'Response should contain status code 200 and no error message', feature: 'processor', module: 'destination', version: 'v0', @@ -332,6 +355,7 @@ export const pageScreenTestData = [ body: [ { message: commonScreenMessage, + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -342,35 +366,35 @@ export const pageScreenTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"PageView","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"PageView","event_time":1697278611,"event_source_url":"jkl","event_id":"5e10d13a-bf9a-44bf-b884-43a9e591ea71","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-screen-test-2', name: 'facebook_pixel', description: 'Screen call : with standard page switched on and no properties and no name', + scenario: 'Screen', + successCriteria: + 'Response should contain error message and status code should be 400, as we are not sending any other properties other than standard page properties', feature: 'processor', module: 'destination', version: 'v0', @@ -392,6 +416,7 @@ export const pageScreenTestData = [ }, 'screen', ), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], @@ -405,13 +430,11 @@ export const pageScreenTestData = [ error: "After excluding opt_out,event_id,action_source, no fields are present in 'properties' for a standard event", statTags: { - destType: 'FACEBOOK_PIXEL', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', + ...commonStatTags, + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', }, + metadata: generateMetadata(1), statusCode: 400, }, ], @@ -419,8 +442,11 @@ export const pageScreenTestData = [ }, }, { + id: 'facebook_pixel-screen-test-3', name: 'facebook_pixel', description: 'Screen call : with standard page switched on and properties', + scenario: 'Screen', + successCriteria: 'Response should contain status code 200 and no error message', feature: 'processor', module: 'destination', version: 'v0', @@ -448,6 +474,7 @@ export const pageScreenTestData = [ }, 'screen', ), + metadata: generateMetadata(1), destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], @@ -458,36 +485,35 @@ export const pageScreenTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'facebook_pixel-screen-test-4', name: 'facebook_pixel', description: 'Screen call : with standard page switched off and with properties but no page name', + scenario: 'Screen', + successCriteria: 'Response should contain status code 200 and no error message', feature: 'processor', module: 'destination', version: 'v0', @@ -515,6 +541,7 @@ export const pageScreenTestData = [ }, 'screen', ), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -525,27 +552,23 @@ export const pageScreenTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"470582f368e5aeec2cf487decd1e125b7d265e8b0b06b74a25e999e93bfb699f"},"event_name":"PageView","event_time":1697297576,"event_source_url":"jkl","action_source":"website","custom_data":{"path":"/abc","referrer":"xyz","search":"def","title":"ghi","url":"jkl"}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts b/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts index 87ed14cdc8..a61588fd93 100644 --- a/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts @@ -1,7 +1,9 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { generateTrackPayload } from '../../../testUtils'; +import { generateMetadata, generateTrackPayload, transformResultBuilder } from '../../../testUtils'; +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; -const commonDestination = { +const commonDestination: Destination = { ID: '12335', Name: 'sample-destination', DestinationDefinition: { @@ -57,10 +59,12 @@ const commonUserProperties = { const commonTimestamp = new Date('2023-10-14'); -export const trackTestData = [ +export const trackTestData: ProcessorTestData[] = [ { + id: 'fbPixel-track-test-1', name: 'facebook_pixel', description: 'Track call : custom event calls with simple user properties and traits', + scenario: 'Business', successCriteria: 'event not respecting the internal mapping and as well as UI mapping should be considered as a custom event and should be sent as it is', feature: 'processor', @@ -78,6 +82,7 @@ export const trackTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -88,36 +93,34 @@ export const trackTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"spin_result","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","value":400}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"spin_result","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","value":400}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, }, }, { + id: 'fbPixel-track-test-2', name: 'facebook_pixel', description: 'Track call : other standard type event calls with simple user properties and traits', + scenario: 'Business', successCriteria: 'event not respecting the internal mapping and as well as UI mapping but falls under other standard events, should be considered as a simple track event', feature: 'processor', @@ -135,6 +138,7 @@ export const trackTestData = [ }, timestamp: commonTimestamp, }), + metadata: generateMetadata(1), destination: commonDestination, }, ], @@ -145,27 +149,23 @@ export const trackTestData = [ status: 200, body: [ { - output: { + output: transformResultBuilder({ version: '1', type: 'REST', method: 'POST', endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, - body: { - JSON: {}, - JSON_ARRAY: {}, - XML: {}, - FORM: { - data: [ - '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"AddToWishlist","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","value":400}}', - ], - }, + FORM: { + data: [ + '{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"AddToWishlist","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"additional_bet_index":0,"email":"abc@gmail.com","value":400}}', + ], }, files: {}, userId: '', - }, + }), statusCode: 200, + metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts index 13274eb088..85d2a4318e 100644 --- a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts @@ -1,172 +1,159 @@ -const commonDestination = { - Config: { - limitedDataUsage: true, - blacklistPiiProperties: [ - { - blacklistPiiProperties: '', - blacklistPiiHash: false, - }, - ], - accessToken: '09876', - pixelId: 'dummyPixelId', - eventsToEvents: [ - { - from: '', - to: '', - }, - ], - eventCustomProperties: [ - { - eventCustomProperties: '', - }, - ], - removeExternalId: true, - valueFieldIdentifier: '', - advancedMapping: true, - whitelistPiiProperties: [ - { - whitelistPiiProperties: '', - }, - ], - }, - Enabled: true, - } +import { Destination } from '../../../../../src/types'; +import { generateSimplifiedGroupPayload, generateSimplifiedTrackPayload } from '../../../testUtils'; +const commonDestination: Destination = { + ID: '12335', + Name: 'sample-destination', + DestinationDefinition: { + ID: '123', + Name: 'facebook_pixel', + DisplayName: 'Facebook Pixel', + Config: {}, + }, + WorkspaceID: '123', + Transformations: [], + Config: { + limitedDataUsage: true, + blacklistPiiProperties: [ + { + blacklistPiiProperties: '', + blacklistPiiHash: false, + }, + ], + accessToken: '09876', + pixelId: 'dummyPixelId', + eventsToEvents: [ + { + from: '', + to: '', + }, + ], + eventCustomProperties: [ + { + eventCustomProperties: '', + }, + ], + removeExternalId: true, + valueFieldIdentifier: '', + advancedMapping: true, + whitelistPiiProperties: [ + { + whitelistPiiProperties: '', + }, + ], + }, + Enabled: true, +}; + +const commonStatTags = { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'FACEBOOK_PIXEL', + module: 'destination', + implementation: 'native', + feature: 'processor', +}; + export const validationTestData = [ - { - id: 'fbPixel-validation-test-1', - name: 'facebook_pixel', - description: '[Error]: Check for unsupported message type', - scenario: 'Framework', - successCriteria: - 'Response should contain error message and status code should be 400, as we are sending a message type which is not supported by facebook pixel destination and the error message should be Event type random is not supported', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: commonDestination, - message: { - userId: 'user123', - type: 'random', - groupId: 'XUepkK', + { + id: 'fbPixel-validation-test-1', + name: 'facebook_pixel', + description: '[Error]: Check for unsupported message type', + scenario: 'Framework', + successCriteria: + 'Response should contain error message and status code should be 400, as we are sending a message type which is not supported by facebook pixel destination and the error message should be Event type random is not supported', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: commonDestination, + message: generateSimplifiedGroupPayload({ + userId: 'user123', + groupId: 'XUepkK', + traits: { + subscribe: true, + }, + context: { traits: { - subscribe: true, + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: ['email'], }, - context: { - traits: { - email: 'test@rudderstack.com', - phone: '+12 345 678 900', - consent: 'email', - }, - }, - timestamp: '2023-10-14T00:21:34.208Z', }, - }, - ], - }, + timestamp: '2023-10-14T00:21:34.208Z', + }), + }, + ], }, - output: { - response: { - status: 200, - body: [ - { - error: 'Message type random not supported', - statTags: { - destType: 'FACEBOOK_PIXEL', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message type group not supported', + statTags: commonStatTags, + statusCode: 400, + }, + ], }, }, - { - id: 'fbPixel-validation-test-2', - name: 'facebook_pixel', - description: '[Error]: validate event date and time', - scenario: 'Framework + business', - successCriteria: - 'Response should contain error message and status code should be 400, as we are sending an event which is older than 7 days and the error message should be Events must be sent within seven days of their occurrence or up to one minute in the future.', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - destination_props: { - Fb: { - app_id: 'RudderFbApp', - }, - }, - context: { - device: { - id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', - manufacturer: 'Xiaomi', - model: 'Redmi 6', - name: 'xiaomi', - }, - network: { - carrier: 'Banglalink', - }, - os: { - name: 'android', - version: '8.1.0', - }, - screen: { - height: '100', - density: 50, - }, - traits: { - email: 'abc@gmail.com', - anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - }, - }, - event: 'spin_result', - integrations: { - All: true, - }, - message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { - revenue: 400, - additional_bet_index: 0, + }, + { + id: 'fbPixel-validation-test-2', + name: 'facebook_pixel', + description: '[Error]: validate event date and time', + scenario: 'Framework + business', + successCriteria: + 'Response should contain error message and status code should be 400, as we are sending an event which is older than 7 days and the error message should be Events must be sent within seven days of their occurrence or up to one minute in the future.', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: generateSimplifiedTrackPayload({ + type: 'track', + event: 'TestEven001', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'sajal12', + context: { + traits: { + email: 'test@rudderstack.com', + phone: '9112340375', + plan_details: { + plan_type: 'gold', + duration: '3 months', }, - timestamp: '2019-08-24T15:46:51.693229+05:30', - type: 'track', }, - destination: commonDestination, }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: - 'Events must be sent within seven days of their occurrence or up to one minute in the future.', - statTags: { - errorCategory: 'dataValidation', - errorType: 'instrumentation', - destType: 'FACEBOOK_PIXEL', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, + properties: { + revenue: 400, + additional_bet_index: 0, }, - ], + anonymousId: '9c6bd77ea9da3e68', + originalTimestamp: '2021-01-25T15:32:56.409Z', + }), + destination: commonDestination, }, - }, - } - ]; \ No newline at end of file + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + 'Events must be sent within seven days of their occurrence or up to one minute in the future.', + statTags: commonStatTags, + }, + ], + }, + }, + }, +];