Skip to content

Commit

Permalink
revenue_type key order
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrishac committed Nov 20, 2020
1 parent 334e935 commit 9f40639
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions integrations/Amplitude/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ class Amplitude {
}

trackingEventAndRevenuePerProduct(trackEventMessage, products, shouldTrackEventPerProduct){
const { revenue, revenueType } = trackEventMessage.properties;
let { revenue, revenueType } = trackEventMessage.properties;
revenueType = revenueType || trackEventMessage.properties.revenue_type;
for (let index = 0; index < products.length; index++) {
let product = products[index];
trackEventMessage.properties = product;
Expand Down Expand Up @@ -353,7 +354,7 @@ class Amplitude {

const { properties, event } = rudderMessage;
let { price, productId, quantity, revenue, product_id } = properties;
let revenueType = properties.revenueType || mapRevenueType[event.toLowerCase()];
let revenueType = properties.revenueType || properties.revenue_type || mapRevenueType[event.toLowerCase()];

productId = productId || product_id;

Expand Down

0 comments on commit 9f40639

Please sign in to comment.