Add events to signup for captcha results (#4712)
parent
a9fe87b842
commit
0012c6d40f
|
@ -31,7 +31,13 @@ export type LogEvents = {
|
||||||
'splash:createAccountPressed': {}
|
'splash:createAccountPressed': {}
|
||||||
'signup:nextPressed': {
|
'signup:nextPressed': {
|
||||||
activeStep: number
|
activeStep: number
|
||||||
|
phoneVerificationRequired?: boolean
|
||||||
}
|
}
|
||||||
|
'signup:backPressed': {
|
||||||
|
activeStep: number
|
||||||
|
}
|
||||||
|
'signup:captchaSuccess': {}
|
||||||
|
'signup:captchaFailure': {}
|
||||||
'onboarding:interests:nextPressed': {
|
'onboarding:interests:nextPressed': {
|
||||||
selectedInterests: string[]
|
selectedInterests: string[]
|
||||||
selectedInterestsLength: number
|
selectedInterestsLength: number
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {nanoid} from 'nanoid/non-secure'
|
||||||
|
|
||||||
import {createFullHandle} from '#/lib/strings/handles'
|
import {createFullHandle} from '#/lib/strings/handles'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
|
import {logEvent} from 'lib/statsig/statsig'
|
||||||
import {ScreenTransition} from '#/screens/Login/ScreenTransition'
|
import {ScreenTransition} from '#/screens/Login/ScreenTransition'
|
||||||
import {useSignupContext, useSubmitSignup} from '#/screens/Signup/state'
|
import {useSignupContext, useSubmitSignup} from '#/screens/Signup/state'
|
||||||
import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView'
|
import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView'
|
||||||
|
@ -39,6 +40,7 @@ export function StepCaptcha() {
|
||||||
const onSuccess = React.useCallback(
|
const onSuccess = React.useCallback(
|
||||||
(code: string) => {
|
(code: string) => {
|
||||||
setCompleted(true)
|
setCompleted(true)
|
||||||
|
logEvent('signup:captchaSuccess', {})
|
||||||
submit(code)
|
submit(code)
|
||||||
},
|
},
|
||||||
[submit],
|
[submit],
|
||||||
|
@ -50,6 +52,7 @@ export function StepCaptcha() {
|
||||||
type: 'setError',
|
type: 'setError',
|
||||||
value: _(msg`Error receiving captcha response.`),
|
value: _(msg`Error receiving captcha response.`),
|
||||||
})
|
})
|
||||||
|
logEvent('signup:captchaFailure', {})
|
||||||
logger.error('Signup Flow Error', {
|
logger.error('Signup Flow Error', {
|
||||||
registrationHandle: state.handle,
|
registrationHandle: state.handle,
|
||||||
error,
|
error,
|
||||||
|
|
|
@ -112,6 +112,12 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logEvent('signup:nextPressed', {
|
||||||
|
activeStep: state.activeStep,
|
||||||
|
phoneVerificationRequired:
|
||||||
|
state.serviceDescription?.phoneVerificationRequired,
|
||||||
|
})
|
||||||
|
|
||||||
// phoneVerificationRequired is actually whether a captcha is required
|
// phoneVerificationRequired is actually whether a captcha is required
|
||||||
if (
|
if (
|
||||||
state.activeStep === SignupStep.HANDLE &&
|
state.activeStep === SignupStep.HANDLE &&
|
||||||
|
@ -120,11 +126,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||||
submit()
|
submit()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({type: 'next'})
|
dispatch({type: 'next'})
|
||||||
logEvent('signup:nextPressed', {
|
|
||||||
activeStep: state.activeStep,
|
|
||||||
})
|
|
||||||
}, [
|
}, [
|
||||||
_,
|
_,
|
||||||
state.activeStep,
|
state.activeStep,
|
||||||
|
@ -144,11 +146,13 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||||
registrationHandle: state.handle,
|
registrationHandle: state.handle,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({type: 'prev'})
|
dispatch({type: 'prev'})
|
||||||
} else {
|
} else {
|
||||||
onPressBack()
|
onPressBack()
|
||||||
}
|
}
|
||||||
|
logEvent('signup:backPressed', {
|
||||||
|
activeStep: state.activeStep,
|
||||||
|
})
|
||||||
}, [onPressBack, state.activeStep, state.handle])
|
}, [onPressBack, state.activeStep, state.handle])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue