Adding analytics to bonfire

This commit is contained in:
Nathan Leniz
2015-02-03 01:57:35 -05:00
parent 29db5f8b94
commit c3926423af
3 changed files with 23 additions and 2 deletions

View File

@@ -1,4 +1,7 @@
$(document).ready(function() {
if (bonfireName !== undefined) {
ga('send', 'event', 'Bonfire', 'load', bonfireName + ':' + Math.floor(Date.now() / 1000));
}
var CSRF_HEADER = 'X-CSRF-Token';
@@ -61,7 +64,6 @@ $(document).ready(function() {
var bonfireSolution = myCodeMirror.getValue();
var thisBonfireHash = passedBonfireHash || null;
var didCompleteWith = $('#completed-with').val() || null;
completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash);
});
@@ -83,6 +85,7 @@ $(document).ready(function() {
// Bonfire instructions functions
$('#more-info').on('click', function() {
ga('send', 'event', 'Bonfire', 'more-info', bonfireName);
$('#brief-instructions').hide();
$('#long-instructions').show().removeClass('hide');
@@ -91,6 +94,12 @@ $(document).ready(function() {
$('#brief-instructions').show();
$('#long-instructions').hide();
});
// Bonfire analytics
$('#submitButton').on('click', function() {
attempts++;
ga('send', 'event', 'Bonfire', 'ran-code', bonfireName);
})
});
var profileValidation = angular.module('profileValidation',['ui.bootstrap']);