-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reddit revenue mapping for floating point values (#3118)
* fix: reddit revenue mapping for floating point values * fix: reddit revenue mapping for floating point values
- Loading branch information
Showing
2 changed files
with
171 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,173 @@ export const data = [ | |
}, | ||
}, | ||
}, | ||
{ | ||
name: 'reddit', | ||
description: 'Track call with order completed event with floating point values for revenue', | ||
feature: 'processor', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: [ | ||
{ | ||
message: { | ||
context: { | ||
traits: { | ||
email: '[email protected]', | ||
}, | ||
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', | ||
ip: '54.100.200.255', | ||
device: { | ||
advertisingId: 'asfds7fdsihf734b34j43f', | ||
}, | ||
os: { | ||
name: 'android', | ||
}, | ||
}, | ||
type: 'track', | ||
session_id: '16733896350494', | ||
originalTimestamp: '2019-10-14T09:03:17.562Z', | ||
anonymousId: '123456', | ||
event: 'Order Completed', | ||
userId: 'testuserId1', | ||
properties: { | ||
checkout_id: '12345', | ||
order_id: '1234', | ||
affiliation: 'Apple Store', | ||
total: 20, | ||
revenue: 14.985, | ||
shipping: 4, | ||
tax: 1, | ||
discount: 1.5, | ||
coupon: 'ImagePro', | ||
currency: 'USD', | ||
products: [ | ||
{ | ||
product_id: '123', | ||
sku: 'G-32', | ||
name: 'Monopoly', | ||
price: 14, | ||
quantity: 1, | ||
category: 'Games', | ||
url: 'https://www.website.com/product/path', | ||
image_url: 'https://www.website.com/product/path.jpg', | ||
}, | ||
{ | ||
product_id: '345', | ||
sku: 'F-32', | ||
name: 'UNO', | ||
price: 3.45, | ||
quantity: 2, | ||
category: 'Games', | ||
}, | ||
], | ||
}, | ||
integrations: { | ||
All: true, | ||
}, | ||
sentAt: '2019-10-14T09:03:22.563Z', | ||
}, | ||
destination: { | ||
Config: { | ||
accountId: 'a2_fsddXXXfsfd', | ||
hashData: true, | ||
eventsMapping: [ | ||
{ | ||
from: 'Order Completed', | ||
to: 'Purchase', | ||
}, | ||
], | ||
}, | ||
DestinationDefinition: { Config: { cdkV2Enabled: true } }, | ||
}, | ||
metadata: { | ||
destinationId: 'destId', | ||
workspaceId: 'wspId', | ||
secret: { | ||
accessToken: 'dummyAccessToken', | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: [ | ||
{ | ||
output: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', | ||
headers: { | ||
Authorization: 'Bearer dummyAccessToken', | ||
'Content-Type': 'application/json', | ||
}, | ||
params: {}, | ||
body: { | ||
JSON: { | ||
events: [ | ||
{ | ||
event_at: '2019-10-14T09:03:17.562Z', | ||
event_type: { | ||
tracking_type: 'Purchase', | ||
}, | ||
user: { | ||
aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a', | ||
email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2', | ||
external_id: | ||
'7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d', | ||
ip_address: | ||
'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db', | ||
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', | ||
screen_dimensions: {}, | ||
}, | ||
event_metadata: { | ||
item_count: 2, | ||
currency: 'USD', | ||
value: 1499, | ||
value_decimal: 14.99, | ||
products: [ | ||
{ | ||
id: '123', | ||
name: 'Monopoly', | ||
category: 'Games', | ||
}, | ||
{ | ||
id: '345', | ||
name: 'UNO', | ||
category: 'Games', | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
JSON_ARRAY: {}, | ||
XML: {}, | ||
FORM: {}, | ||
}, | ||
files: {}, | ||
userId: '', | ||
}, | ||
metadata: { | ||
destinationId: 'destId', | ||
workspaceId: 'wspId', | ||
secret: { | ||
accessToken: 'dummyAccessToken', | ||
}, | ||
}, | ||
statusCode: 200, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: 'reddit', | ||
description: 'Track call with product list viewed event', | ||
|