Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created July 31, 2014 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groovecoder/c76d16d42aee62dae85b to your computer and use it in GitHub Desktop.
Save groovecoder/c76d16d42aee62dae85b to your computer and use it in GitHub Desktop.
/*
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