E-commerce tracking: overview
Important: E-commerce tracking is available on the Business plan and above.
Trackboxx gives you full e-commerce tracking for your online shop, similar to the e-commerce reports in Google Analytics.
It also captures the following data:
- Product revenue
- Top channel (based on sales)
- Basket abandonment
- Best-selling product
- Best-performing day within the selected period
- Your most-viewed products
- All orders, including the relevant landing page—the first page a visitor viewed during their session
- Sales by channel (such as Facebook or referring websites), country and region, UTM source, browser and device
All data can be filtered and sorted. This allows you to analyze the performance of your online shop in great detail.
Each section includes both a standard view and a more detailed breakdown.
This gives you another way to explore the data.

Use / Activation of E-Commerce Tracking
E-commerce tracking is automatically available starting from the Business plan.
Integration of the Code for E-Commerce Tracking
For the e-commerce tracking to work, additional scripts need to be integrated into your website.
Basically, there are two ways to integrate these scripts into your site:
- Manual Integration
- Integration via a corresponding plugin
Manual Integration
Manual integration requires programming knowledge and should only be performed by experienced developers.
This guide explains how to add Trackboxx e-commerce tracking to any shop manually, whether you use a custom system, Shopify, Shopware, Magento or another platform. For WooCommerce, our official plugin automatically triggers all the events described here.
Basic logic: What is meant by trackboxx('Purchase', [...])?
Before we get to the individual events, an important point to understand - experience has shown that this point is most frequently misinterpreted:
Important: trackboxx('Purchase', [...]) is not a single event, but the generic call for all e-commerce interactions. The first object in the array determines which event is tracked through its type field:
{ type: 'ViewProduct' }- Product detail page{ type: 'AddToCart' }– Product added to the basket{ type: 'ViewCart' }– Basket page viewed{ type: 'order' }- Order completed
The 'Purchase' in the function call simply refers to the “e-commerce” action category and always remains the same—regardless of whether you are tracking a product view, an add-to-cart or an actual purchase.
The four e-commerce events at a glance
1. ViewProduct – Product detail page
Trigger: When calling up a product detail page.
Minimum data: Product name and unit price.
<script>
trackboxx('Purchase', [
{ type: 'ViewProduct' },
{ type: 'product', name: '%%PRODUCT_NAME%%', price: 99.90 }
]);
</script>Code language: HTML, XML (xml) Notes:
price= Unit price of the product (numeric, dot as decimal separator).- Optional additional fields:
sku,category. - For variants or bundles: pass the complete variant name, including attributes (e.g. “T-shirt—red, L”), so that reports are aggregated consistently.
2. AddToCart – Product added to the basket
Trigger: After a successful “Add to basket” action—not simply when the button is clicked.
Minimum data: Product name and unit price.
<script>
trackboxx('Purchase', [
{ type: 'AddToCart' },
{ type: 'product', name: '%%PRODUCT_NAME%%', price: 19.99 }
]);
</script>Code language: HTML, XML (xml) Notes on timing - depending on the shop type:
- Custom shops and AJAX baskets: Trigger the event in the success callback of the add-to-basket action, not in the click handler. This prevents a tracking event from being recorded if the item never reaches the basket because of a stock check, validation issue or network error.
- Server-side shops with redirect: Trigger event once on the following page after a successful add.
- Simple button-click integrations: permitted, but only if it is ensured that the click actually leads to a successful add (e.g. button-disabled check for sold-out products).
- Deduplication: Send AddToCart only once per action - no duplication for reload or back navigation.
3. ViewCart – Basket page
Trigger: When the basket page is opened.
Minimum data: Cart total (amount). Optional: all included products as separate objects.
<script>
trackboxx('Purchase', [
{ type: 'ViewCart' },
{ type: 'cart', amount: 149.70 },
{ type: 'product', name: 'Produkt A', price: 99.90 },
{ type: 'product', name: 'Produkt B', price: 49.80 }
]);
</script>Code language: HTML, XML (xml) Notes:
amount= total basket value. Standard: Net (corresponds to the behaviour of the official WooCommerce plugin).- If your shop works with gross prices, gross values are also permitted - the decisive factor is Consistency within an event:
cart.amountand allproduct.price-values must be calculated on the same basis (all net or all gross). - For each basket line, append a separate
product-object. - The
priceper product corresponds to the Item total (unit price × quantity)—see “Price logic & quantity”.
4. Purchase – Order completion (thank-you page)
Trigger: On the order confirmation page after successful payment - exactly once per order.
Minimum data: Order ID, total amount, all products purchased.
<script>
trackboxx('Purchase', [
{ type: 'order', id: 'ORDER_ID', total: 149.70 },
{ type: 'product', name: 'Produkt A', price: 99.90 },
{ type: 'product', name: 'Produkt B', price: 49.80 }
]);
</script>Code language: HTML, XML (xml) Optional - with voucher: For each voucher used, append an additional coupon-object.
<script>
trackboxx('Purchase', [
{ type: 'order', id: '12345', total: 149.70 },
{ type: 'coupon', name: 'SUMMER10', discount: 10.00 },
{ type: 'product', name: 'Produkt A', price: 99.90 },
{ type: 'product', name: 'Produkt B', price: 49.80 }
]);
</script>Code language: HTML, XML (xml) Notes:
- The Purchase event has no preceding event marker like those used for ViewProduct or AddToCart—the
orderobject identifies the event itself. order.id= unique order ID from the shop system.order.total= total value of the order (gross final amount including shipping and taxes is recommended, but must be consistent with the product.price values).product.price= Item total (unit price × quantity), not unit price.- Protect against multiple firing (reload protection), e.g. via server-side flag or session marker.
Price logic & quantity
Trackboxx does not use a separate quantity field. Quantities are represented implicitly through the price. This rule is binding and should be implemented consistently in every integration:
| event | Meaning of price |
|---|---|
ViewProduct | Unit price of the product |
AddToCart | Unit price of the product |
ViewCart | Item total (unit price × quantity) |
Purchase (order) | Item total (unit price × quantity) |
Example: Three identical items at €19.99 each in the basket are sent for ViewCart and Purchase as one product object with price: 59.97—not as three separate objects and without a quantity field.
Sequence of objects in the array
For a clean, consistent integration, we recommend the following sequence of objects:
- Event marker or
orderobject (ViewProduct/AddToCart/ViewCart/order) cart-object (only for ViewCart)coupon-Objects (only for Purchase, if available)product-objects
Best Practices
- Deduplication: Send each event only once per actual action—avoid double tracking on reload, back navigation or AJAX retries.
- Timing:
ViewProductandViewCartfire on page load.AddToCartafter confirmed addition.Purchaseonce on the thank you page. - Prices & amounts: As
Number(not a string), with a dot as decimal separator (e.g.19.99- not"19,99"). - Consistency: Net or gross is a decision per shop - but then consistently for
cart.amount,product.priceandorder.total. - Data protection: Never hand over personal data - no e-mail addresses, names, customer numbers or addresses. Respect consent.
Quick checklist per shop system
- WooCommerce: Use the official Trackboxx plugin. It triggers all four events (
ViewProduct,AddToCart,ViewCart,Purchase) automatically - no manual integration necessary. - Custom Shops: On the server, insert the product name, price and total as variables in the relevant inline script.
- Shopify: Insert snippets into the templates (
product.liquid,cart.liquid, checkout thank-you page). ForAddToCart, use the AJAX success callback. - Shopware / Magento: Connect the calls to the relevant theme or plugin events and hooks: product page, basket page, add-to-basket event and order-complete event.
Reference: Minimal variants
ViewProduct (minimal)
trackboxx('Purchase', [
{ type: 'ViewProduct' },
{ type: 'product', name: 'Product Name 1', price: 19.99 }
]);Code language: JavaScript (javascript) AddToCart (minimal)
trackboxx('Purchase', [
{ type: 'AddToCart' },
{ type: 'product', name: 'Product Name 1', price: 19.99 }
]);Code language: JavaScript (javascript) ViewCart (minimal)
trackboxx('Purchase', [
{ type: 'ViewCart' },
{ type: 'cart', amount: 19.99 }
]);Code language: JavaScript (javascript) Purchase (minimum)
trackboxx('Purchase', [
{ type: 'order', id: 'ORDER_ID', total: 19.99 },
{ type: 'product', name: 'Product Name 1', price: 19.99 }
]);Code language: JavaScript (javascript) Brief overview: The most important rules
trackboxx('Purchase', [...])is a generic e-commerce call, not an event.- The event type is in the payload (
type-field of the first object), not in the function call. - Trigger
AddToCartafter a successful addition to the basket—not simply when the button is clicked. cart.amountas a net value by default; gross allowed, but consistent within the event.price= Unit price atViewProduct/AddToCart, item total forViewCart/Purchase.- No separate
quantity-field - quantities via the price. - Purchase event based on
{ type: 'order' }without a preceding event marker. - Prices as number with dot decimal separator, never as string.
- No personal data in the payload.
Integration via Plugin
Currently, integration via plugin is possible with the following systems:
- WordPress – Click here to download the Plugin
- JTL – Click here to download the plugin
We will gradually implement additional plugins.
Currently in progress:
- ePages (now available)
- Shopware
Display of the most viewed products
To display this information, please follow these steps:
- click on the cogwheel for the settings and select "Websites"
- For the relevant website, click the three dots next to its name.

The pop-up gives you two ways to use and configure this output:
- Your products have a unique path - for example: www.webseite.de/produkte/produkt-XYZ
In this example, the path is “produkte”. Use the first option and enter this path in the corresponding field:
The format would be: (.*)/produkte/(.*)
2. If there is no unique path, we would need to use the Google Product Feed. Typically, this is used in an online shop.
Simply enter this feed and save it.

