Skip to content

Instantly share code, notes, and snippets.

@pablolobos
Created February 26, 2014 18:56
Show Gist options
  • Save pablolobos/9235999 to your computer and use it in GitHub Desktop.
Save pablolobos/9235999 to your computer and use it in GitHub Desktop.
jquery_analytics-track-form-abandon.js
(function($) {
$(document).ready(function() {
$(':input').blur(function () {
if($(this).val().length > 0) {
_gaq.push(['_trackEvent', 'INSERT FORM NAME HERE', 'completed', $(this).attr('name')]);
}
else {
_gaq.push(['_trackEvent', 'INSERT FORM NAME HERE', 'skipped', $(this).attr('name')]);
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment