Google Analytics HTTP请求中未跟踪自定义维度(度量协议)

时间:2014-09-23 08:06:01

标签: google-analytics analytics google-analytics-api universal-analytics measurement-protocol

使用analytics.js时,我可以通过这种方式成功跟踪包括自定义维度的事件(如in the docs所述):

ga('send', 'event', 'category', 'action', {
    'metric18': 8000,
    'dimension6': 'crocodile'
});

然而,当使用测量协议(即HTTP请求)时,我似乎无法找到在事件跟踪中包含自定义维度和指标的方法,因为我还没有找到任何参考文档。

这是我迄今为止所尝试的内容(基于the documentation中的示例)。在这两种情况下,事件实际上都已被跟踪,但没有任何自定义维度或指标相关联。

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

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"}

1 个答案:

答案 0 :(得分:8)

根据您使用错误参数名称的collection devguide,请尝试:

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

(您正在查看的偏离部分是针对网络跟踪JS而非集合。)