Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Universal Analytics Measurement Protocol respond 200 OK, but no events appers

I am sending events from Winform application to Universal Analytics via Measurement protocol and I use fiddler to inspect the request and response. Everything seems to be OK, but no events appears in Universal Analytics.

My app request:

POST http://www.google-analytics.com/collect HTTP/1.1
Host: www.google-analytics.com
Content-Length: 112
Expect: 100-continue

v=1
&tid=UA-44974825-1
&cid=1aba0888-732f-4690-9a91-d906c94a4a23
&t=exception
&exd=NullReferenceException
&exf=1

Server response:

HTTP/1.1 200 OK
Pragma: no-cache
Expires: Mon, 07 Aug 1995 23:30:00 GMT
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Access-Control-Allow-Origin: *
Last-Modified: Sun, 17 May 1998 03:00:00 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 18 Oct 2013 13:54:39 GMT
Server: Golfe2
Content-Length: 35
Alternate-Protocol: 80:quic

GIF89a�����������,�������D�;
like image 415
Tomas Kubes Avatar asked Oct 18 '13 14:10

Tomas Kubes


2 Answers

Your request is missing the app name parameter, &an, which is required for sending data to app profiles in Google Analytics via the Measurement Protocol.

The requirements for sending app data to Google Analytics via the Measurement Protocol are documented here: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#apptracking

The GA endpoint will always return 200, even if the request is missing required parameters.

like image 144
awales Avatar answered Oct 07 '22 04:10

awales


I discovered another reason why no data is being collected: I hadn't upgraded my property to Universal Analytics, yet! Doh!

like image 41
Oliver Avatar answered Oct 07 '22 04:10

Oliver