Google universal analytics events sent but not received by analytics

I use google universal analytics on my website. Although the POST requests seem to be sent correctly, there are no monitored events in my analytics account.

This is a send request (url and analytics identifier is masked)

Request URL:http://www.google-analytics.com/collect Request Method:POST Status Code:200 OK Request Headersview source Accept:application/json, text/javascript, */*; q=0.01 Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 Connection:keep-alive Content-Length:120 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Host:www.google-analytics.com Origin:http://www.xxxxxxxx.com Referer:http://www.xxxxxxxx.com/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31 Form Dataview sourceview URL encoded v:1 tid:UA-xxxxxxxxx-1 cid:3E1FA9FE-28B3-7032-1714-5083DD155FCF t:click ec:link ea:outbound_link el:startpage ev:headline Response Headersview source Access-Control-Allow-Origin:* Cache-Control:private, no-cache, no-cache=Set-Cookie, proxy-revalidate Connection:keep-alive Content-Length:35 Content-Type:image/gif Date:Fri, 10 May 2013 13:25:44 GMT Expires:Mon, 07 Aug 1995 23:30:00 GMT Last-Modified:Sun, 17 May 1998 03:00:00 GMT Pragma:no-cache Server:GFE/2.0 Via:1.0 non_disclosed:3128 (squid) X-Cache:MISS from non_disclosed X-Cache-Lookup:MISS from non_disclosed:3128 X-Content-Type-Options:nosniff 

Does anyone know what is going on here? Thanks!

Jessie

UPDATE

I tried to send a query using jquery $ .post method. You can see the result above. Google Analytics does not track anything.

Now I switched to this method as described in the analytics.js developer guide

 function trackOutboundLink(link, event_hittype, event_category, event_action, event_value) { ga('send', event_hittype, { 'clientId' : clientId, 'eventCategory' : event_category, 'eventAction' : event_action, 'eventLabel' : link.href, 'eventValue' : event_value, 'hitCallback' : function () { // document.location = link.href; } }); window.open( link.href, '_blank' ); } 

The generated query is as follows:

 Request URL:http://www.google-analytics.com/collect?v=1&_v=j8&a=217518556&t=event&dl=http%3A%2F%2Fwww.mywebsite.de%2F&ul=de&de=UTF-8&dt=Foosd=24-bit&sr=1440x900&vp=1439x747&je=1&fl=11.7%20r700&ec=OutboundLinkClick&ea=Startpage&el=http%3A%2F%2Ftest.de&ev=Headline&_u=OCC~&cid=283560406.1367606414&tid=UA-XXXXXXXX-1&z=496696042 Request Method:GET Status Code:200 OK Request Headersview source Accept:*/* Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 Connection:keep-alive Host:www.google-analytics.com Referer:http://www.mywebsite.de/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31 Query String Parametersview sourceview URL encoded v:1 _v:j8 a:217518556 t:event dl:http://www.mywebsite.de/ ul:de de:UTF-8 dt:Foo sd:24-bit sr:1440x900 vp:1439x747 je:1 fl:11.7 r700 ec:OutboundLinkClick ea:Startpage el:http://test.de ev:Headline _u:OCC~ cid:283560406.1367606414 tid:UA-XXXXXXXX-1 z:496696042 Response Headersview source Access-Control-Allow-Origin:* Age:120360 Cache-Control:private, no-cache, no-cache=Set-Cookie, proxy-revalidate Content-Length:35 Content-Type:image/gif Date:Thu, 16 May 2013 00:10:08 GMT Expires:Mon, 07 Aug 1995 23:30:00 GMT Last-Modified:Sun, 17 May 1998 03:00:00 GMT Pragma:no-cache Server:GFE/2.0 X-Content-Type-Options:nosniff 

The event fires correctly when the target link opens in a new window. Status request - 200.

Guess that in Google Analytics I’m not tracking any events. I double-checked the UA code and I cannot imagine any filter in analytics because I did not install it.

This method is online from yesterday (24 hours). I do not know what's the problem.

+6
source share
2 answers

Ok, here we go. It seems that the problem was to convey the event in a different way.

I managed to get it to work with this setting:

 <head> ... <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXXXX-1', 'mydomain.com'); ga('send', 'pageview'); var clientId = ''; ga(function (tracker) { clientId = tracker.get('clientId'); }); </script> </head> 

and then in the view

 <a href="http://www.outboundwebsite.com" onClick="ga('send', 'event', 'outbound_startpage', 'click', 'headline')" target="_blank">Outbound headline link on my startpage</a> 

All relevant data, including a unique user identifier, is applied to the event and is triggered correctly. You can immediately see the data that is viewed when viewing events in real time in Google Analytics.

Thanks for helping the guys.

By the way: there is a good tutorial at http://blog.kissmetrics.com/universal-analytics

+1
source

One thing I see is t:click . If it were an event, it would show t:event

https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#event

+3
source

Source: https://habr.com/ru/post/944715/


All Articles