-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(facebook): update content_type mapping logic for fb pixel and fb…
… conversions (#3113) * feat(facebook): update content_type mapping logic for fb pixel and fb conversions * feat(facebook): update content_type mapping logic for fb conversions * chore: added tests * chore: updated tests
- Loading branch information
1 parent
feb256b
commit aea417c
Showing
4 changed files
with
254 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1434,4 +1434,104 @@ export const data = [ | |
}, | ||
mockFns: defaultMockFns, | ||
}, | ||
{ | ||
name: 'facebook_conversions', | ||
description: 'Track event with standard event order completed with content_type in properties', | ||
feature: 'processor', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: [ | ||
{ | ||
message: { | ||
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', | ||
channel: 'web', | ||
context: { | ||
traits: { | ||
email: ' [email protected] ', | ||
address: { | ||
zip: 1234, | ||
}, | ||
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', | ||
}, | ||
}, | ||
event: 'order completed', | ||
integrations: { | ||
All: true, | ||
}, | ||
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', | ||
properties: { | ||
content_type: 'product_group', | ||
revenue: 400, | ||
additional_bet_index: 0, | ||
products: [ | ||
{ | ||
product_id: 1234, | ||
quantity: 5, | ||
price: 55, | ||
}, | ||
], | ||
}, | ||
timestamp: '2023-11-12T15:46:51.693229+05:30', | ||
type: 'track', | ||
}, | ||
destination: { | ||
Config: { | ||
limitedDataUsage: true, | ||
blacklistPiiProperties: [ | ||
{ | ||
blacklistPiiProperties: '', | ||
blacklistPiiHash: false, | ||
}, | ||
], | ||
accessToken: '09876', | ||
datasetId: 'dummyID', | ||
eventsToEvents: [ | ||
{ | ||
from: '', | ||
to: '', | ||
}, | ||
], | ||
removeExternalId: true, | ||
actionSource: 'website', | ||
}, | ||
Enabled: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: [ | ||
{ | ||
output: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', | ||
headers: {}, | ||
params: {}, | ||
body: { | ||
JSON: {}, | ||
XML: {}, | ||
JSON_ARRAY: {}, | ||
FORM: { | ||
data: [ | ||
'{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"content_type":"product_group","revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55}],"currency":"USD","value":400,"num_items":1}}', | ||
], | ||
}, | ||
}, | ||
files: {}, | ||
userId: '', | ||
}, | ||
statusCode: 200, | ||
}, | ||
], | ||
}, | ||
}, | ||
mockFns: defaultMockFns, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters