Google Analytics: Are custom metrics "integers only" when sent in through the measurement protocol?

时间:2016-06-30 08:17:29

标签: google-analytics measurement-protocol

We need to send a decimal value to google analytics, and had decided to do this using a custom metric of the type "Currency". In the Tracking documentation it says that this should be allowed:

If the custom metric is configured to have a currency type, you can send decimal values.

https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#sending_data

但是,我们使用测量协议发送原始数据,并且在 文档中,它表示只允许整数用于自定义指标: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cm_

我注意到我们发送的十进制值没有显示在UI中。这可能是原因吗?

1 个答案:

答案 0 :(得分:2)

自定义指标不仅限于整数类型。它们可以是您想要的任何类型,只要它与您在Google Analytics管理界面中creating them时设置的类型相对应。

简而言之:对于 Integer Time 类型的指标,自定义指标值应为整数,对于类型的指标,它们可以是整数或浮点数货币

文档不正确(当询问此问题时),但已更新以澄清这种歧义。