I am setting up google analytics cross domain tracking on my website. I know I need to change each link to include:
onclick="_gaq.push(['_link', 'http://mywebsite.com/']); return false;"
I can set this up and get everything working great on the majority of the site, save one menu item. I've tried the jinMenu plugin, but that busted a few things.
site: http://www.trukid.com
Any help is much appreciated.
PS - This looks like it's on the right track for helping me, but I'm not sure how to translate it to my issue (I know minimal JS)
<script>
$(document).ready(function() {
// Forcing WordPress to accept GA clicks
$('.menu-twitter').delegate('a', 'click', function(e) {
e.preventDefault();
_gaq.push(['_trackEvent', 'Button', 'click', 'Twitter button']);
var lnk = $(this).attr('href');
setTimeout('document.location = "' + lnk + '"', 100);
});
$('.menu-facebook').next.delegate('a', 'click', function(e) {
e.preventDefault();
_gaq.push(['_trackEvent', 'Button', 'click', 'Facebook button']);
var lnk = $(this).attr('href');
setTimeout('document.location = "' + lnk + '"', 100);
});
});
</script>