From 0ab6d540937adbc315444c96ba11c85ffa757d51 Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 26 Jun 2024 19:00:35 -0700 Subject: [PATCH] Add some events to landing screen (#4664) --- src/lib/statsig/events.ts | 6 ++++++ src/screens/StarterPack/StarterPackLandingScreen.tsx | 4 ++++ src/screens/StarterPack/StarterPackScreen.tsx | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/lib/statsig/events.ts b/src/lib/statsig/events.ts index 07ed8c0c..3efc11a5 100644 --- a/src/lib/statsig/events.ts +++ b/src/lib/statsig/events.ts @@ -188,6 +188,12 @@ export type LogEvents = { profilesCount: number feedsCount: number } + 'starterPack:ctaPress': { + starterPack: string + } + 'starterPack:opened': { + starterPack: string + } 'test:all:always': {} 'test:all:sometimes': {} diff --git a/src/screens/StarterPack/StarterPackLandingScreen.tsx b/src/screens/StarterPack/StarterPackLandingScreen.tsx index 2b450494..df13885e 100644 --- a/src/screens/StarterPack/StarterPackLandingScreen.tsx +++ b/src/screens/StarterPack/StarterPackLandingScreen.tsx @@ -14,6 +14,7 @@ import {useLingui} from '@lingui/react' import {JOINED_THIS_WEEK} from '#/lib/constants' import {isAndroidWeb} from 'lib/browser' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' +import {logEvent} from 'lib/statsig/statsig' import {createStarterPackGooglePlayUri} from 'lib/strings/starter-pack' import {isWeb} from 'platform/detection' import {useModerationOpts} from 'state/preferences/moderation-opts' @@ -128,6 +129,9 @@ function LandingScreenLoaded({ } else { onContinue() } + logEvent('starterPack:ctaPress', { + starterPack: starterPack.uri, + }) } const onJoinWithoutPress = () => { diff --git a/src/screens/StarterPack/StarterPackScreen.tsx b/src/screens/StarterPack/StarterPackScreen.tsx index 7c5cfd0b..aa0e75a2 100644 --- a/src/screens/StarterPack/StarterPackScreen.tsx +++ b/src/screens/StarterPack/StarterPackScreen.tsx @@ -152,6 +152,12 @@ function StarterPackScreenInner({ const [link, setLink] = React.useState() const [imageLoaded, setImageLoaded] = React.useState(false) + React.useEffect(() => { + logEvent('starterPack:opened', { + starterPack: starterPack.uri, + }) + }, [starterPack.uri]) + const onOpenShareDialog = React.useCallback(() => { const rkey = new AtUri(starterPack.uri).rkey shortenLink(makeStarterPackLink(starterPack.creator.did, rkey)).then(