Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: metrics call during onboarding #13226

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

NicolasMassart
Copy link
Contributor

@NicolasMassart NicolasMassart commented Jan 28, 2025

Description

  • refactor track trackOnboarding calls to pass an event built with MetricsEventBuilder
  • pass the properties with MetricsEventBuilder.addProperties

Related issues

Fixes https://github.com/MetaMask/mobile-planning/issues/2122

Manual testing steps

Feature: track metrics during onboarding

  Scenario: user creates new wallet
    Given a freshly installed app
    And user opted in for metrics
    When user creates a new wallet
    And user enters a new password
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Setup Started", "Wallet Created" and "Wallet Setup Completed" log is visible

  Scenario: user imports wallet
    Given a freshly installed app
    And user opted in for metrics
    When user imports a wallet
    And user enters a new password
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Import Started", "Wallet Imported" and "Wallet Setup Completed" log is visible

  Scenario: user manually backs the wallet up
    Given a freshly installed app
    And user opted in for metrics
    And user created a new wallet
    When user saves SRP
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Security Started", "Manual Backup Initiated", "Phrase Revealed", "Phrase Confirmed" and "Wallet Security Completed" log is visible

  Scenario: user skips wallet backup
    Given a freshly installed app
    And user opted in for metrics
    And user created a new wallet
    When user skips SRP backup by touching "remind me later"
    Then no 'TRACK event saved {"event": undefined, "properties": {}, "type": "track"}' log is visible
    And the "Wallet Security Skip Initiated", "Wallet Security Skip Confirmed" and "Automatic Security Checks Prompt Viewed" log is visible

Screenshots/Recordings

Before

INFO  TRACK event saved {"event": undefined, "properties": {}, "type": "track"}

After

examples of fixed event tracking

INFO  TRACK event saved {"event": "Wallet Setup Started", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Created", "properties": {"biometrics_enabled": false}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Setup Completed", "properties": {"new_wallet": true, "wallet_setup_type": "new"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Import Started", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Imported", "properties": {"biometrics_enabled": false}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Setup Completed", "properties": {"new_wallet": false, "wallet_setup_type": "import"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Skip Initiated", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Skip Confirmed", "properties": {}, "type": "track"}
INFO  TRACK event saved {"event": "Automatic Security Checks Prompt Viewed", "properties": {"applicationVersion": "7.37.1", "currentBuildNumber": "1520", "deviceBrand": "Apple", "operatingSystemVersion": "18.2", "platform": "ios"}, "type": "track"}
INFO  TRACK event saved {"event": "Wallet Security Reminder Dismissed", "properties": {"source": "Backup Alert", "wallet_protection_required": false}, "type": "track"}

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

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.

@NicolasMassart NicolasMassart added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 28, 2025
Copy link
Contributor

github-actions bot commented Jan 28, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1a7780a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/40c42fd7-33b5-4e19-b4ec-12c09db40f03

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@NicolasMassart NicolasMassart requested a review from Cal-L January 28, 2025 17:55
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

2 participants