diff --git a/branch_events.js b/branch_events.js index a8c009b..b126ec0 100644 --- a/branch_events.js +++ b/branch_events.js @@ -2,10 +2,11 @@ function trackEvent(eventName) { if (eventName == "ADD_TO_CART") { var event_and_custom_data = { "currency": "EUR", - "revenue": 120.0 + "revenue": 120.0, + "coupon": "coupon_code" }; - var customer_event_alias = "Test currency + revenue fields"; + var customer_event_alias = "Test currency + revenue + coupon fields"; branch.logEvent( "ADD_TO_CART", @@ -14,15 +15,16 @@ function trackEvent(eventName) { function(err) { console.log(err); } ); - setTimeout(function(){alert("Branch " + eventName + " event was tracked with currency and revenue data!")},500); + setTimeout(function(){alert("Branch " + eventName + " event was tracked with currency, revenue, and coupon data!")},500); } else if(eventName == "PURCHASE") { var event_and_custom_data = { "currency": "EUR", - "revenue": 120.0 + "revenue": 120.0, + "coupon": "coupon_code" }; - var customer_event_alias = "Test currency + revenue fields"; + var customer_event_alias = "Test currency + revenue + coupon fields"; branch.logEvent( "PURCHASE", @@ -31,7 +33,7 @@ function trackEvent(eventName) { function(err) { console.log(err); } ); - setTimeout(function(){alert("Branch " + eventName + " event was tracked with currency and revenue data!")},500); + setTimeout(function(){alert("Branch " + eventName + " event was tracked with currency, revenue, and coupon data!")},500); } else {