mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
feat(analytics): call service from app
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
angular.module('habitrpg').factory('Guide',
|
||||
['$rootScope', 'User', '$timeout', '$state',
|
||||
function($rootScope, User, $timeout, $state) {
|
||||
['$rootScope', 'User', '$timeout', '$state', 'Analytics',
|
||||
function($rootScope, User, $timeout, $state, Analytics) {
|
||||
|
||||
var chapters = {
|
||||
intro: [
|
||||
@@ -184,14 +184,13 @@ function($rootScope, User, $timeout, $state) {
|
||||
$state.go(step.state);
|
||||
return $timeout(function(){});
|
||||
}
|
||||
window.ga && ga('send', 'event', 'behavior', 'tour', k, i+1);
|
||||
mixpanel.track('Tutorial',{'tour':k+'-web','step':i+1,'complete':false});
|
||||
Analytics.track({'hitType':'event','eventCategory':'behavior','eventAction':'tutorial','eventLabel':k+'-web','eventValue':i+1,'complete':false})
|
||||
}
|
||||
step.onHide = function(){
|
||||
if (step.final) { // -2 indicates complete
|
||||
var ups={};ups['flags.tour.'+k] = -2;
|
||||
User.set(ups);
|
||||
mixpanel.track('Tutorial',{'tour':k+'-web','step':i+1,'complete':true});
|
||||
Analytics.track({'hitType':'event','eventCategory':'behavior','eventAction':'tutorial','eventLabel':k+'-web','eventValue':i+1,'complete':true})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user