Created
March 9, 2013 23:11
-
-
Save masiorama/5126205 to your computer and use it in GitHub Desktop.
Js: track event wrapper for google analytics
This file contains 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
// Add in Google Analytics tracking; just in case ga.js isn't correctly loaded | |
var track = function(category, name, value) { | |
if (window._gaq) { | |
window._gaq.push(["_trackEvent", category, name, value]); | |
} | |
}; | |
track("Source", "Visit", this.href); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment