Good way to follow the click of the link

advertisements

I'm trying to find the most exhaustive / compatible solution to track some links inside my website.

Actually, I've this code:

$(".article-content a").each(function() {
    $(this).click(function() {
        // Tracking code here
    });
});

Is there any recommandations regarding real user redirection handling ? I think we have to firstly exclude right-click ? And also be sure that Ctrl-Click, MouseWheel-Click, Touch events, Navigation by keyboard, etc... are properly handled to fire, for example a GA event ?


make something like this

$('.asdfasdf').mousedown(function(e) {
    switch (e.which) {
        case 1:
            //Left Mouse button pressed
            break;
        case 2:
            //Middle Mouse button pressed
            break;
        case 3:
            //Right Mouse button pressed
            break;
        default:
            //asdfasdf
    }
});

here's some doc: jQuery-Doc