Skip to content

Commit

Permalink
Add some events to landing screen (#4664)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok authored Jun 27, 2024
1 parent 5641a43 commit 0ab6d54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/statsig/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': {}
Expand Down
4 changes: 4 additions & 0 deletions src/screens/StarterPack/StarterPackLandingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -128,6 +129,9 @@ function LandingScreenLoaded({
} else {
onContinue()
}
logEvent('starterPack:ctaPress', {
starterPack: starterPack.uri,
})
}

const onJoinWithoutPress = () => {
Expand Down
6 changes: 6 additions & 0 deletions src/screens/StarterPack/StarterPackScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ function StarterPackScreenInner({
const [link, setLink] = React.useState<string>()
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(
Expand Down

0 comments on commit 0ab6d54

Please sign in to comment.