2

I am trying to integrate the Google's event tracking on my application using the below script. I can able to see the Events in "Realtime" tab. But I am not able to see the events in "Content" tab.

  var _gaq = _gaq || [];
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAccount', 'XXXXX']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_trackEvent', 'request.fullpath', 'plan_desc', 'plan_code>']);

Events Under Realtime Tab

Events Under Content Tab

j0k
  • 22,600
  • 28
  • 79
  • 90
loganathan
  • 5,838
  • 8
  • 33
  • 50
  • Data in Google Analytics Reports can take up to 48 hours to process depending on your account size. How long have you waited for it? – Eduardo Apr 17 '13 at 17:51
  • 1
    Anything in console? Google has a tag assistant Chrome plugin, it can be found here, will help you debug. https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en – Stoosh Apr 18 '13 at 00:36
  • I can only assume that you posted a 200 bounty on this 2 years old question by mistake. – Eduardo Feb 28 '15 at 22:04

4 Answers4

3

Are you grabbing the script that defines the gaq function?

var _gaq = _gaq || [];
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAccount', 'XXXXX']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_trackEvent', 'request.fullpath', 'plan_desc', 'plan_code>']);
(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

Also, for your event push, are the values you are pushing in supposed to be JS objects? if so, you may want to get rid of the quotation marks.

vly
  • 316
  • 1
  • 5
2

GA takes a certain amount of time before it translates data that you see in real-time into it's other sections.

It might be that if you have only added the code within 48 hours that results are not ready to view yet.

Alex
  • 8,353
  • 9
  • 45
  • 56
1

I would suggest you trying Google Analytics Debugger extension for Chrome to see if tracking events reach google.

https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en

Artur INTECH
  • 6,024
  • 2
  • 37
  • 34
0

If you are trying to use Rails variables in the JS, as request.fullpath looks like one you must make sure you are rendering it out in your templating engine. For example, if you are using ERB, you must call it like this...

_gaq.push(['_trackEvent', '<%= request.fullpath %>', 'plan_desc', 'plan_code>']);

Obviously repeat for the other variables, if they aren't Ruby and are plain JS objects, you need to omit the quote marks around them.

lloydpick
  • 1,638
  • 1
  • 18
  • 24