Add some events to landing screen (#4664)

zio/stable
Hailey 2024-06-26 19:00:35 -07:00 committed by GitHub
parent 5641a4393c
commit 0ab6d54093
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View File

@ -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': {}

View File

@ -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 = () => {

View File

@ -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(