What percentage of followed hyperlinks might have their "onclick" JavaScript ignored?

analytics, html, javascript, usability

Solution

Aside from those of us who habitually middle-click/ctrl-click to open links in new tabs, there's another major cause of onClick failure: NoScript and similar plugins which allow javascript to run only when it comes from whitelisted sites. If your domain isn't on my whitelist, then your onClick won't run, no matter how I trigger the link.

If you want reliable stats on which pages people are visiting, there's only one bulletproof source for that: The web server logs.

The logs are probably also your best bet for tracking how people move throughout the site, but they're not entirely reliable, as some privacy-paranoid users will falsify their referer headers or just not send them at all, but I expect that to be far less common than disabling javascript.

Problem

As far as I know all popular web browsers execute the onclick attribute of an anchor link first, then follow the path specified by the href attribute. The problem here is that the onclick attribute only gets called when clicking with the left mousebutton (without pressing ctrl or shift for a new tab or window) or when pressing enter on your keyboard while the tabIndex is set to the link you want to follow. But there are many other ways of following a link than just those two. - Ctrl + click - shift + click - rightmousebutton + open - rightmousebutton + new tab - drag & drop link to address bar and so on... My client uses onclick for conversion statistics. Which seems heavily unreliable. My question: What percentage of hyperlinks are being followed without activating their onclick attribute? All estimates are highly appreciated. I'm completely lost; I think it can be any number...

Original source