PIWIK - Ecommerce Analytics & Segmentation
Ecommerce Analytics
Ecommerce Analytics – Piwik Docs
Piwik analytics – Odoo Apps
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:
- Ecommerce Orders (and products),
- Ecommerce Cart update (and products),
- Product (and/or category) page views.
Tracking Ecommerce Orders & Items Purchased (required)
Tracking Ecommerce orders and product details will allow Piwik to process reports on:
- Product SKU,
- Product name,
- Top Product categories and general overview of Ecommerce performance in your online shop.
To track Ecommerce orders, two Javascript functions are used:
-
addEcommerceItem(productSKU, productName, productCategory, price, quantity)
This adds a product into the order, and must be called for each product in the order.productSKU
is a required parameter, it is also recommended that you send other parameters if they are applicable in your Ecommerce shop. -
trackEcommerceOrder(orderId, grandTotal, subTotal, tax, shipping, discount)
This tracks an Ecommerce order and sends the data to your Piwik server, for both this order and products previously added. Only orderId and grandTotal (ie. revenue) are required.
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. The Ecommerce code below must be added and generated based on the Order:
Important notes about the functions parameters:
-
price (parameter of addEcommerceItem() function), grandTotal, subTotal, tax, shipping, discount (parameters of trackEcommerceOrder() function) must be supplied as integer or floats, not as string. For example, all the following values are not valid: “14.4$”, “EUR14.4”, “14,4”, “14.4”. The following values are valid: 5, 3.3, 5.44. If your Ecommerce software provides the values as string only, you can call the Javascript function
parseFloat()
after making sure the string does not contain currency symbol or other characters, for example: parseFloat(“554.20″). -
orderId parameter 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, Piwik 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.
Tracking Add to Cart & Items Added to the Cart (optional)
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:
??
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.
Tracking Product Page Views & Category Page Views (optional)
To track a product or category page view, the function setEcommerceView(productSKU, productName, categoryName, price)
is used, just before the call to 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”:
Example tracking a Category page view
This code is added on the Category page “Adventure Books”
Check out the full documentation and example links at: Ecommerce Analytics API Reference
Segmentation – Useful segments you can create
Custom segment: Customers
See everyone who bought something from you.
Visit Ecommerce status at the end of the visit is
ordered
OR Visit Ecommerce status at the end of the visit isorderedThenAbandonedCart
Questions to ask yourself
What did everyone who bought something from you buy?
Did they come back or did they buy something and leave forever?
What did they do before they bought something?
Custom segment: Returning customers
See everyone who bought something and then came back for more.
Visit Ecommerce status at the end of the visit is
ordered
AND Number of Visits is greater than1
Questions to ask yourself
What did everyone who bought something and came back look for?
Did they find it and buy it? Or did they leave empty handed?
If they left, did they come back or did they leave forever?
Custom segment: Bounced visits
See everyone who visited your website and immediately left.
Number of Actions equals
1
Questions to ask yourself
What pages are these visitors visiting?
What keywords were they using?
Why do you think those pages didn’t answer their questions?
Custom segment: Everyone who doesn’t bounce
See everyone who visited your website and stuck around.
Number of Actions is greater than
1
Questions to ask yourself
What do people who stick around on your website look for?
How do they get to your website?
Are they looking for something your website doesn’t provide?
Use your imagination, stay curious and you’ll stumble upon insights that will help you prosper.
Custom segment: Mobile visitors
See everyone who accessed your website from a mobile device. Note: to access this segment, first enable the “DevicesDetection” plugin.
Device type is
smartphone
OR Device type istablet
OR Device type isfeature phone
Questions to ask yourself
Do you get a lot of visitors from mobile devices?
Can they successfully navigate and use your website?
What pages don’t they visit or spend much time on?
Custom segment: Visits from the region your business is located in
See everyone who accessed your website from certain region.
Country is
xx
AND Region isxx
Questions to ask yourself
Do you get a lot of visitors near your business?
What information do they look for on your website?
Custom segment: Commenters
See everyone who commented on your website. Note: This segment depends first on setting up a Custom Variable commenter_id
.
Custom Variable name 1 (scope visit) is
commenter_id