From 08ac3a27c2be2a3bf345e6d2b34779653183cf7d Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 13 Sep 2024 12:05:15 -0500 Subject: [PATCH] Add events --- src/components/dialogs/nuxs/TenMillion/index.tsx | 5 +++++ src/lib/statsig/events.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/components/dialogs/nuxs/TenMillion/index.tsx b/src/components/dialogs/nuxs/TenMillion/index.tsx index 801ceb99ad..8d5511fdf0 100644 --- a/src/components/dialogs/nuxs/TenMillion/index.tsx +++ b/src/components/dialogs/nuxs/TenMillion/index.tsx @@ -12,6 +12,7 @@ import {useLingui} from '@lingui/react' import {networkRetry} from '#/lib/async/retry' import {getCanvas} from '#/lib/canvas' import {shareUrl} from '#/lib/sharing' +import {logEvent} from '#/lib/statsig/statsig' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {isIOS, isNative} from '#/platform/detection' @@ -199,6 +200,7 @@ export function TenMillionInner({userNumber}: {userNumber: number}) { if (uri) { control.close(() => { setTimeout(() => { + logEvent('tmd:post', {}) openComposer({ text: _( msg`Bluesky now has over 10 million users, and I was #${i18n.number( @@ -220,6 +222,7 @@ export function TenMillionInner({userNumber}: {userNumber: number}) { const onNativeShare = React.useCallback(() => { if (uri) { control.close(() => { + logEvent('tmd:share', {}) shareUrl(uri) }) } @@ -240,6 +243,7 @@ export function TenMillionInner({userNumber}: {userNumber: number}) { try { await MediaLibrary.createAssetAsync(uri) + logEvent('tmd:download', {}) Toast.show(_(msg`Image saved to your camera roll!`)) } catch (e: unknown) { console.log(e) @@ -258,6 +262,7 @@ export function TenMillionInner({userNumber}: {userNumber: number}) { link.setAttribute('download', `Bluesky 10M Users.png`) link.setAttribute('href', imgHref) link.click() + logEvent('tmd:download', {}) } }, [uri]) diff --git a/src/lib/statsig/events.ts b/src/lib/statsig/events.ts index 1871894902..c9bc8fefb2 100644 --- a/src/lib/statsig/events.ts +++ b/src/lib/statsig/events.ts @@ -225,4 +225,8 @@ export type LogEvents = { 'test:gate1:sometimes': {} 'test:gate2:always': {} 'test:gate2:sometimes': {} + + 'tmd:share': {} + 'tmd:download': {} + 'tmd:post': {} }