The site in question is http://getstefan.com
Its a single page portfolio site and I have tried using jQuery to add Google Analytics click tracking to every anchor tag on the site hoping to track where people are clicking. There is a script that adds a unique ID to each anchor on the page, so I set a timeout to make sure and place the Google Analytics click tracking after the id has been assigned. Like so:
jQuery(window).load(function(){
setTimeout(loadOnClick,8000)
});
function loadOnClick() {
jQuery('a').each(function(){
jQuery(this).attr("onclick", "_gaq.push(['_trackEvent', 'anchor', 'click', '" + jQuery(this).attr('id') + "']);" );
});
}
Which results in building a link like so:
<a href="http://getstefan.com/wp-content/themes/inc v2/downloads/CV-StefanHinck-FR.pdf" id="cv" onclick="_gaq.push(['_trackEvent', 'anchor', 'click', 'cv']);"></a>
Everything looks good. Problem is that when I look at my analytics, the only clicks registered are labeled "untitled"
Anyone know what im doing wrong here?