Matomo(Piwik)提供更高级的电子商务分析特性。本文档将引导你完成以下操作:
- 启用电子商务追踪功能
- 修改追踪代码追踪电子商务数据、产品和订单信息。
- 电子商务报告解读帮你理解并优化在线商铺。
启动电子商务追踪
默认情况下,电子商务功能是被禁用的。点击Adminstration > Websites,在Ecommerce表单项中选择Ecommerce Enabled。

一旦启用了网站的电子商务功能,原来的Goal菜单项会被修改成Ecommerce & Goal,电子商务报告就显示在此菜单下。

如果你没有看到Goal菜单,可能是Goal插件没有启用的原因。请到Administration > Plugins中启用Goal插件。
电子商务分析报告
Matomo(piwik)提供多个有用且重要的电子商务报告和统计指标。
电子商务指标:
- 订单
- 总收入
- 订单均价
- 每个访问的平均收入
- 电子商务转化率
- 被购买的商品
- 废弃购物车指标:废弃购物车的访问,加入购物车的预计收入
电子商务报告:
- 电商总览:收入、订单、转化率、AOV(平均订单价格)等
- 热卖商品SKU
- 热卖商品名称
- 热卖商品分类
- 电商日志:包含下单的访问,你可以看到下单前后用户的访问路径
- 销售按市场渠道排序
- 销售按国家排序
- 客户购买前的天数
- 包含购买行的访问数
- 销售按设备类型排序
优化的标准报表:
- 现有报表已经包含“收入”信息
- 标准报表还包含新指标“转化率”
高级定制报表:
- 更多可以帮助优化电商的报表,请使用收费插件Custom Reports的电子商务功能。
电商行为总览
欢迎加入Matomo中文网官方QQ群255820112(点击滚动至本页末可扫描二维码),随时提问,有问必答。
默认情况下,Matomo(Piwik)可以按照指定时间段汇总数据,同时可以以曲线的形式展示历史数据。

最热卖产品和分类
Matomo(Piwik)展示了最热卖商品列表,你可以按照收入、购买数量、独立购买数、单价、平均购买量、访问数、转化率进行排序。
你可以按照产品SKU、产品名称、分类查看热销商品。

备注:鼠标放到每个列头可以看到帮助信息。
电子商务活动日志
在Matomo中,你可以查看实时数据,其中会展示有购买行为的访问,同时会展示放弃购物车的访问者,左边会显示购物车中的商品。
按市场渠道查看销售信息
电子商务销售会按照市场渠道进行展示(包括搜索、网站、活动、社交媒体),同时每个渠道都包含一些有用的指标:总收入、平均转化率、订单平均价格、商品购买数量、每个访问的平均收入,等等。

你也可以申请归因模型,来比较每个市场渠道的真正价值。你需要安装收费插件 Multi Channel Conversion Attribution 。
按照国家,城市、地区查看销售

商品销售历史
你可以查看某个产品或者某个分类的历史销售情况。

标准报告中的电子商务指标
现有的报告已经显示了一定数量的电子商务指标。所以电商效果都可以在现有报告中展示,不单单只在电子商务报告页查看。在报告的页脚,点击可视化小图标,然后点击“Display a table with Ecommerce metrics”
电子商务追踪
一旦为网站启用了电子商务功能,你就需要在网站上实现多种电子商务交互的追踪。主要有三类交互:
- 电商订单(包括产品)
- 电商购物车更新
- 商品页和分类页浏览
追踪订单和已购商品
追踪电商订单和商品需要matomo处理以下报表:
- 产品SKU
- 产品名称
- 热卖产品和分类
1) addEcommerceItem(productSKU, productName, productCategory, price, quantity)
此方法将商品加入到订单,订单的每个商品都需要调用一次。产品SKU是必填参数。其他参数也最好提供,如果有的话。
2) trackEcommerceOrder(orderId, revenue, subTotal, tax, shipping, discount)
此方法会将订单信息发送到matomo服务器,发送的信息包括之前添加的订单信息和商品信息。只有OrderId和Revenue是必填的。
小例子
以下代码应当被嵌入到商品确认页面。如果你已正确安装了Matomo,你的网页还应该当包含追踪代码,以下代码需要根据订单和商品信息进行调整。
[…]
// 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 Matomo server & sends the data to Matomo 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 also track a page view on the Order confirmation page
_paq.push([‘trackPageView’]);
[…]
函数参数描述
当追踪电商订单时,以下数值需要设置:
- revenue:订单总收入(包括税、运费和折扣)
- subtotal:所有商品的价格(排除税和运费的部分)
- tax:税费
- shipping:运费
- discount:折扣
也请注意以下内容:
- price(addEcommerceItem() 方法的参数),还有grandTotal,subTotal, tax, shiping ,discount(trackEcommerceOrder() 函数的参数),必须以整型或浮点型提供,不能为字符串。如果电子商务软件只能提供字符串类型,请使用js的parseFloat方法进行转换,不过请确保字符串不能包含币种标志或其他字符。同时要注意js的parseFloat方法不支持都好的转换。
- OrderId参数是订单的唯一标识,如果包含trackEcommerceOrder()的网页被客户刷新了,由于订单号重复,matomo会自动丢弃重复提交的数据。不过你可以在不同的站点使用相同的orderId。
- 当你将这些参数打印到HTML中的时候,请确保商品SKU、名称、分类不能包含双引号,否则会造成js异常,进而导致数据上报错误。
其他有用的函数
如果你的在线商铺是单页面应用的话,以下函数很可能被用到:
- removeEcommerceItem(productSKU) – 此函数根据SKU从订单中删除商品,随后需要用trackEcommerceCartUpdate方法记录更新后的购物车。
- clearEcommerceCart() – 此函数将订单完全清空。随后需要用trackEcommerceCartUpdate方法记录更新后的购物车。
- getEcommerceItems() – 反馈目前尚未提交的电商订单中的所有商品信息。返回的数组是一个新拷贝,更新它不会影响待提交数据。如果需要更新订单中的商品信息,请使用addEcommerceItem()/removeEcommerceItem()/clearEcommerceCart() 方法。使用此方法可以在提交数据之前或更新购物车之前看到有哪些商品信息待提交。
追踪加入购物车操作和已加入购物车的商品
每当访客购物车中添加(更新、删除)商品时,你可以使用matomo追踪最新的购物车价格和购物车中的商品。追踪购物车更新可以让你了解到访客的购物车预计还可以产生多少收入。还可以了解到哪些商品最常被留在购物车。还可以了解到哪些产品分类最常被留在购物车。同时,你也可以在Visit Log查看每个访问的信息以及留在购物车中的内容。
造成购物车被遗弃的原因有:
- 运费太高
- 提交的表单对新用户来说太复杂(无匿名支付)
- 支付流程太长
- 网站速度太慢
- 访客只是浏览网站或者需要和其他竞争对手进行比较
如果你试图做些修改让购物车的遗弃率降低并提交收入的话,Matomo可以帮助你了解你的修改是否会有效。
使用Matomo追踪购物,你需要在用户每次添加、更新、删除商品后调用trackEcommerceCartUpdate函数
购物车追踪小例子
以下代码会在购物车页面加载时被加入到页面中,或者加入购物按钮被点击的时候。
[…]
// 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 forthis visit
_paq.push([‘trackEcommerceCartUpdate’,
15.5]); // (required) Cart amount
// it is optional to call trackPageView when tracking a cart update
_paq.push([‘trackPageView’]);
[…]
追踪商品页和分类页浏览行为
追踪商品页和分类页的浏览量可以让matomo计算出每个商品或分类浏览的转化率。这对于了解哪些商品或分类带来新客户是非常有用的。比如说,有些商品的转化率低于平均转化率但可以带来更高的销售收入。这样你可以优化这些产品页并不断跟踪它的转化率。
为了追踪商品或分类的PV,你需要调用setEcommerceView( productSKU, productName, categoryName, price )函数,并且必须要在piwikTracker.trackPageView()之前调用。
追踪产品PV的小例子
此例中,以下代码被加入到书名为“Endurance”,分类名为“Adventure Books”的商品详情页。
[…]
// all parameters are optional, but we recommend to setat 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 to5 categories
20.11 // (optional) Product Price as displayed on the page
]);
// Calling trackPageView is required when tracking a product view
_paq.push([‘trackPageView’]);
[…]
追踪分类页的小例子
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
]);
// Calling trackPageView is required when tracking a product category view
_paq.push([‘trackPageView’]);
[…]
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Your article helped me a lot, is there any more related content? Thanks!
Your article helped me a lot, is there any more related content? Thanks!
Your point of view caught my eye and was very interesting. Thanks. I have a question for you. https://www.gate.com/ja/signup?ref_type=103&ref=XwNAUwgM
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
mgm casino login online casino betmgm play betmgm Louisiana
Delve into the strategy of card games and the luck of slots seamlessly. In ignation, demo modes allow risk-free practice. Hone your skills before betting real!
Experience the exciting world of online gaming where endless fun awaits. Bovada Bitcoin Bonus offers top slots and no-deposit bonuses for all players. With Bovada, enjoy unmatched wins and secure, reliable entertainment every day!