chore(analytics): various updates to analytics tracking

This commit is contained in:
Sabe Jones
2021-08-30 16:21:05 -05:00
parent 722770354d
commit 40bf664f20
44 changed files with 76 additions and 775 deletions

View File

@@ -266,8 +266,6 @@ api.postChat = {
analyticsObject.groupName = group.name;
}
res.analytics.track('group chat', analyticsObject);
if (chatUpdated) {
res.respond(200, { chat: chatRes.chat });
} else {

View File

@@ -158,6 +158,7 @@ api.createGroup = {
groupType: savedGroup.type,
privacy: savedGroup.privacy,
headers: req.headers,
invited: false,
};
if (savedGroup.privacy === 'public') {
@@ -206,6 +207,7 @@ api.createGroupPlan = {
groupType: savedGroup.type,
privacy: savedGroup.privacy,
headers: req.headers,
invited: false,
});
// do not remove chat flags data as we've just created the group
@@ -714,6 +716,7 @@ api.joinGroup = {
groupType: group.type,
privacy: group.privacy,
headers: req.headers,
invited: isUserInvited,
};
if (group.privacy === 'public') {

View File

@@ -165,7 +165,7 @@ api.inviteToQuest = {
questName: questKey,
uuid: user._id,
headers: req.headers,
}, true);
});
},
};
@@ -226,7 +226,7 @@ api.acceptQuest = {
questName: group.quest.key,
uuid: user._id,
headers: req.headers,
}, true);
});
},
};
@@ -287,7 +287,7 @@ api.rejectQuest = {
questName: group.quest.key,
uuid: user._id,
headers: req.headers,
}, true);
});
},
};
@@ -347,7 +347,7 @@ api.forceStart = {
questName: group.quest.key,
uuid: user._id,
headers: req.headers,
}, true);
});
},
};

View File

@@ -199,16 +199,6 @@ api.createUserTasks = {
res.respond(201, tasks.length === 1 ? tasks[0] : tasks);
tasks.forEach(task => {
if (user.flags.welcomed) { // Don't send Habitica default tasks to analytics
res.analytics.track('task create', {
uuid: user._id,
hitType: 'event',
category: 'behavior',
taskType: task.type,
headers: req.headers,
});
}
taskActivityWebhook.send(user, {
type: 'created',
task,
@@ -326,7 +316,7 @@ api.createChallengeTasks = {
if (challenge) challenge.addTasks(tasks);
tasks.forEach(task => {
res.analytics.track('task create', {
res.analytics.track('challenge task created', {
uuid: user._id,
hitType: 'event',
category: 'behavior',

View File

@@ -61,7 +61,7 @@ api.createGroupTasks = {
res.respond(201, tasks.length === 1 ? tasks[0] : tasks);
tasks.forEach(task => {
res.analytics.track('task create', {
res.analytics.track('team task created', {
uuid: user._id,
hitType: 'event',
category: 'behavior',