Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Created April 26, 2016 10:21
Show Gist options
  • Save ceaksan/847f0f6846e68fa3ac8dbcc7c895c333 to your computer and use it in GitHub Desktop.
Save ceaksan/847f0f6846e68fa3ac8dbcc7c895c333 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function() {
jQuery(':input').blur(function () {
var formName = {{FORM NAME}}; // Change {{FORM NAME}}
if(jQuery(this).val().length > 0) {
_gaq.push(['_trackEvent', formName, 'Completed', jQuery(this).attr('name')]);
}
else {
_gaq.push(['_trackEvent', formName, 'Canceled', jQuery(this).attr('name')]);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment