Add E-commerce
- Feb 24
- 4 min read
Updated: Feb 26
To measure Ecommerce performance in Extellio, you need to add tracking to the key moments of your customer’s purchase journey. By placing Extellio’s JavaScript tracking snippets on your product pages, cart, and checkout confirmation page, you can send product, basket, and order data to Extellio and gain visibility into how users browse, add items, and complete purchases.
For a complete Ecommerce tracking setup in Extellio, the following event types should be implemented:
Product Views (optional) — Enables per-product conversion analysis.
Cart Updates (optional) — Enables tracking of cart activity and abandoned baskets.
Order Completion (required) — Records completed purchases and revenue, and is essential for Ecommerce tracking.
Tracking Product Views in Extellio (Optional)
Extellio can report overall conversion performance for your website, and you can also track views of individual products and categories. By sending product-view data whenever a user visits a product page, Extellio can calculate conversion rates per product and help you understand which items attract interest but do not convert.
Tracking product and category performance can help you identify products that may need better descriptions, pricing adjustments, or improved presentation, as well as categories that are under-performing across your store.
Product and category views are sent to Extellio using the Ecommerce view tracking method. The difference between tracking a product versus a category depends on which parameters you include in the call. In both cases, you must also trigger a page-view tracking call so the visit is recorded correctly.
Tracking Product Views
The following parameters are recommended when tracking a product view:
productSKU (required) — String — A unique product identifier productName (required) — String — The name of the product categoryName (optional) — String or Array — Either a single category name or up to five categories as an array, for example ["Books","New Releases","Technology"] price (optional) — Number — The product price
The snippet must be added above our script tag to guarantee it runs before our script (which is loaded asynchronously).
Example product-view snippet
// Send product view data to Extellio — populate dynamically
window.extellio_actions = window.extellio_actions || {};
extellio_actions.push(['setEcommerceView',
"0123456789", // required: productSKU
"Ecommerce Analytics Book", // required: productName
"Books", // optional: categoryName
9.99 // optional: price
]);
Tracking Category Views
Use category tracking when the user views a category listing page rather than a specific product.
Parameters for a category view:
productSKU — Boolean — Set to false for category views.
productName — Boolean — Set to false for category views.
categoryName (required) — String or Array — The category name, or an array of up to five categories.
The snippet must be added above our script tag to guarantee it runs before our script (which is loaded asynchronously).
Example category-view snippet
// Send category view data to Extellio — fill dynamically
window.extellio_actions = window.extellio_actions || {};
extellio_actions.push(['setEcommerceView',
false, // productSKU not applicable
false, // productName not applicable
"Books" // required: categoryName
]);
Tracking Cart Updates in Extellio (Optional)
To track cart additions and removals, your site should send the full list of items currently in the cart whenever the cart changes. This includes all products remaining in the cart after an item is added, removed, or updated — not just the item affected by the latest action. Sending the complete cart ensures Extellio can accurately calculate cart value and identify abandoned carts.
Cart updates require two steps:
• Send an addEcommerceItem event for each product currently in the cart (SKU required at minimum).• Send a final trackEcommerceCartUpdate event containing the cart total value.
Cart Item Parameters
Each cart item can include the following fields:
productSKU (required) — String — A unique product identifier.productName (recommended) — String — The name of the product.categoryName (optional) — String or Array — One category or up to five categories, for example ["Books","Best sellers"].price (recommended) — Number — Product price.quantity (optional) — Integer — Quantity in cart (defaults to 1).
Example Cart Update Snippet
// Send one addEcommerceItem event for EACH item currently in the cart
extellio_actions.push(['addEcommerceItem',
"0123456789", // required: productSKU
"Ecommerce Analytics Book",// recommended: productName
["Books","Best sellers"], // optional: categoryName
9.99, // recommended: price
1 // optional: quantity
]);
// Send the cart total value
extellio_actions.push(['trackEcommerceCartUpdate', 15.5]);
Tracking Orders in Extellio (Required)
Order tracking is the minimum configuration required for Ecommerce analytics. Orders should normally be tracked on the confirmation page after payment has been successfully completed.
Order tracking requires two parts:
• Send product details for each purchased item (SKU required).• Send an order summary including a unique order ID and total revenue.
The unique order ID prevents the same purchase from being tracked multiple times.
Example: Adding Products to an Order
// Send one addEcommerceItem event for EACH purchased product
extellio_actions.push(['addEcommerceItem',
"01234567890", // required: productSKU
"Ecommerce Analytics Book", // recommended: productName
"Books", // optional: categoryName (or array)
9.99, // recommended: price
1 // optional: quantity
]);
Example: Tracking the Order Summary
Required and optional parameters:
orderId (required) — String — Unique order reference.grandTotal (required) — Number — Total revenue including tax and shipping minus discounts.subTotal (optional) — Number — Total excluding shipping.tax (optional) — Number — Tax charged.shipping (optional) — Number — Shipping cost.discount (optional) — Number or false — Discount value if applied.
extellio_actions.push(['trackEcommerceOrder',
"000123", // required: orderId
10.99, // required: grandTotal
9.99, // optional: subTotal
1.5, // optional: tax
1, // optional: shipping
false // optional: discount
]);
Developer Note — Currency Values Must Be Numbers
The following values must always be passed as numeric values (integers or floats), not strings:
• Item price
• grandTotal
• subTotal
• tax
• shipping
• discount
Invalid examples:
"5.3$"
"EUR5.3"
"5,4"
"5.44"
Valid examples:
5
5.3
5.44
If your platform returns currency values as strings, convert them before sending:
parseFloat("554.30");
If your system uses comma decimals (for example "25,3"), replace the comma with a dot before converting.
Additional JavaScript Methods
These helper methods may be useful, especially for single-page applications:
removeEcommerceItem(productSKU) — Removes an item from the tracked cart. Call trackEcommerceCartUpdate afterward.
clearEcommerceCart() — Clears all tracked cart items. Call trackEcommerceCartUpdate afterward.
getEcommerceItems() — Returns a copy of currently stored ecommerce items before they are tracked.