Skip to content

@kressaty /ga-form-abandonment.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Track Form Abandonment in Google Analytics
// NOTE: this assumes you have loaded jQuery
$(document).ready(function() {
// REPLACE 'UNIQUE_FORM_ID' BELOW WITH THE ID OF YOUR FORM
$('#UNIQUE_FORM_ID input').blur(function () {
if($(this).val().length > 0) {
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_full', $(this).attr('name')]);
}
else {
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_empty', $(this).attr('name')]);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.