Analytics: track challenge and task events (#9885)

* feat(analytics): track challenge and task events

* feat(analytics): add more challenge events
Also tweaks data for better troubleshooting utility

* refactor(analytics): include IDs for challenges/groups

* refactor(analytics): term for award challenge is "close"
This commit is contained in:
Sabe Jones
2018-01-25 17:14:41 -06:00
committed by GitHub
parent 33698c219f
commit 18ade8ca65
3 changed files with 95 additions and 10 deletions

View File

@@ -58,6 +58,16 @@ api.createGroupTasks = {
let tasks = await createTasks(req, res, {user, group});
res.respond(201, tasks.length === 1 ? tasks[0] : tasks);
tasks.forEach((task) => {
res.analytics.track('task create', {
uuid: user._id,
hitType: 'event',
category: 'behavior',
taskType: task.type,
groupID: group._id,
});
});
},
};