Commit f22cf05
authored
fix: add missing metrics to import SRP flow and grouped Import SRP events (#37567)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
In this PR, added missing track event for SRP import: click event in Add
Wallet modal and completion event with hd_entropy_index on import.
- Metrics
- Import Secret Recovery Phrase Clicked:
This event needs to be added
It should fire when the user clicks the import wallet button on the
account list.
- Import Secret Recovery Phrase Continue Button Clicked:
It should fire when the user finishes importing an SRP (they click
continue)
Also we've enhanced our tracking by grouping the Import Secret Recovery
Phrase event with specific status properties: 'started',
'continue_button_clicked', and 'completed', along with location data.
This provides visibility into the full workflow timeline from initiation
to completion.
Jira Link: https://consensyssoftware.atlassian.net/browse/SL-277
Segment Schema PR:
https://github.com/Consensys/segment-schema/pull/367/files
[](https://codespaces.new/MetaMask/metamask-extension/pull/37567?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: added missing metrics to import SRP flow
## **Related issues**
Fixes:
## **Manual testing steps**
1. Open extesnion.
2. Create Wallet.
3. Add wallet and track event when user clicks on 'Import a wallet' and
when user successfully import the SRP.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
<img width="1728" height="858" alt="Screenshot 2025-11-06 at 3 20 25 PM"
src="https://github.com/user-attachments/assets/ce66954e-ebf5-40e8-903b-2b219ec5d968"
/>
<img width="1727" height="1070" alt="Screenshot 2025-11-06 at 3 21
04 PM"
src="https://github.com/user-attachments/assets/aed9cbf7-3c88-4033-a4b1-31b539ceb796"
/>
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Unifies SRP import tracking into a single event with
start/continue/completed statuses and adds hd_entropy_index and
discovered account counts on completion.
>
> - **Metrics**:
> - Consolidate `ImportSecretRecoveryPhraseClicked`/`Completed` into
`ImportSecretRecoveryPhrase` with status-based phases (`started`,
`continue_button_clicked`, `completed`).
> - **Background** (`app/scripts/metamask-controller.js`):
> - On SRP import completion, track `ImportSecretRecoveryPhrase` with
`hd_entropy_index`, `number_of_solana_accounts_discovered`, and
`number_of_bitcoin_accounts_discovered`.
> - **UI**:
> -
`ui/components/multichain-accounts/add-wallet-modal/add-wallet-modal.tsx`:
Track `ImportSecretRecoveryPhrase` with `status: 'started'` when
selecting "Import a wallet" (location: Add Wallet Modal).
> - `ui/components/multichain/account-menu/account-menu.tsx`: Track
`ImportSecretRecoveryPhrase` with `status: 'started'` when clicking SRP
import (location: Account Menu).
> - `ui/pages/multi-srp/import-srp/import-srp.tsx`: Track
`ImportSecretRecoveryPhrase` with `status: 'continue_button_clicked'` on
continue (location: Multi SRP Import).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b1ca69d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent d30e743 commit f22cf05
File tree
5 files changed
+34
-6
lines changed- app/scripts
- ui
- components
- multichain-accounts/add-wallet-modal
- pages/multi-srp/import-srp
5 files changed
+34
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4605 | 4605 | | |
4606 | 4606 | | |
4607 | 4607 | | |
4608 | | - | |
| 4608 | + | |
4609 | 4609 | | |
| 4610 | + | |
4610 | 4611 | | |
4611 | 4612 | | |
4612 | 4613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
722 | | - | |
723 | | - | |
| 722 | + | |
724 | 723 | | |
725 | 724 | | |
726 | 725 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
133 | 145 | | |
134 | 146 | | |
135 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
567 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
568 | 571 | | |
569 | 572 | | |
570 | 573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
67 | 79 | | |
| 80 | + | |
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
| |||
0 commit comments