Created
May 11, 2011 17:29
-
-
Save muloka/966915 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// saw this on Forrst, forget who posted it though | |
$('[href$="pdf"],.pdf').live("click", function(){ | |
// get the link attribute and find the filename of the PDF | |
var pdfLink = $(this).attr("href"), | |
pdfLocation = pdfLink.substr(pdfLink.lastIndexOf("/")).replace("/",""); | |
_gaq.push(['_trackPageview', pdfLocation]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment