piwik e-commerce 跟踪,piwike-commerce


piwik的电子商务跟踪功能主要包括 订单跟踪,订单详细跟踪,购物车跟踪,产品页浏览跟踪和产品目录页跟踪

1、订单跟踪

在客户端的跟踪脚本里添加
_paq.push(['trackEcommerceOrder',
"C10000123", // (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)
]);

订单请求参数如下:ec_id=C10000123&revenue=35&ec_st=30&ec_tx=5.5&ec_sh=4.5&ec_dt=false,不需要的参数将其值设置为false

2、订单详细跟踪

// 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
]);

订单请求参数如下:ec_items=%5B%5B%229780786706211%22%2C%22Endurance%3A%20Shackleton's%20Incredible%20Voyage%22%2C%22Adventure%20Books%22%2C8.8%2C1%5D%5D 用url解码后 
ec_items=[["9780786706211","Endurance: Shackleton's Incredible Voyage","Adventure Books",8.8,1]]

3、购物车跟踪

_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
]);

// Records the cart for this visit
_paq.push(['trackEcommerceCartUpdate',
15.5]); // (required) Cart amount
_paq.push(['trackPageView']);

请求的参数如下

revenue=15.5&ec_items=[["9780786706211","Endurance: Shackleton's Incredible Voyage",["Adventure Books","Best sellers"],8.8,1]]
购物跟踪需要在每次用户添加或是删除商品的时候发送请求,这种请求的参数里携带产品信息和总金额,但是没有订单号

4、产品页浏览跟踪

_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
]);

请求的参数如下
cvar={"2":["_pkp",20.11],"3":["_pks","9780786706211"],"4":["_pkn","Endurance: Shackleton's Incredible Voyage"],"5":["_pkc","Adventure Books"]}
可以看出 产品页的跟踪是用预留的5个kv对进行存储的,每个kv对的前面数字就是kv对的顺序,例如"3":["_pks","9780786706211"] 中的3就是在kv3中存储

5、产品目录页跟踪

_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
]);

请求的参数如下
cvar={"5":["_pkc","Adventure Books"]}
目录页的跟踪也是用预留的kv对存储,使用的是第5个kv对

相关内容

    暂无相关文章