ortense
5/5/2014 - 12:58 AM

Google Analytics Track External Links

Google Analytics Track External Links

(function($){
	$("a").on("mousedown", function(){
		if(this.protocol === "http:" || this.protocol === "https:"){
			if(this.hostname !== document.location.hostname){
				ga("send", "event", "external-links", document.location.pathname, this.href);
			}
		}
	});
})(jQuery);