Adding a click handler to each link is not a good idea. You should use event delegation (which will only attach the event handler one in the root directory of the document):
$(document).delegate('a', 'click', function(event) {
Update (12/17/2011):
Starting with jQuery 1.7, you can use .on() [docs] :
$(document).on('click', 'a', function(event) {
Regarding your concerns:
Developers can have images inside the anchor, so the goal of the goals is the image, not the href
Events bubble up until distribution is canceled. It depends on what you want to register. With delegate event.target property will point to the image, but this (inside the handler) will point to the a element.
Therefore, there should not be any problems (example: http://jsfiddle.net/cR4DE/ ).
But it also means that you will miss the clicks if the developers cancel the distribution.
(Side note: you can solve this by allowing the event handler in the step, but IE does not support this (hence jQuery does not).)
Many developers have their own way of handling href clicks using the onclick event, rather than just href = '' attr
This will not affect existing event handlers.
Some developers add their own attr to the tag and have custom click processing features.
Not sure what you mean here.
It also depends on how other content is included. For instance. the above code will not track clicks in the iframe.