这是使用增强型电子商务从GA通用确认页面发送的代码:
ga("create", "UA-XXXXXXX-xx", "auto");
ga("require", "displayfeatures");
ga("require", "ec");
ga("ec:addProduct", {
Id: null,
Name: "ProductNameTest",
Brand: "Foo",
Category: null,
Variant: null,
Price: 5.49,
Quantity: 1,
Coupon: "",
Position: 0
});
ga("ec:setAction", "purchase", {
Id: "33558",
Affiliation: "Foo",
Revenue: 5.49,
Tax: 0,
Shipping: 0,
Coupon: "",
List: null,
Step: 4,
Option: null
});
ga("send", "pageview");
我没有在GA调试器或Chrome的Tag Assistant插件中看到任何问题。
我在这里缺少的是我们的转化数据/交易没有出现?
编辑:
以下是我为上述内容删除的GA调试器的输出:
Initializing Google Analytics.
Loading resource for plugin: ec
Loading script: "http://www.google-analytics.com/plugins/ua/ec.js"
Running command: ga("create", "UA-XXXXXXX-xx", "auto")
Creating new tracker: t0
Running command: ga("require", "displayfeatures")
Set called on unknown field: "dcLoaded".
Plugin "displayfeatures" intialized on tracker "t0".
Running command: ga("require", "ec")
Waiting on require of "ec" to be fulfilled.
Executing Google Analytics commands.
Registered new plugin: ga(provide, "ec", Function)
Running command: ga("require", "ec")
Plugin "ec" intialized on tracker "t0".
Running command: ga("send", "pageview")
答案 0 :(得分:4)
我看到一些可能影响您的交易的问题:
ga("require", "ec")
个命令。Id
addProduct
为空。这是一个required value,应该是一个字符串。ga("send", "pageview");
修改强>
关于第2点,如果开发人员正在传递name参数的值,则Id
的{{1}}可以为null(请参阅Product Data table)。
所有属性键必须为小写,addProduct
应为Id
。 (感谢Eduardo指出)。