If you run an online store and want to track transactions along with web analytics data, you can use ecommerce tracking and ecommerce reports in Piwik PRO. In this article, we’ll explain how to do that.
- Add to cart: This function tracks when a product is added to the cart. It automatically creates an abandoned cart. In other words, every uncompleted order is tracked as an abandoned cart in Piwik PRO. It also tracks when a product is removed from the cart.
_paq.push(['addEcommerceItem',productSKU, productName, productCategory, price, quantity]);
- Checkout: This function tracks when a visitor clicks the checkout button and updates the total cart value. At this stage, the cart is still treated as an abandoned cart.
Note: Payment in the shopping process is usually processed by an external payment gateway like PayPal or Google Pay, and therefore can’t be tracked.
- Order completed: This function tracks when a visitor is redirected to the thank-you page after paying for the order. It automatically updates the cart from an abandoned cart to order.
_paq.push(['trackEcommerceOrder',orderId, orderGrandTotal, orderSubTotal, orderTax, orderShipping, orderDiscount]);
For developers: For more information on ecommerce tracking, read our developer guides.
|Shopping stage||Tracking method|
|View a product||Page view and content tracking|
|Click product details||Custom event|
|Shipping information||Custom events and user flow|
|Promotions||Custom events and content tracking|
|Promo codes||Custom events|
At the same time, when you’re setting up ecommerce tracking, you need to turn on ecommerce reports in Analytics. Ecommerce is the additional section in Analytics that is not displayed by default and can be turned on or off at any moment. In this section, you’ll see all data tracked for your store.
To turn on ecommerce reports, follow these steps:
- Go to Menu > Administration.
- Select the site you want to work with.
- Navigate to Reports.
- Turn on Show ecommerce reports.
- Done! Now you can see an ecommerce section in Analytics. Reports in this section will fill up with data as soon as you set up tracking for each ecommerce element.
For more, read our article about ecommerce reports.