Hi,
Im having trouble with a onclick event for a download. It does not want to fire when I click on the link. It just carries on as normal. But it does work with an external link. Have I done something obviously wrong?
<a href="http://www.wildlifetrusts.org/" target="_blank" onclick="trackExternalLink(this, '/links-the_royal_society_of_wildlife_trusts');">Royal Society of Wildlife Trusts.</a>
<a href="/c2/uploads/our strategy for 2010_15.pdf" target="_blank" onclick="trackExternalLink(this, '/downloads-our_strategy_for_2010-15');">2010-2015 strategy,</a>
Its doing the same in FF, Chrome and IE 8.
function trackExternalLink(link, action) {
_gaq.push(['_trackPageview', action]);
setTimeout('document.location = "' + link.href + '"', 25000)
return false;
}