Skip to content

Instantly share code, notes, and snippets.

@rosskarchner
Created April 6, 2011 21:56
Show Gist options
  • Save rosskarchner/906627 to your computer and use it in GitHub Desktop.
Save rosskarchner/906627 to your computer and use it in GitHub Desktop.
$('a[href$=.pdf]').click(function(){
if(pageTracker){
var fixedLink = this.href;
fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
fixedLink = '/downloads/' + fixedLink;
pageTracker._trackPageview(fixedLink);
if(console){
console.log('page tracked: ' + fixedLink);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment