Tracking Outgoing Links in Google Analytics Using Event Tracking and jQuery

/ Published in: jQuery
Save to your folder(s)

Learn how to track outgoing links in Google Analytics with jQuery.

Copy this code and paste it in your HTML
  1. $(document).ready(function(){
  2. $("a[href^='http://']").click(function(){
  3. pageTracker._trackEvent("links", "external", $(this).attr("href"), 0);
  4. });
  5. });


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.