1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

Added analytics telemetry throughout the application. Make sure angulartics bundles before the ga dependency.

This commit is contained in:
Kyle Spearrin
2016-08-11 20:43:05 -04:00
parent ffbf25b62f
commit 92e0537bed
18 changed files with 76 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
angular
.module('bit.accounts')
.controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService, $state, appSettings) {
.controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService, $state, appSettings, $analytics) {
var rememberedEmail = $cookies.get(appSettings.rememberdEmailCookieName);
if (rememberedEmail) {
$scope.model = {
@@ -29,9 +29,11 @@ angular
var profile = authService.getUserProfile();
if (profile.twoFactor) {
$analytics.eventTrack('Logged In To Two-step');
$state.go('frontend.login.twoFactor');
}
else {
$analytics.eventTrack('Logged In');
$state.go('backend.vault');
}
});
@@ -42,6 +44,7 @@ angular
$scope.twoFactorPromise = authService.logInTwoFactor(model.code, "Authenticator");
$scope.twoFactorPromise.then(function () {
$analytics.eventTrack('Logged In From Two-step');
$state.go('backend.vault');
});
};

View File

@@ -1,7 +1,8 @@
angular
.module('bit.accounts')
.controller('accountsLogoutController', function ($scope, authService, $state) {
.controller('accountsLogoutController', function ($scope, authService, $state, $analytics) {
authService.logOut();
$analytics.eventTrack('Logged Out');
$state.go('frontend.login.info');
});

View File

@@ -1,7 +1,7 @@
angular
.module('bit.accounts')
.controller('accountsRegisterController', function ($scope, $location, apiService, cryptoService, validationService) {
.controller('accountsRegisterController', function ($scope, $location, apiService, cryptoService, validationService, $analytics) {
var params = $location.search();
$scope.success = false;
@@ -11,7 +11,7 @@ angular
$scope.registerPromise = null;
$scope.register = function (form) {
if ($scope.model.masterPassword != $scope.model.confirmMasterPassword) {
if ($scope.model.masterPassword !== $scope.model.confirmMasterPassword) {
validationService.addError(form, 'ConfirmMasterPassword', 'Master password confirmation does not match.', true);
return;
}
@@ -26,6 +26,7 @@ angular
$scope.registerPromise = apiService.accounts.register(request, function () {
$scope.success = true;
$analytics.eventTrack('Registered');
}).$promise;
};
});