/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(document).ready(function(){ var localserver = "www.prodevtips.com"; $("a").not(".kLink").not("a[href^='http://"+localserver+"']").click(function(){ $(this).attr("target", "blank"); var url = $(this).attr("href").replace(/^http\:\/\/(www\.)*/i, ""); pageTracker._trackPageview('/external/'+url); }); });
URL: http://www.prodevtips.com/2008/08/19/tracking-clicks-with-jquery-and-google-analytics/
Comments
