views:

49

answers:

2

Can I track the click of every link, button, dropdown select, etc. on a screen and have it be tracked in Google Analytics?

I want to create a page and collect data on which widget the users use most.

What about AJAX stuff? What if you're using jQuery or Mootools...can you get the functions to register a fake URL with GA based on user interaction? I use to do this with Flash. Everytime you click a button, it can initiate a fake URL request. I would make urls such as ".../customize/eyes/" or ".../customize/nose", etc. Just wondering if I can do that with Javascript on the page.

I've also posted at webmaster stackexchange.

A: 

1) Analytics is obviously not designed for this

2) They track page transitions, not clicks

If you create pages to which the user is redirected on every click, that may get you wat you want. :)

Andrey Breslav
+1  A: 

Yes, you can do this, but it's not really a recommended practice, and Google might throttle your usage if there are too many clicks.

Rather than overloading your pageviews, you should use Events.

You could just bind an Event call to every click, something like (assuming jQuery)

$('*').bind('click', 'submit', function(){
_gaq.push(['_trackEvent', 'Category', 'Action', 'Label', Numeric_Value]);
});

You could insert whatever custom event-driven javascript info into those parameters.

yc
@yc: Would you mind also posting your answer at the webmaster stackexchange link that I added to my post? It would benefit that forum too.
milesmeow