Merge branch 'develop' of https://github.com/HabitRPG/habitrpg into develop

This commit is contained in:
Matteo Pagliazzi 2014-02-12 10:49:30 +01:00
commit aaa230790b
5 changed files with 12 additions and 15 deletions

View file

@ -189,10 +189,7 @@ window.habitrpg = angular.module('habitrpg',
})
.state('options.settings.subscription', {
url: "/subscription",
templateUrl: "partials/options.settings.subscription.html",
onEnter: function(){
window.ga && ga('send', 'event', 'page', 'view', 'Basic Subscription');
}
templateUrl: "partials/options.settings.subscription.html"
})
var settings = JSON.parse(localStorage.getItem(STORAGE_SETTINGS_ID));

View file

@ -13,6 +13,11 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
})
$rootScope.$on('userUpdated',initSticky);
$rootScope.$on('$stateChangeSuccess',
function(event, toState, toParams, fromState, fromParams){
if (!!fromState.name) window.ga && ga('send', 'pageview', {page: '/#/'+toState.name});
});
$rootScope.User = User;
$rootScope.user = user;
$rootScope.moment = window.moment;

View file

@ -6,14 +6,8 @@ window.habitrpgStatic = angular.module('habitrpgStatic', ['notificationServices'
.constant("STORAGE_SETTINGS_ID", 'habit-mobile-settings')
.constant("MOBILE_APP", false)
habitrpgStatic.controller("PlansCtrl", ['$rootScope', '$location', '$timeout',
function($rootScope, $location, $timeout) {
// GA goal-tracking
$timeout(function(){
window.ga && ga('send', 'event', 'page', 'view', 'Plans');
});
habitrpgStatic.controller("PlansCtrl", ['$rootScope',
function($rootScope) {
$rootScope.clickContact = function(){
window.ga && ga('send', 'event', 'button', 'click', 'Contact Us (Plans)');
}

View file

@ -8,6 +8,7 @@ var async = require('async');
var utils = require('../utils');
var nconf = require('nconf');
var User = require('../models/user').model;
var ga = require('./../utils').ga;
var api = module.exports;
@ -88,6 +89,7 @@ api.registerUser = function(req, res, next) {
};
user = new User(newUser);
user.save(cb);
ga.event('register', 'Local').send()
}
], function(err, saved) {
if (err) {
@ -250,8 +252,7 @@ api.setupPassport = function(router) {
}
});
user.save(cb);
ga.event('register', 'Facebook').send()
}
], function(err, saved){
if (err) return res.redirect('/static/front?err=' + err);

View file

@ -461,7 +461,7 @@ _.each(shared.wrap({}).ops, function(op,k){
if (err) return next(err);
res.json(200,response);
})
})
}, ga);
}
}
})