Skip to content

Commit

Permalink
Track notification open (#3274)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Mar 19, 2024
1 parent 0cac671 commit ebf8644
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/notifications/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {logger} from '#/logger'
import {RQKEY as RQKEY_NOTIFS} from '#/state/queries/notifications/feed'
import {truncateAndInvalidate} from '#/state/queries/util'
import {SessionAccount, getAgent} from '#/state/session'
import {logEvent} from '../statsig/statsig'

const SERVICE_DID = (serviceUrl?: string) =>
serviceUrl?.includes('staging')
Expand Down Expand Up @@ -123,6 +124,7 @@ export function init(queryClient: QueryClient) {
logger.DebugContext.notifications,
)
track('Notificatons:OpenApp')
logEvent('notifications:openApp', {})
truncateAndInvalidate(queryClient, RQKEY_NOTIFS())
resetToTab('NotificationsTab') // open notifications tab
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/statsig/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export type LogEvents = {
init: {
initMs: number
}
'notifications:openApp': {}
'state:background': {}
'state:foreground': {}
'feed:endReached': {
Expand Down

0 comments on commit ebf8644

Please sign in to comment.