e-Marketer allows you to log Interaction Events from your JavaScript. This is an optional, alternative way of setting up product interactions monitoring.
In the code below, substitute PRODUCT_ID with value that appears in your Product Catalog in the “Internal ID” column, which is the Product ID used by e-Marketer (If you have a product, let’s say a hat, with different colors, the ID should be the group ID of all such hats).
You can check your product catalog here: https://platform.e-marketer.io/site/tracker/condition/index/#cat=Account/settings%2F Recommendations%2FProducts%20catalog
// 1. Product Viewed Event – Send it from every view of a product page.
(self.emarketer=self.emarketer||[]).push([“Product Viewed”, PRODUCT_ID]);
// 2. Added to Favorites (wishlist) Event – Send it when a visitor saves a product to wishlist or like list.
(self.emarketer=self.emarketer||[]).push([“Product Liked”, PRODUCT_ID]);
// 3. Removed from Favorites Event – send it when a visitor removed a product from their wish/like list.
(self.emarketer=self.emarketer||[]).push([“Product Unliked”, PRODUCT_ID]);
// 4. Added to cart event – send it when a visitor adds a product to their cart.
(self.emarketer=self.emarketer||[]).push([“Product Added to cart”, PRODUCT_ID]);
// …or with quantity (number of items)
(self.emarketer=self.emarketer||[]).push([“Product Added to cart”, PRODUCT_ID, ‘Quantity’, QUANTITY]);
// 5. Buy Event for Particular Products – send it when a visitor purchased a product, you need to send events for each product, or use the “Buy All Event” to set all products in the visitor’s cart as purchased.
// Note: the transaction sum will be calculated according to prices that appear in the product catalog.
(self.emarketer=self.emarketer||[]).push([“Product Purchased”, PRODUCT_ID]);
// … with quantity (number of items)
(self.emarketer=self.emarketer||[]).push([“Product Purchased”, PRODUCT_ID, ‘Quantity’, QUANTITY]);
// 5a. “Buy All” Event – Convert all the products that have been Added to cart to “Purchased”.
(self.emarketer=self.emarketer||[]).push([“Products Purchased”]);
// 6. Remove Particular Products from Cart Event
(self.emarketer=self.emarketer||[]).push([“Product Removed from cart”, PRODUCT_ID]);
// … remove all from cart. Convert all the products that have been Added to cart to “Viewed”:
(self.emarketer=self.emarketer||[]).push([“Products Removed from cart”]);
e-Marketer calculates the sum based on the prices as they appear in the product feed; you can also send the total transaction after tax, shipping, coupons etc., thus will appear under the conversion goal value in e-Marketer UI.
<script>
(self.emarketer=self.emarketer||[]).push([“Event”, “Purchase”, “1”]);
</script>