我将Angular中的点击事件编码如下:
onProductClicked() {
(<any>window).ga('send', 'event', {
eventCategory: 'Click',
eventLabel: this.item.provider,
eventAction: 'click-on-product',
eventValue: this.item.price + "~" + this.item.name
});
}
上述事件会在我的Chrome控制台上触发以下请求:
https://www.google-analytics.com/r/collect?v=1&_v=j70&a=2055787371&t=event&_s=2&dl=http%3A%2F%2Flocalhost%2Fsearch%3Fq%3Diphone%2520x&dp=%2Fsearch%3Fq%3Diphone%2520x&ul=en-us&de=UTF-8&dt=mydomain.com&sd=24-bit&sr=1366x768&vp=817x657&je=0&ec=Click&ea=click-on-product&el=Domain&ev=Rp%204.423.395%2C-~IPhone%206%20&_u=SACAAEAB~&jid=XXXXXXXXX&gjid=XXXXXXXXX&cid=XXXXXXX.XXXXXXXXXX&tid=UA-XXXXXXXXX-X&_gid=XXXXXXXXX.XXXXXXXXX&_r=1&z=XXXXXXXXX
我的问题是,为什么上述事件没有在Google分析仪表板的“事件”仪表板中捕获?
我有什么想念的吗?
请您参考如下方法:
由于事件值(ev)的期望值类型是整数,而不是字符串,因此未显示是因为发送的匹配无效。
取自Measurement Protocol的Parameter Reference for ev:
+-----------+------------+---------------+------------+---------------------+
| Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
+-----------+------------+---------------+------------+---------------------+
| ev | integer | None | None | event |
+-----------+------------+---------------+------------+---------------------+
我建议进行必要的修改,并尝试通过 Hit Builder发送匹配,以确保一切正常。


