Add basic metrics to user notifications
Created by: artemruts
Description
This PR adds basic metrics to user notifications, specifically:
- when a user opens a notifications dropdown
- when a user clicks on the notification link
User notifications are loaded, tracking cases:
event name: UserNotificationsLoaded
payload: see UserNotificationsOpened
, payload variations are the same
User opens notifications dropdown, tracking cases:
-
No notifications, everything is synced and up-to-date
event name:
UserNotificationsOpened
payload:{ "status": "success" }
-
No added code hosts
event name:
UserNotificationsOpened
payload:{ "status": "NoCodehosts" }
-
No added repositories
event name:
UserNotificationsOpened
payload:{ "status": "NoRepos" }
-
Multiple in-progress and error notifications
event name:
UserNotificationsOpened
payload:{ "status": ["CloningProgress" | "IndexingProgress" | "ExternalServiceSyncError" | "SyncError" | "IndexingError"] }
User clicks a notifications link:
event name: UserNotificationsLinkClicked
payload:
{
"href": string,
"notificationType": "not-active" | "progress" | "warning" | "success" | "error"
}
notifications link tracking demo
https://user-images.githubusercontent.com/1319181/135966649-78ccfc6c-b4c9-4d5e-a0a0-2e0b53485111.mov
Tests
Tested locally and on .com