Piwik provides advanced ecommerce analytics features. This page will guide you through the following steps:
Ecommerce reporting is disabled by default. To enable Ecommerce analytics reporting, click on Settings > Websites > Edit” and select Ecommerce enabled from the dropdown in the Ecommerce column.

Once Ecommerce is enabled for a website, the Goals menu will be renamed to Ecommerce & Goals and will display Ecommerce reports.

If you do not see the Goals menu, it is probably because the Goals plugin is disabled.
Go toSettings & Pluginsto enable the Goals plugins.
If you use a popular Ecommerce Software platform such as Magento, Prestashop, Zen Cart, oxid, VirtueMart or osCommerce, there could already be a Piwik Plugin that will install the tracking automatically on your pages. Click on this link and then download the Piwik plugin, install the plugin in your Ecommerce app, enter the Piwik URL, Website Id in the plugin settings. Your Ecommerce pages should then be automatically tagged with the Javascript code and track Cart Updates, Orders and Products/Category views.
If your platform is not in this list, please consider developing an open source plugin to enable Ecommerce Tracking for the software you use. We would be glad to add it the Plugin List and have the whole community benefit!
If you use a custom-made Ecommerce software, you must implement Ecommerce Tracking using the Javascript function calls, in your website pages.
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 Piwik:
The following sections explain how to set up Ecommerce tracking, using the JavaScript Tracker Ecommerce tracking methods.
Tracking Ecommerce orders and product details will allow Piwik to process reports on:
To track Ecommerce orders, two Javascript functions are used:
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 Piwik 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
_paq.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 Piwik server & sends the data to Piwik server
_paq.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
_paq.push(['trackPageView']);
[...]
Important notes about the functions parameters:
Every time a visitor adds (or updates, deletes) an item from his/her cart, you can use Piwik 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. Also, you can visualize each visit and the content of the cart they abandoned in the Visitor Log.
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 Piwik to understand if your changes are making a positive impact.
To track Shopping Carts with Piwik, you would call the javascript function trackEcommerceCartUpdate() every time a user is adding, updating or deleting a product from the cart.
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
_paq.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
_paq.push(['trackEcommerceCartUpdate',
15.5]); // (recommended) Cart amount
_paq.push(['trackPageView']);
[...]
Tracking product page views, and/or category page views lets Piwik 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 piwikTracker.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
_paq.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
]);
_paq.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
_paq.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
]);
_paq.push(['trackPageView']);
[...]
In your Piwik interface, you can find Ecommerce reports by clicking on the main menu on “Ecommerce & Goals”.
Assuming you have set up Ecommerce tracking as explained above, Piwik will provide the following Ecommerce reports
By default, Piwik will display the Ecommerce metrics for the selected date range, as well as a graph showing historical values for the selected metric.

Piwik processes the list of Top Products sold, ordered by any of the Product metrics: Revenue, Quantity purchased, Unique Purchases, Average price, Average quantity, Visits or Conversion rate.
You can get the top products reports by Product SKU, by Product Name or by Category.

Note that you can access a help definition for each column by hovering on the column name.
With Piwik, you can view (in real time!) the detailed Ecommerce log, showing all visits that have made a purchase on your website, as well as all visitors who have abandoned their shopping cart with products left in them.

Existing reports will now display the Ecommerce metrics in column list, so that Ecommerce performance can be visualized in any existing report and not only in the Ecommerce report page.

All the data available in the User Interface Ecommerce reports is also available via the Piwik Analytics API.
You can easily request the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category.
For each entry; the following metrics are returned:
You can request these reports for Ecommerce orders, and also for abandoned carts.
Check out the full documentation and example links at: Ecommerce Analytics API Reference
More information
We hope you enjoy using Piwik to track your Ecommerce shop(s), and that Ecommerce analytics helps you to generate more revenue from your website, as well as keeping your customers happy.
For a list of the feature requests around Ecommerce Tracking & Reporting in Piwik, check out the ticket Ecommerce Analytics feature requests.
If you have any feedback or question about this documentation, please post a message in the Forums or in the feedback form below.
Feedback on this page
Have you found an error in this page, or do you think some information is missing or not clear? We appreciate you taking the time to send us your suggestions and feedback on this page.