diff --git a/test/api/v3/unit/libs/analyticsService.test.js b/test/api/v3/unit/libs/analyticsService.test.js index 4a547ac85a..bd683e8ea0 100644 --- a/test/api/v3/unit/libs/analyticsService.test.js +++ b/test/api/v3/unit/libs/analyticsService.test.js @@ -277,6 +277,7 @@ describe('analyticsService', () => { dailys: [{_id: 'daily'}], todos: [{_id: 'todo'}], rewards: [{_id: 'reward'}], + balance: 12, }; data.user = user; @@ -300,6 +301,7 @@ describe('analyticsService', () => { }, contributorLevel: 1, subscription: 'foo-plan', + balance: 12, }, }); }); diff --git a/test/client-old/spec/services/analyticsServicesSpec.js b/test/client-old/spec/services/analyticsServicesSpec.js index d062692e08..f03a5dbd15 100644 --- a/test/client-old/spec/services/analyticsServicesSpec.js +++ b/test/client-old/spec/services/analyticsServicesSpec.js @@ -193,6 +193,7 @@ describe('Analytics Service', function () { todos: 1, rewards: 1 }; + expectedProperties.balance = 12; beforeEach(function() { user._id = 'unique-user-id'; @@ -207,6 +208,7 @@ describe('Analytics Service', function () { user.dailys = [{_id: 'daily'}]; user.todos = [{_id: 'todo'}]; user.rewards = [{_id: 'reward'}]; + user.balance = 12; analytics.updateUser(properties); clock.tick(); @@ -240,7 +242,8 @@ describe('Analytics Service', function () { dailys: 1, habits: 1, rewards: 1 - } + }, + balance: 12 }; beforeEach(function() { @@ -258,6 +261,7 @@ describe('Analytics Service', function () { user.dailys = [{_id: 'daily'}]; user.todos = [{_id: 'todo'}]; user.rewards = [{_id: 'reward'}]; + user.balance = 12; analytics.updateUser(); clock.tick(); diff --git a/website/client-old/js/services/analyticsServices.js b/website/client-old/js/services/analyticsServices.js index 7d4d1fd02a..39ec8d1c13 100644 --- a/website/client-old/js/services/analyticsServices.js +++ b/website/client-old/js/services/analyticsServices.js @@ -127,6 +127,9 @@ properties.Level = user.stats.lvl; properties.Mana = Math.floor(user.stats.mp); } + + properties.balance = user.balance; + properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2; if (user.habits && user.dailys && user.todos && user.rewards) { properties["Number Of Tasks"] = { diff --git a/website/server/libs/analyticsService.js b/website/server/libs/analyticsService.js index 69a008b2db..1a099f1a57 100644 --- a/website/server/libs/analyticsService.js +++ b/website/server/libs/analyticsService.js @@ -66,6 +66,8 @@ let _formatUserData = (user) => { properties.Mana = Math.floor(user.stats.mp); } + properties.balance = user.balance; + properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2; if (user.habits && user.dailys && user.todos && user.rewards) {