fix Create Account metrics (#2242)

zio/stable
Ansh 2023-12-19 03:54:06 +05:30 committed by GitHub
parent 3e3a72a366
commit 7af4825911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -13,7 +13,6 @@ interface TrackPropertiesMap {
'Sign In': {resumedSession: boolean} // CAN BE SERVER 'Sign In': {resumedSession: boolean} // CAN BE SERVER
'Create Account': {} // CAN BE SERVER 'Create Account': {} // CAN BE SERVER
'Try Create Account': {} 'Try Create Account': {}
'Create Account Successfully': {}
'Signin:PressedForgotPassword': {} 'Signin:PressedForgotPassword': {}
'Signin:PressedSelectService': {} 'Signin:PressedSelectService': {}
// COMPOSER / CREATE POST events // COMPOSER / CREATE POST events

View File

@ -189,6 +189,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
}, },
logger.DebugContext.session, logger.DebugContext.session,
) )
track('Try Create Account')
const agent = new BskyAgent({service}) const agent = new BskyAgent({service})
@ -231,6 +232,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
}, },
logger.DebugContext.session, logger.DebugContext.session,
) )
track('Create Account')
}, },
[upsertAccount, queryClient], [upsertAccount, queryClient],
) )

View File

@ -30,7 +30,7 @@ import {Step2} from './Step2'
import {Step3} from './Step3' import {Step3} from './Step3'
export function CreateAccount({onPressBack}: {onPressBack: () => void}) { export function CreateAccount({onPressBack}: {onPressBack: () => void}) {
const {track, screen} = useAnalytics() const {screen} = useAnalytics()
const pal = usePalette('default') const pal = usePalette('default')
const {_} = useLingui() const {_} = useLingui()
const [uiState, uiDispatch] = useCreateAccount() const [uiState, uiDispatch] = useCreateAccount()
@ -93,21 +93,17 @@ export function CreateAccount({onPressBack}: {onPressBack: () => void}) {
uiDispatch, uiDispatch,
_, _,
}) })
track('Create Account')
setBirthDate({birthDate: uiState.birthDate}) setBirthDate({birthDate: uiState.birthDate})
if (IS_PROD(uiState.serviceUrl)) { if (IS_PROD(uiState.serviceUrl)) {
setSavedFeeds(DEFAULT_PROD_FEEDS) setSavedFeeds(DEFAULT_PROD_FEEDS)
} }
} catch { } catch {
// dont need to handle here // dont need to handle here
} finally {
track('Try Create Account')
} }
} }
}, [ }, [
uiState, uiState,
uiDispatch, uiDispatch,
track,
onboardingDispatch, onboardingDispatch,
createAccount, createAccount,
setBirthDate, setBirthDate,