views:

1932

answers:

3

I have Google Analytics setup on my site, and it is definitely recording page views. But I have added some code to call pageTracker._trackEvent(category, action, label, value), and it is not recording those hits or showing them in the reports.

BTW, yes, I have waited for over 24hrs to see if the hits are in the reports.

I have used the standard Google script include as well as the technique mentioned here. Neither one seems to help the _trackEvent() problem.

Can anyone give me some advice on how to track down what's going wrong? I'd be happy to post code examples if you let me know what parts are important.

Thanks.

A: 

it is not recording those hits or showing them in the reports.

Events have no effect on page views and do not appear on regular reports. Events have a seperate interface at Content / Events. If you'd like to track the things you specified as events like regular hits, better use the trackPageview method instead.

Török Gábor
You are correct, events are not regular page hits. Unfortunately (for me), I did know that, but the events are still not showing up in Content/Events.
slolife
@slolife: have you tried to manually change the URL? For instance, click on ‘Content/Site Search’ and replace ‘site_search’ with ‘events’?
Török Gábor
+4  A: 

The problem was the values that that I was putting in the final argument, the "value" parameter.

pageTracker._trackEvent(category, action, label, value)

I was passing non-integer strings to the "value" parameter:

pageTracker._trackEvent("UserAction", "ShowHelp", "Page", "http://mysite.com/UrlGoesHere");

but the docs say it needs to be an integer value.

pageTracker._trackEvent("UserAction", "ShowHelp", "http://mysite.com/UrlGoesHere",  1);

I posed the question on Google Help Forums here.

And here is a link to the Event Tracking docs

Thanks for the help Török

slolife
+2  A: 

Similarly, label can not be an integer or the _trackEvent function fails silently.

pageTracker._trackEvent('VLP', 'click-out', 12345);

Fixed as

pageTracker._trackEvent('VLP', 'click-out', '12345');
KevBurnsJr