Last Updated: February 25, 2016
·
521
· raf_vs

Track link clicks in Google Analytics

Using jquery, adding this little piece of code will enable you to track link clicks in Google Analytics with the href of the link as a reference:

$('a.ga-track').on('click', function() {
    ga('send', 'event', 'page-links', 'clicked', $(this).attr('href'));
});

just add the desired class to every element you want to track.