From 73b2d816d1283fd5c5620e43561fb59c26da3b49 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Wed, 8 Jul 2015 08:08:45 -0500 Subject: [PATCH] Track cron with analytics service --- common/script/index.coffee | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/script/index.coffee b/common/script/index.coffee index 43628c20fe..0a6425c837 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1692,8 +1692,16 @@ api.wrap = (user, main=true) -> # Analytics user.flags.cronCount?=0 user.flags.cronCount++ - options.mixpanel?.track('Cron',{'distinct_id':user._id,'resting':user.preferences.sleep}) - options.ga?.event('behavior', 'cron', 'cron', user.flags.cronCount).send(); #TODO userId for cohort + + analyticsData = { + gaCategory: 'behavior', + gaLabel: user.flags.cronCount, + uuid: user._id, + user: user, + resting: user.preferences.sleep, + cronCount: user.flags.cronCount + } + options.analytics?.track('Cron', analyticsData) # After all is said and done, progress up user's effect on quest, return those values & reset the user's progress = user.party.quest.progress; _progress = _.cloneDeep progress