feat(analytics): Analytics service

Inject Analytics service into controllers where needed. Call Analytics service instead of GA or Mixpanel for tracking within the app.
This commit is contained in:
Sabe Jones
2015-06-22 11:21:02 -05:00
parent a98d9ac29c
commit 9a0e31db40
13 changed files with 56 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
habitrpg.controller("InventoryCtrl",
['$rootScope', '$scope', 'Shared', '$window', 'User', 'Content',
function($rootScope, $scope, Shared, $window, User, Content) {
['$rootScope', '$scope', 'Shared', '$window', 'User', 'Content', 'Analytics',
function($rootScope, $scope, Shared, $window, User, Content, Analytics) {
var user = User.user;
@@ -180,7 +180,7 @@ habitrpg.controller("InventoryCtrl",
$rootScope.selectedQuest = undefined;
}
$scope.questInit = function(){
mixpanel.track("Quest",{"owner":true,"response":"accept","questName":$scope.selectedQuest.key});
Analytics.track({'hitType':'event','eventCategory':'behavior','eventAction':'quest','owner':true,'response':'accept','questName':$scope.selectedQuest.key});
$rootScope.party.$questAccept({key:$scope.selectedQuest.key}, function(){
$rootScope.party.$get();
});