alwaysbegrowing / pillar.gg

https://app.pillar.gg
2 stars 0 forks source link

Track analytics on moderators #193

Open gatesyp opened 3 years ago

gatesyp commented 3 years ago

When a user does an action on the frontend, we send a request to api/hubspot/event with the TwitchId of the selected user in the body. We use that twitchId to look the user up in the database + get more info to log the analytics event.

https://github.com/pillargg/pillar.gg/blob/master/api/hubspot/event.ts#L16

This is fine for a user that logs in to review their own VODs, but if a moderator logs in, selects the user they want to review VODs for, and then makes an analytics event, we send the TwitchID of the SelectedUser to the backend instead of the moderator's twitch ID. No analytics get tracked for moderators.

As a part of supporting moderators, we probably want to send the twitchId of the currently logged in user, and if the selectedUserId is different from the loggedInUserId, then we need to log an analytics event under the loggedInUserId + note for which selectedUserId they made the action on.

That way we can get analytics on how good the product is for moderators.

gatesyp commented 3 years ago

assigning this over to Teddy, since he can batch do the analytics stories @tedbyron

gatesyp commented 3 years ago

teddy we can chat about this one once you get to it (i recommend doing it last)

0xju1ie commented 3 years ago

@gatesyp

Are these the events we want tracked for moderators?

export const MAJOR_EVENT = 'pe9257754_major_event';
export const SAVED_ADJUSTED_CLIP_EVENT = 'pe9257754_saved_adjusted_clip';
export const EXPORT_CLIP_EVENT = 'pe9257754_export_clip';
export const CLICKED_CLIP_EVENT = 'pe9257754_clicked_clip';
gatesyp commented 3 years ago

Yes, but replacing the MAJOR_EVENT with EXPORT_MOBILE_CLIP event

0xju1ie commented 3 years ago

@gatesyp EXPORT_MOBILE_CLIP doesnt exist yet, are you saying we should make it?

have both an export mobile and export event?