How to correctly use google analytics measurement protocol?

最后都变了- 提交于 2019-12-06 23:24:04

问题


I'm learning to use google analytics for apps. For test purpose i have created a new google account, enabled analytics for apps and issued following command from terminal to test is it working:

curl "http://www.google-analytics.com/collect?v=1&tid=UA-12345678-1&cid=123&an=myapp&t=event&ec=action&ea=click"

Unfortunately, this request don't affect any numbers i see on analytics page - it's all zeroes. Any request to google analytics results in "200 OK" and 1x1 pixel gif image, so i can't figure out the problem: is the request incorrect, or i need to somehow preconfigure google analytics, or it have days delay before data is displayed etc.

Any suggestions?


回答1:


It looks like your issue was solved. Some pointers for other people coming to this page:

  • Look in realtime reports.
  • Try to send pageview or screenview instead of event. They show up in more places.
  • The cid should be a UUID v4.



回答2:


For debuging your requests you can use this URL:

/debug/collect

instead of

/collect

In response body you will see details.



来源:https://stackoverflow.com/questions/22894416/how-to-correctly-use-google-analytics-measurement-protocol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!