Verify on the Branch Dashboard
var event = {
revenue: 50.29,
currency: 148,
transactionID: "transaction id",
coupon: "coupon",
shipping: 2.22,
tax: 5.11,
affiliation: "affiliation",
products: [
{
sku: "u123",
name: "cactus",
price: 4.99,
quantity: 2,
brand: "brand",
category: 17,
variant: "variant"
},
{
sku: "u456",
name: "grass",
price: 0.0,
quantity: 1
}
]
};
var metadata = {
custom_dictionary: 123,
anything: "everything"
};
Branch.sendCommerceEvent(event, metadata)
.then(function(res) {
console.log(res);
alert("Response: " + JSON.stringify(res));
})
.catch(function(err) {
console.error(err);
alert("Error: " + JSON.stringify(err.message));
});