1
0
mirror of https://github.com/bigchaindb/site.git synced 2024-11-21 17:26:55 +01:00

track form success/fail submissions in Google Analytics, ref #2

This commit is contained in:
Matthias Kretschmann 2015-12-21 14:08:20 +01:00
parent 3b29264de3
commit 2fad4ade6b
2 changed files with 12 additions and 2 deletions

View File

@ -89,6 +89,12 @@ var GoogleAnalytics = (function(w,d) {
_private.gaBreakpoints();
_private.gaViewport();
_private.gaPixelDensity();
},
gaEventEarlyAccessSuccess: function() {
ga('send', 'event', 'signup', 'early_access_form', 'success', true);
},
gaEventEarlyAccessError: function() {
ga('send', 'event', 'signup', 'early_access_form', 'error', true);
}
};

View File

@ -9,7 +9,7 @@ var FormEarlyAccess = (function(w, d, $) {
form: $('#form-earlyaccess'),
formBtn: $('#form-earlyaccess').find('.btn'),
formURL: $('#form-earlyaccess').attr('action'),
formMethod: $('#form-earlyaccess').attr('metthod')
formMethod: $('#form-earlyaccess').attr('method')
};
_private = {
@ -35,11 +35,15 @@ var FormEarlyAccess = (function(w, d, $) {
_config.form.find('.alert-success').removeClass('hide');
_config.formBtn.removeClass('disabled');
//GoogleAnalytics.gaEventEarlyAccess();
// send GA event
GoogleAnalytics.gaEventEarlyAccessSuccess();
},
error: function(err) {
_config.form.find('.alert-danger').removeClass('hide');
_config.formBtn.removeClass('disabled');
// send GA event
GoogleAnalytics.gaEventEarlyAccessError();
}
});
}