Sent Event Not Showing Up in Analytics

Oct 2, 2014 at 2:44 AM
I posted this on the analytics google group, but no one is replying, so I'll try here...

https://groups.google.com/forum/?fromgroups#!topic/ga-mobile-app-analytics/m_nvk0ipPF0

I'm sending an event and I get a 200 OK back, but the event isn't showing up in analytics.

I'm expecting them to show up in analytics under the "Reporting" tab at the top. Then "Behavior -> Events -> Overview". I have 0 events showing. I have 0 under everything else in all other areas too.

I wanted to see what was actually being sent over so I opened fiddler and saw that the request being made had a header "Expect: 100-continue", which analytics was returning "HTTP/1.1 408 Request body incomplete". I'm guessing the server doesn't support that. I don't know whether fiddler was adding the header, or if it was the library. Does this library do that? I was able to modify a fiddler rule and the header isn't there anymore.

My request looks like this:


POST http://www.google-analytics.com/collect HTTP/1.1
Content-Type: text/plain; charset=utf-8
Host: www.google-analytics.com
Content-Length: 157

v=1&tid=<Tracking ID>&an=<App Name>&av=<App Version>&t=event&ec=<Event Category>&ea=<Event Action>&el=<Event Label>


The <...> contains the actual data. I won't post it here unless it ends up being relevant some how.

The response I get back from analytics is this:


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: Sun, 28 Sep 2014 00:33:02 GMT
Server: Golfe2
Content-Length: 35
Alternate-Protocol: 80:quic,p=0.002

GIF89a�����������,�������D�;


Here is the code I'm using to send the request.
var tracker = new GoogleAnalytics.Core.Tracker( account.TrackingId, new GoogleAnalytics.Core.PlatformInfoProvider(), GoogleAnalytics.Core.GAServiceManager.Current ) { AppName = "My App", AppVersion = appVersion };
foreach( var analytic in analytics )
{
    var label = string.Format( "{0:o}\r\n{1}", analytic.Timestamp, string.Join( ",", analytic.Parameters.Select( p => string.Format( "{0}:{1}", p.Key, p.Value ) ) ) );
    tracker.SendEvent( analytic.Object, analytic.Action, label, 0 );
}