Hi,
I would really like to be able to track clicks on call to action links using Google Analytics. like discussed here:
http://www.seomoz.org/blog/google-an...alls-to-action
Is it possible to add an onClick event to a link?
Ta,
Gary.
Hi,
I would really like to be able to track clicks on call to action links using Google Analytics. like discussed here:
http://www.seomoz.org/blog/google-an...alls-to-action
Is it possible to add an onClick event to a link?
Ta,
Gary.
Yes, use javascript. jQuery does it like $('a').onclick(function(){ /* do something */ });. I'm sure mootools has an equivalent. If you have that you can work it out into a more refined piece of code.
If you'd like to add an onclick handler in the html, then be aware that "onClick" like it is written in your reference link won't validate in all dtd's but onclick (all lowercase) will in most of those that refuse onClick.
Thanks for the info once again Vera.
On David Walsh blog there is an example on how track downloads : http://davidwalsh.name/track-file-downl ... s-mootools
It's a good Mootools start script, with some mods you can track your events.
Bookmarks