Skip to content

Conversation

huggingbot
Copy link

Description

This PR implements analytics tracking enhancements across onboarding and authentication flows by integrating a unified event dispatching system and adding new tracking events.

New Analytics Events Added

The following new events were added to MetaMetrics.events.ts:

Onboarding & Authentication:

  • WALLET_LOGIN_SELECTED - When user selects login method
  • WALLET_LOGIN_COMPLETED - When existing user login succeeds
  • WALLET_REHYDRATION_ATTEMPTED - When social login user attempts to unlock wallet
  • WALLET_REHYDRATION_COMPLETED - When social login wallet unlock succeeds
  • WALLET_REHYDRATION_FAILED - When social login wallet unlock fails
  • RESET_WALLET_CLICKED - When user clicks reset wallet option

SRP & Security:

  • SRP_DEFINITION_CLICKED - When user clicks "What is a Secret Recovery Phrase?"
  • SECRET_RECOVERY_PHRASE_PICKER_CLICKED - When user opens SRP selector in multi-SRP scenarios
  • SRP_SCREENSHOT_ATTEMPTED - When user attempts to screenshot SRP screens

Settings & Password:

  • PASSWORD_CHANGED - When user successfully changes password (includes biometric properties)

Enhanced Event Dispatching System

Modified the following components to integrate saveOnboardingEvent Redux action for consistent event collection:

Onboarding Components:

  • AccountBackupStep1 - Added SRP definition click tracking
  • AccountBackupStep1B - Added SRP definition click and manual backup initiation tracking
  • ManualBackupStep1 - Added SRP definition click and phrase reveal tracking
  • ManualBackupStep2 - Added phrase confirmation tracking
  • ManualBackupStep3 - Added backup completion and hint saving tracking
  • Onboarding - Enhanced with account type properties for all flows
  • ChoosePassword - Added external link click tracking

Authentication Components:

  • Login - Added comprehensive OAuth flow tracking (rehydration attempts/completion/failure)
  • AccountStatus - Connected to event dispatching system
  • ImportFromSecretRecoveryPhrase - Added SRP definition click tracking

Settings & Security:

  • ResetPassword - Added password change event with biometric properties
  • AddNewAccount - Added SRP picker click tracking
  • ProtectYourWallet - Added SRP picker click tracking
  • ScreenshotDeterrent - Added SRP-specific screenshot attempt tracking

Copy link

github-actions bot commented Jun 2, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@@ -112,7 +113,7 @@ const AccountBackupStep1 = (props) => {
const track = (event, properties) => {
const eventBuilder = MetricsEventBuilder.createEventBuilder(event);
eventBuilder.addProperties(properties);
trackOnboarding(eventBuilder.build());
trackOnboarding(eventBuilder.build(), props.saveOnboardingEvent);
Copy link
Author

@huggingbot huggingbot Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most trackEvent calls have been replaced with the trackOnboarding call wrapped under the function track, because we want to buffer events. trackOnboarding is often call with saveOnboardingEvent as the second param in order to buffer events to the redux store. I have updated most if not all trackOnboarding calls to include saveOnboardingEvent as the second param for consistency. Not sure why they were not included in the first place.

note that in some pages we are still using trackEvent because there is no need to buffer events anymore as the pages will only appear during post-onboarding, e.g. ResetPassword, ProtectYourWallet, SRPListItem, etc

WALLET_REHYDRATION_FAILED = 'Wallet Rehydration Failed',
PASSWORD_CHANGED = 'Password Changed',
// TODO: Add this event once we have a forgot password flow
// FORGOT_PASSWORD_CLICKED = 'Forgot Password Clicked',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the forgot password flow is currently unavailable as mentioned by @ieow
it will / might be restored later on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant