Xev*_*jol 4 analytics google-analytics google-analytics-api universal-analytics measurement-protocol
使用analytics.js时,我可以通过这种方式成功跟踪包括自定义维度的事件(如文档中所述):
ga('send', 'event', 'category', 'action', {
'metric18': 8000,
'dimension6': 'crocodile'
});
Run Code Online (Sandbox Code Playgroud)
但是,当使用测量协议(即HTTP请求)时,我似乎无法找到将自定义维度和指标包含在事件跟踪中的方法,因为我在文档中没有找到任何参考.
这是我到目前为止所尝试的(基于文档中的示例).在这两种情况下,事件实际上都已被跟踪,但没有任何自定义维度或指标关联.
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&metric18=8000
&dimension6=crocodile
Run Code Online (Sandbox Code Playgroud)
和
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&el={"metric18":8000,"dimension6":"crocodile"}
Run Code Online (Sandbox Code Playgroud)
根据收集偏差您使用的参数名称错误,请尝试:
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&cm18=8000
&cd6=crocodile
Run Code Online (Sandbox Code Playgroud)
(您正在查看的偏离部分是用于跟踪JS而不是集合.)