Recording eCommerce Events
Integration into your eCommerce platform will allow Veracity to track conversion and allow a better understanding of your marketing ROI.
This a technical implementation, as eCommerce systems vary in implementation. We recommend you seek the support of a Web Developer / Javascript Programmer if you’re unsure on how to implement the following information.
Veracity takes no responsibility for any errors on your site due to incorrect implementation.
How eCommerce Tracking works
Veracity provides Javascript API’s to your website which allows you to send notification of an eCommerce event being triggered such as “checkout” or “add to basket”.
We provide five eCommerce Notifications via our API; below is a technical outline of how and when these Notifications should be triggered.
Item Added to basket
window.bwai.addToBasket(evt, itm, cost, quantity);
This method notifies Veracity that a user has added one or more of an item to their basket. It takes four arguments:
- The user event from Javascript E.G the parameter passed into the method called by addEventListener.
- An item identifier for your system typically the item id or product code.
- The cost per item
- The number of items added to the basket
In practice example
document.querySelector(".addtobasket").addEventListener("click", (e) => {
window.bwai.addToBasket(e, 1, 10.99, 1);
});
Item Removed from Basket
window.bwai.rmFromBasket(evt, itm, cost, quantity);
This method notifies Veracity that a user has removed one or more of an item to their basket. It takes four arguments:
- The user event from Javascript E.G the parameter passed into the method called by addEventListener.
- An item identifier for your system typically the item id or product code.
- The cost per item
- The number of items removed from the basket
Sent User to Payment Gateway
window.bwai.checkoutTriggered(evt, totalCost, items, shipping);
This method notifies Veracity you’re sending the user to a payment gateway system (on or off your site). It takes four arguments:
- The user event from Javascript e.g. the parameter passed into the method called by addEventListener.
- The total cost of the items being ordered
- An array of item identifiers for your system typically the item id or product code.
- The cost of shipping for this order
Payment Gateway Approved
window.bwai.checkoutSuccess();
This method notifies Veracity that the payment was successful and the order has completed.
Payment Gateway Rejected
window.bwai.checkoutFailed();
This method notifies Veracity that the payment failed and the order has not been completed yet.
If you have any questions about implementing Veracity eCommerce tracking on your website, please contact a member of our Support team.