Last active
December 14, 2015 01:09
-
-
Save stugoo/5003963 to your computer and use it in GitHub Desktop.
Event tracking that also logs modernizr tests.
- splits tests into passes & fails, with a variable to test if you want to track passes and/or fails
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
/* via @adamcbrewer */ | |
track = function (args) { | |
args = args || {}; | |
console.log(args); | |
var category = args.category, | |
action = args.action, | |
label = args.label; | |
if (_gaq) { | |
_gaq.push(['_trackEvent', category, action, label]); | |
} | |
}; | |
/*usage */ | |
track({ | |
category: 'Deed', | |
action: 'Submit', | |
label: '' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment