以下是在电子商务上执行的Google Analytics(分析)JavaScript代码(使用GA Debug抓取),用于非常简单的购买流程。
ga("create", "UA-NNNNNNN-1", "auto")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("set", "&cu", "EUR")
ga("ec:addImpression", {id: "488", name: "Light Coral", list: "Home Page list", category: "Some/Category/Path", price: "4.50", brand: "Coral", position: 1})
ga("ec:addImpression", {id: "487", name: "Light Purple", list: "Home Page list", category: "Some/Category/Path", price: "4.50", brand: "Purple", position: 2})
ga("ec:addImpression", {id: "489", name: "Light Pink", list: "Home Page list", category: "Some/Category/Path", price: "4.50", brand: "Pink", position: 3})
ga("ec:addImpression", {id: "491", name: "Light Red", list: "Home Page list", category: "Some/Category/Path", price: "4.50", brand: "Red", position: 4})
ga("ec:addImpression", {id: "717", name: "Light Blue", list: "Home Page list", category: "Some/Category/Path", price: "6.00", brand: "Blue", position: 5})
ga("ec:addImpression", {id: "768", name: "Light Pink 2", list: "Home Page list", category: "Some/Category/Path", price: "8.00", brand: "Pink", position: 6})
ga("ec:addImpression", {id: "92", name: "Light Green", list: "Home Page list", category: "Some/Category/Path", price: "5.95", brand: "Green", position: 7})
ga("ec:addImpression", {id: "712", name: "Light Orange", list: "Home Page list", category: "Some/Category/Path", price: "6.50", brand: "Orange", position: 8})
ga("send", "pageview")
ga("ec:addProduct", {id: "717", name: "Light Blue", category: "Some/Category/Path", price: "6.00", brand: "Blue", position: 5})
ga("ec:setAction", "click", {list: "Home Page list"})
ga("send", "event", "UX", "click", "Home Page list")
ga("create", "UA-NNNNNNNN-1", "auto")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("set", "&cu", "EUR")
ga("ec:addProduct", {id: "717", name: "Light Blue", brand: "Blue", category: "Some/Category/Path", price: "6"})
ga("ec:setAction", "detail")
ga("send", "pageview")
ga("ec:addProduct", {id: "717", name: "Light Blue", brand: "Blue", category: "Some/Category/Path", price: "6", quantity: "1"})
ga("ec:setAction", "add")
ga("send", "event", "UX", "click", "Add to cart")
ga("create", "UA-NNNNNNNN-1", "auto")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("set", "&cu", "EUR")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "checkout", {step: 1})
ga("send", "pageview")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "checkout", {step: 2})
ga("send", "pageview")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "checkout", {step: 3})
ga("send", "pageview")
ga("ec:setAction", "checkout_option", {step: 3, option: "Send to another address"})
ga("send", "event", "Checkout", "Option")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "checkout", {step: 4})
ga("send", "pageview")
ga("ec:setAction", "checkout_option", {step: 4, option: "BRT"})
ga("send", "event", "Checkout", "Option")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "checkout", {step: 5})
ga("send", "pageview")
ga("ec:setAction", "checkout_option", {step: 5, option: "banktransfer"})
ga("send", "event", "Checkout", "Option")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "checkout", {step: 6})
ga("send", "pageview")
ga("create", "UA-NNNNNNNN-1", "auto")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("require", "ec")
ga("set", "&cu", "EUR")
ga("ec:addProduct", {id: "717", name: "Light Blue", price: "6.00", brand: "Blue", category: "Some/Category/Path", quantity: 1})
ga("ec:setAction", "purchase", {id: "16O00000011", revenue: "16.00", shipping: "10.00"})
ga("send", "pageview")
在Google Analytics信息中心的电子商务部分,当我使用产品性能卡(产品性能>产品名称>产品SKU )时,我有一个产品类别下的(not set)
值:
在概述>中产品类别我可以看到产品的产品类别:
此外,如果我继续产品性能,请选择主要维度:产品类别(增强型电子商务),然后点击类别,我可以看到此产品表
我做错了什么?
产品性能卡中的原因是产品类别not set
?
答案 0 :(得分:0)
您可以参考以下答案来解决此问题:https://stackoverflow.com/a/24401449/3554477
之所以会发生这种情况,主要是因为Magento允许将一种产品与多个类别链接在一起,因此GA无法确定或跟踪与特定产品相关的类别。