Created
July 31, 2014 18:05
-
-
Save groovecoder/c76d16d42aee62dae85b to your computer and use it in GitHub Desktop.
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
/* | |
Track form element events | |
*/ | |
trackFormEvents: function(target) { | |
$(target).on('focus click change', 'input, select, button', function(e) { | |
var data = { | |
category: 'Form events', | |
action: e.type, | |
label: e.target | |
}; | |
console.log(data); | |
analytics.trackEvent(data); | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment