The article is interesting, but gives some bad instructions on how to track outbound links and also probably how to track form submissions. Because of the asynchronous nature of communications back/forth from Google Analytics if you load a new page before an event is properly tracked, you won't be able to see it on the GA Dashboard. Bad intel is worse than no intel at all.<p>Here's what Google itself has to say on the matter:
<a href="http://support.Google.com/analytics/bin/answer.py?hl=en&answer=1136920" rel="nofollow">http://support.Google.com/analytics/bin/answer.py?hl=en&...</a><p>Here's how to correct one code example from the blog post:<p><pre><code> //this function is OK, but probably an unnecessary abstraction of a one-liner
function trackEvent(category, action, label) {
window._gaq.push(['_trackEvent', category, action, label])
}
//this event handler will not track some non-negligible percentage of events
$("article a").click(function(e) {
var element = $(this)
var label = element.attr("href")
trackEvent("Outbound link", "Click", label)
});
//corrected outbound link event handler which gives GA 100 ms to register
//the event. higher than 100 risks UX degradation, lower increases the %
//of untracked events. 100 ms is happy medium
$("article a").click(function(e) {
e.preventDefault(); //stay on the page for now
var element = $(this)
var label = element.attr("href")
trackEvent("Outbound link", "Click", label)
//leave the page after a short delay
window.setTimeout("window.location.href='" + label + "'", 100);
});</code></pre>