-
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: adding custom properties to awin product level tracking
- Loading branch information
1 parent
bac3cc5
commit f61e136
Showing
2 changed files
with
201 additions
and
10 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 |
---|---|---|
|
@@ -1158,4 +1158,167 @@ export const data = [ | |
}, | ||
}, | ||
}, | ||
{ | ||
name: 'awin', | ||
description: 'Track call- with product array and custom properties', | ||
feature: 'processor', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: [ | ||
{ | ||
destination: { | ||
Config: { | ||
advertiserId: '1234', | ||
eventsToTrack: [ | ||
{ | ||
eventName: 'abc', | ||
}, | ||
{ | ||
eventName: 'prop2', | ||
}, | ||
{ | ||
eventName: 'prop3', | ||
}, | ||
], | ||
}, | ||
}, | ||
message: { | ||
type: 'track', | ||
event: 'prop2', | ||
sentAt: '2022-01-20T13:39:21.033Z', | ||
userId: 'user123456001', | ||
channel: 'web', | ||
properties: { | ||
currency: 'INR', | ||
voucherCode: '1bcu1', | ||
amount: 500, | ||
commissionGroup: 'sales', | ||
cks: 'new', | ||
testMode: '1', | ||
order_id: 'QW123', | ||
products: [ | ||
{ | ||
product_id: '123', | ||
name: 'Product 1', | ||
price: 10, | ||
quantity: 1, | ||
sku: undefined, | ||
category: 'Category 1', | ||
customProp1: 'customVal1', | ||
customProp2: 'customVal2', | ||
customProp3: 'customVal3', | ||
}, | ||
{ | ||
product_id: '456', | ||
name: 'Product 2', | ||
price: 20, | ||
quantity: 2, | ||
sku: 'SKU456', | ||
category: undefined, | ||
}, | ||
], | ||
}, | ||
context: { | ||
os: { | ||
name: '', | ||
version: '', | ||
}, | ||
app: { | ||
name: 'RudderLabs JavaScript SDK', | ||
build: '1.0.0', | ||
version: '1.2.20', | ||
namespace: 'com.rudderlabs.javascript', | ||
}, | ||
page: { | ||
url: 'http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html', | ||
path: '/Testing/App_for_LaunchDarkly/ourSdk.html', | ||
title: 'Document', | ||
search: '', | ||
tab_url: 'http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html', | ||
referrer: 'http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/', | ||
initial_referrer: '$direct', | ||
referring_domain: '127.0.0.1:7307', | ||
initial_referring_domain: '', | ||
}, | ||
locale: 'en-US', | ||
screen: { | ||
width: 1440, | ||
height: 900, | ||
density: 2, | ||
innerWidth: 536, | ||
innerHeight: 689, | ||
}, | ||
traits: { | ||
city: 'Pune', | ||
name: 'First User', | ||
email: '[email protected]', | ||
title: 'VP', | ||
gender: 'female', | ||
avatar: 'https://i.pravatar.cc/300', | ||
}, | ||
library: { | ||
name: 'RudderLabs JavaScript SDK', | ||
version: '1.2.20', | ||
}, | ||
campaign: {}, | ||
userAgent: | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36', | ||
}, | ||
rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', | ||
messageId: '831f1fa5-de84-4f22-880a-4c3f23fc3f04', | ||
anonymousId: 'bf412108-0357-4330-b119-7305e767823c', | ||
integrations: { | ||
All: true, | ||
}, | ||
originalTimestamp: '2022-01-20T13:39:21.032Z', | ||
}, | ||
}, | ||
], | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: [ | ||
{ | ||
output: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: 'https://www.awin1.com/sread.php', | ||
headers: {}, | ||
params: { | ||
amount: 500, | ||
ch: 'aw', | ||
parts: 'sales:500', | ||
cr: 'INR', | ||
tt: 'ss', | ||
tv: '2', | ||
vc: '1bcu1', | ||
cks: 'new', | ||
merchant: '1234', | ||
testmode: '1', | ||
ref: 'QW123', | ||
'bd[0]': | ||
'AW:P|1234|QW123|123|Product%201|10|1||sales%3A500|Category%201&p1=customVal1&p2=customVal2&p3=customVal3', | ||
'bd[1]': 'AW:P|1234|QW123|456|Product%202|20|2|SKU456|sales%3A500|', | ||
}, | ||
body: { | ||
JSON: {}, | ||
JSON_ARRAY: {}, | ||
XML: {}, | ||
FORM: {}, | ||
}, | ||
files: {}, | ||
userId: '', | ||
}, | ||
statusCode: 200, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
]; |