Once you have enabled Ecommerce tracking for a website, you need to implement tracking of the various Ecommerce interactions on your website. There are three main Ecommerce interactions that are tracked with Egoimmerce:
Tracking Ecommerce orders and product details will allow Egoimmerce to process reports on:
Here’s an example of tracking an Ecommerce order containing two products – this code should be inserted in the “Order confirmation” page, once the visitor has checked out and issued payment. If you installed Egoimmerce correctly, your pages should already have a tracking code. The Ecommerce code below must be added and generated based on the Order:
// add the first product to the order _egoiaq.push(['addEcommerceItem', "9780786706211", // (required) SKU: Product unique identifier "Endurance: Shackleton's Incredible Voyage", // (optional) Product name "Adventure Books", // (optional) Product category. You can also specify an array of up to 5 categories eg. ["Books", "New releases", "Biography"] 8.8, // (recommended) Product price 1 // (optional, default to 1) Product quantity ]); // Here you can add other products in the order [...] // Specifiy the order details to Egoimmerce server & sends the data to Egoimmerce server _egoiaq.push(['trackEcommerceOrder', "A10000123", // (required) Unique Order ID 35, // (required) Order Revenue grand total (includes tax, shipping, and subtracted discount) 30, // (optional) Order sub total (excludes shipping) 5.5, // (optional) Tax amount 4.5, // (optional) Shipping amount false // (optional) Discount offered (set to false for unspecified parameter) ]); // we recommend to leave the call to trackPageView() on the Order confirmation page _egoiaq.push(['trackPageView']);
Important notes about the functions parameters:
orderIdparameter is a unique string identifier for the order. If the page containing the trackEcommerceOrder() call is refreshed by the customer a few hours or days after the initial Order, Egoimmerce will automatically discard the order as it is already recorded. You can use the same orderId for different Websites id, but for a given website, orderId must be unique.
Every time a visitor adds (or updates, deletes) an item from his/her cart, you can use Egoimmerce to track the latest cart subtotal as well as products left in the cart. Tracking cart updates will allow you to see how much revenue was left in your visitors’ carts for each day/week/etc, as well as getting reports on which products are most often left in the cart and which product categories are most often left abandoned in carts.
Some frequent causes for cart abandonment are:
When you make changes to your website to lower the cart abandonment rate, and try to increase your revenues, you can use Egoimmerce to understand if your changes are making a positive impact.
Example tracking an Ecommerce order containing two products:
The code is added every time the “cart” page is loaded, or when the “Add to cart” button is clicked:
// add the first product to the order _egoiaq.push(['addEcommerceItem', "9780786706211", // (required) SKU: Product unique identifier "Endurance: Shackleton's Incredible Voyage", // (optional) Product name ["Adventure Books", "Best sellers"], // (optional) Product category, string or array of up to 5 categories 8.8, // (recommended) Product price 1 // (optional, default to 1) Product quantity ]); // Here it is important to add all other products found in the cart, even the products not updated by the current "Add to cart" click [...] // Records the cart for this visit _egoiaq.push(['trackEcommerceCartUpdate', 15.5]); // (recommended) Cart amount _egoiaq.push(['trackPageView']);
Tracking product page views, and/or category page views lets Egoimmerce process the conversion rate for each product and/or category. It can be useful to know which product or category pages have converted your visitors into customers. For example, perhaps some product pages have below average conversion rates but generate high revenue. You may decide to improve these product pages and check their conversion rates over time.
To track a product or category page view, the function
setEcommerceView(productSKU, productName, categoryName,
price) is used, just before the call to egoimmerceTracker.trackPageView() on the product/category page.
Example Tracking a Product Page View
In this example, the following code is added to the Product page for the book “Endurance” which is in the category “Adventure Books”:
// all parameters are optional, but we recommend to set at minimum productSKU and productName _egoiaq.push(['setEcommerceView', "9780786706211", // (required) SKU: Product unique identifier "Endurance: Shackleton's Incredible Voyage", // (optional) Product name "Adventure Books", // (optional) Product category, or array of up to 5 categories 20.11 // (optional) Product Price as displayed on the page ]); _egoiaq.push(['trackPageView']);
Example tracking a Category page view
This code is added on the Category page “Adventure Books”
// on a category page, productSKU and productName are not applicable and are set to false _egoiaq.push(['setEcommerceView', productSku = false, // No product on Category page productName = false, // No product on Category page category = "Adventure Books" // Category Page, or array of up to 5 categories ]); _egoiaq.push(['trackPageView']);