9

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?

grigoryvp
  • 40,413
  • 64
  • 174
  • 277

2 Answers2

6

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.
Avi
  • 2,373
  • 17
  • 22
  • Still couldn't see anything in my real time. One question does the UUID v4 needs to be generated each time of the request? – Debopam Mitra May 05 '14 at 06:57
  • nope. The uuid should stay the same for a given user+device combination. If you change it with every request, you'll see a lot of unique users even though they are repeat visitors. – Avi May 05 '14 at 18:45
  • Can you guide me how to get the user+device UUID combination? – Debopam Mitra May 06 '14 at 06:23
  • I am not sure what you mean by get uuid. UUID v4 is a anonymous, random id that can be generated by following instructions here: https://en.wikipedia.org/wiki/UUID#Version_4_.28random.29. You need to generate the id from whichever language you are using. – Avi May 06 '14 at 21:45
  • Ok. I get it. I tried all the way. I followed all the instructions as per the Google Analytics Measurement Protocol. But all the time I get a GIF 89. I don't see any activity in my Analytics Real Time console. – Debopam Mitra May 08 '14 at 04:57
  • @Debopam did you resolved your issues? i have the same situation here, no realtime stats... – 350D Jan 13 '16 at 18:16
5

For debuging your requests you can use this URL:

/debug/collect

instead of

/collect

In response body you will see details.