Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ortense/22bd94b08df746a282fe to your computer and use it in GitHub Desktop.
Save ortense/22bd94b08df746a282fe to your computer and use it in GitHub Desktop.
Google Analytics Track First Click
(function($){
var links = $("a"),
fistClick = function(){
var link = $(this);
ga("send", "event",
"first-click",
document.location.pathname,
link.text() + "|" + link.attr("href")
);
links.off("mousedown", fistClick);
};
links.on("mousedown", fistClick);
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment