Add Google Analytics

This commit is contained in:
Gaël Métais
2014-12-30 08:11:47 +01:00
parent 9bf420d317
commit 17a644c5d8
6 changed files with 41 additions and 12 deletions
+7 -2
View File
@@ -12,9 +12,14 @@ var yltApp = angular.module('YellowLabTools', [
'gradeDirective',
]);
yltApp.run(function($rootScope) {
yltApp.run(['$rootScope', '$location', function($rootScope, $location) {
$rootScope.loadedRunId = null;
});
// Google Analytics
$rootScope.$on('$routeChangeSuccess', function(){
ga('send', 'pageview', {'page': $location.path()});
});
}]);
yltApp.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {