diff --git a/src/components/StarterPack/QrCodeDialog.tsx b/src/components/StarterPack/QrCodeDialog.tsx index 909e86088e..81f20f402d 100644 --- a/src/components/StarterPack/QrCodeDialog.tsx +++ b/src/components/StarterPack/QrCodeDialog.tsx @@ -10,6 +10,7 @@ import {useLingui} from '@lingui/react' import {nanoid} from 'nanoid/non-secure' import {saveImageToMediaLibrary} from 'lib/media/manip' +import {logEvent} from 'lib/statsig/statsig' import {isNative} from 'platform/detection' import * as Toast from '#/view/com/util/Toast' import {atoms as a} from '#/alf' @@ -84,6 +85,11 @@ export function QrCodeDialog({ link.click() } + logEvent('starterPack:share', { + starterPack: starterPack.uri, + shareType: 'qrcode', + qrShareType: 'save', + }) Toast.show(_(msg`QR code saved to your camera roll!`)) control.close() }) @@ -103,6 +109,11 @@ export function QrCodeDialog({ }) } + logEvent('starterPack:share', { + starterPack: starterPack.uri, + shareType: 'qrcode', + qrShareType: 'copy', + }) Toast.show(_(msg`QR code copied to your clipboard!`)) control.close() }) diff --git a/src/lib/statsig/events.ts b/src/lib/statsig/events.ts index 2d76eb12c4..6b41967eff 100644 --- a/src/lib/statsig/events.ts +++ b/src/lib/statsig/events.ts @@ -150,6 +150,11 @@ export type LogEvents = { | 'ChatsList' | 'SendViaChatDialog' } + 'starterPack:share': { + starterPack: string + shareType: 'link' | 'qrcode' + qrShareType?: 'save' | 'copy' + } 'test:all:always': {} 'test:all:sometimes': {} diff --git a/src/screens/StarterPack/StarterPackScreen.tsx b/src/screens/StarterPack/StarterPackScreen.tsx index 30abe8deef..a392e542ec 100644 --- a/src/screens/StarterPack/StarterPackScreen.tsx +++ b/src/screens/StarterPack/StarterPackScreen.tsx @@ -10,6 +10,7 @@ import {useQueryClient} from '@tanstack/react-query' import {makeProfileLink, makeStarterPackLink} from 'lib/routes/links' import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types' import {shareUrl} from 'lib/sharing' +import {logEvent} from 'lib/statsig/statsig' import {isWeb} from 'platform/detection' import {useSetUsedStarterPack} from 'state/preferences/starter-pack' import {RQKEY} from 'state/queries/list-members' @@ -235,6 +236,10 @@ function Header({ label={_(msg`Share link`)} testID="shareStarterPackLinkBtn" onPress={() => { + logEvent('starterPack:share', { + starterPack: starterPack.uri, + shareType: 'link', + }) shareUrl(makeStarterPackLink(name, rkey)) }}>