diff --git a/app/components/Views/ChoosePassword/index.js b/app/components/Views/ChoosePassword/index.js index 5d1856ea403..502eabd232e 100644 --- a/app/components/Views/ChoosePassword/index.js +++ b/app/components/Views/ChoosePassword/index.js @@ -440,8 +440,10 @@ class ChoosePassword extends PureComponent { } const provider = this.props.route.params?.provider; + const accountType = provider ? `metamask_${provider}` : 'metamask'; + this.track(MetaMetricsEvents.WALLET_CREATION_ATTEMPTED, { - account_type: provider ? `metamask_${provider}` : 'metamask', + account_type: accountType, }); try { @@ -455,6 +457,18 @@ class ChoosePassword extends PureComponent { authType.oauth2Login = this.getOauth2LoginSuccess(); + const onboardingTraceCtx = this.props.route.params?.onboardingTraceCtx; + trace({ + name: TraceName.OnboardingSRPAccountCreationTime, + op: TraceOperation.OnboardingUserJourney, + parentContext: onboardingTraceCtx, + tags: { + is_social_login: Boolean(provider), + account_type: accountType, + biometrics_enabled: Boolean(this.state.biometryType), + }, + }); + Logger.log('previous_screen', previous_screen); if (previous_screen.toLowerCase() === ONBOARDING.toLowerCase()) { try { @@ -514,13 +528,14 @@ class ChoosePassword extends PureComponent { } this.track(MetaMetricsEvents.WALLET_CREATED, { biometrics_enabled: Boolean(this.state.biometryType), - account_type: provider ? `metamask_${provider}` : 'metamask', + account_type: accountType, }); this.track(MetaMetricsEvents.WALLET_SETUP_COMPLETED, { wallet_setup_type: 'new', new_wallet: true, - account_type: provider ? `metamask_${provider}` : 'metamask', + account_type: accountType, }); + endTrace({ name: TraceName.OnboardingSRPAccountCreationTime }); } catch (error) { try { await this.recreateVault(''); diff --git a/app/components/Views/ImportFromSecretRecoveryPhrase/index.js b/app/components/Views/ImportFromSecretRecoveryPhrase/index.js index 9900b678220..b0bdc87ea98 100644 --- a/app/components/Views/ImportFromSecretRecoveryPhrase/index.js +++ b/app/components/Views/ImportFromSecretRecoveryPhrase/index.js @@ -600,6 +600,18 @@ const ImportFromSecretRecoveryPhrase = ({ } else { try { setLoading(true); + const onboardingTraceCtx = route.params?.onboardingTraceCtx; + const oauthLoginSuccess = route.params?.oauthLoginSuccess || false; + trace({ + name: TraceName.OnboardingSRPAccountImportTime, + op: TraceOperation.OnboardingUserJourney, + parentContext: onboardingTraceCtx, + tags: { + is_social_login: oauthLoginSuccess, + account_type: oauthLoginSuccess ? 'social_import' : 'srp_import', + biometrics_enabled: Boolean(biometryType), + }, + }); const authData = await Authentication.componentAuthenticationType( biometryChoice, rememberMe, @@ -642,6 +654,7 @@ const ImportFromSecretRecoveryPhrase = ({ }, ], }); + endTrace({ name: TraceName.OnboardingSRPAccountImportTime }); endTrace({ name: TraceName.OnboardingExistingSrpImport }); endTrace({ name: TraceName.OnboardingJourneyOverall }); diff --git a/app/util/trace.ts b/app/util/trace.ts index 52107024af1..9ba182aa0f6 100644 --- a/app/util/trace.ts +++ b/app/util/trace.ts @@ -96,6 +96,8 @@ export enum TraceName { OnboardingOAuthProviderLoginError = 'Onboarding - OAuth Provider Login Error', OnboardingOAuthBYOAServerGetAuthTokensError = 'Onboarding - OAuth BYOA Server Get Auth Tokens Error', OnboardingOAuthSeedlessAuthenticateError = 'Onboarding - OAuth Seedless Authenticate Error', + OnboardingSRPAccountCreationTime = 'Onboarding SRP Account Creation Time', + OnboardingSRPAccountImportTime = 'Onboarding SRP Account Import Time', SwapViewLoaded = 'Swap View Loaded', BridgeBalancesUpdated = 'Bridge Balances Updated', Card = 'Card',