From ebf8644df9d677a57e565f1c8b2983e33dab5749 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 19 Mar 2024 20:19:11 +0000 Subject: [PATCH] Track notification open (#3274) --- src/lib/notifications/notifications.ts | 2 ++ src/lib/statsig/events.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts index 62d0bfc4b1..e811f690ed 100644 --- a/src/lib/notifications/notifications.ts +++ b/src/lib/notifications/notifications.ts @@ -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') @@ -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 } diff --git a/src/lib/statsig/events.ts b/src/lib/statsig/events.ts index cb9f3fe924..b91a15ecb1 100644 --- a/src/lib/statsig/events.ts +++ b/src/lib/statsig/events.ts @@ -2,6 +2,7 @@ export type LogEvents = { init: { initMs: number } + 'notifications:openApp': {} 'state:background': {} 'state:foreground': {} 'feed:endReached': {