chore(analytics): open the task firehose

This commit is contained in:
Sabe Jones
2021-07-02 14:52:45 -05:00
parent 63c780759a
commit 9e9a301f04
2 changed files with 9 additions and 13 deletions

View File

@@ -199,8 +199,7 @@ api.createUserTasks = {
res.respond(201, tasks.length === 1 ? tasks[0] : tasks);
tasks.forEach(task => {
// Track when new users (first 7 days) create tasks
if (moment().diff(user.auth.timestamps.created, 'days') < 7 && user.flags.welcomed) {
if (user.flags.welcomed) { // Don't send Habitica default tasks to analytics
res.analytics.track('task create', {
uuid: user._id,
hitType: 'event',

View File

@@ -438,8 +438,6 @@ async function scoreTask (user, task, direction, req, res) {
user,
});
// Track when new users (first 7 days) score tasks
if (moment().diff(user.auth.timestamps.created, 'days') < 3) {
res.analytics.track('task score', {
uuid: user._id,
hitType: 'event',
@@ -448,7 +446,6 @@ async function scoreTask (user, task, direction, req, res) {
direction,
headers: req.headers,
});
}
return {
task,