ortense
5/5/2014 - 12:37 AM

Google Analytics Track Scroll End

Google Analytics Track Scroll End

(function($){
	var $window = $(window),
		$document = $(document),
		scrollEnd = function(){
			if(($window.height() + $window.scrollTop() + 20) >= $document.height()){
				ga("send", "event", "scroll", document.location.pathname, "100%");
				$window.off("scroll", scrollEnd);
			}
		};
	$window.on("scroll", scrollEnd);
})(jQuery);