Skip to content

refactor(analytics): migrate onboarding-flow to analytics selectors#43431

Merged
gauthierpetetin merged 1 commit into
mainfrom
refactor/analytics-phase-b-web3auth
Jun 15, 2026
Merged

refactor(analytics): migrate onboarding-flow to analytics selectors#43431
gauthierpetetin merged 1 commit into
mainfrom
refactor/analytics-phase-b-web3auth

Conversation

@gauthierpetetin

@gauthierpetetin gauthierpetetin commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

Part 3 of the Analytics Phase B split (supersedes monolithic #43406).

Owner: @MetaMask/web3auth

Reason: Onboarding and subscription flows still read legacy metrics selectors.

Solution: Migrate onboarding-flow pages/tests, useSubscription.ts, and onboarding E2E to getOptedIn, getCompletedMetaMetricsOnboarding, and getAnalyticsId.

Depends on: #43430

Changelog

CHANGELOG entry: null

Related issues

Part of https://github.com/MetaMask/MetaMask-planning/issues/7331

Manual testing steps

  1. Run yarn start and complete create-wallet and import-wallet onboarding flows
  2. Verify metrics opt-in and opt-out during onboarding
  3. Run yarn build:test then yarn test:e2e:single test/e2e/tests/onboarding/onboarding.spec.ts --browser=chrome

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.

@github-actions

Copy link
Copy Markdown
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.

@mm-token-exchange-service mm-token-exchange-service Bot added the team-extension-platform Extension Platform team label Jun 11, 2026
@mm-token-exchange-service

mm-token-exchange-service Bot commented Jun 11, 2026

Copy link
Copy Markdown

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (11 files, +56 -56)
  • 📁 ui/
    • 📁 hooks/
      • 📁 subscription/
        • 📄 useSubscription.ts +5 -5
    • 📁 pages/
      • 📁 onboarding-flow/
        • 📁 create-password/
          • 📄 create-password.test.tsx +6 -3
          • 📄 create-password.tsx +12 -14
        • 📁 creation-successful/
          • 📄 creation-successful.tsx +4 -4
        • 📁 download-app/
          • 📄 download-app.test.tsx +4 -2
        • 📁 metametrics/
          • 📄 metametrics.test.tsx +2 -1
          • 📄 metametrics.tsx +8 -12
        • 📁 onboarding-flow-switch/
          • 📄 onboarding-flow-switch.tsx +4 -4
        • 📁 setup-passkey/
          • 📄 setup-passkey.tsx +5 -5
        • 📁 welcome/
          • 📄 welcome.test.tsx +1 -1
          • 📄 welcome.tsx +5 -5

@metamaskbotv2

metamaskbotv2 Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
Builds ready [8cd43a7]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 9 warn · 🔴 0 fail)

Baseline (latest main): 1ab4918 | Date: 6/11/2026 | Pipeline: 27327234127 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/inp: +25%
  • loadNewAccount/lcp: -15%
  • bridgeUserActions/longTaskCount: -38%
  • bridgeUserActions/longTaskTotalDuration: -31%
  • bridgeUserActions/tbt: -14%
  • bridgeUserActions/fcp: +11%
  • bridgeUserActions/lcp: +11%
  • loadNewAccount/load_new_account: +46%
  • loadNewAccount/total: +46%
  • loadNewAccount/lcp: +1097%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/inp: +10%
  • confirmTx/lcp: +1186%
  • bridgeUserActions/bridge_load_page: +347%
  • bridgeUserActions/bridge_load_asset_picker: +119%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +39%
  • bridgeUserActions/inp: +12%
  • bridgeUserActions/lcp: +1158%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 bridgeUserActions/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/backgroundConnect: +10%
  • startupPowerUserHome/numNetworkReqs: +47%
  • startupStandardHome/domInteractive: -13%
  • startupStandardHome/setupStore: -12%
  • startupStandardHome/inp: -38%
  • startupStandardHome/fcp: -20%
  • startupPowerUserHome/domInteractive: +48%
  • startupPowerUserHome/backgroundConnect: +39%
  • startupPowerUserHome/numNetworkReqs: -15%
  • startupPowerUserHome/fcp: +40%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 528ms
  • 🟡 startupPowerUserHome/LCP: p75 2.9s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/metricsToWalletReadyScreen: +13%
  • onboardingImportWallet/doneButtonToHomeScreen: -91%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -98%
  • onboardingImportWallet/longTaskCount: -77%
  • onboardingImportWallet/longTaskTotalDuration: -93%
  • onboardingImportWallet/longTaskMaxDuration: -89%
  • onboardingImportWallet/tbt: -98%
  • onboardingImportWallet/total: -90%
  • onboardingNewWallet/createPwToRecoveryScreen: +10%
  • onboardingNewWallet/skipBackupToMetricsScreen: +10%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +14%
  • onboardingNewWallet/doneButtonToAssetList: -21%
  • onboardingNewWallet/longTaskCount: -38%
  • onboardingNewWallet/longTaskTotalDuration: -34%
  • onboardingNewWallet/longTaskMaxDuration: +17%
  • onboardingNewWallet/tbt: -16%
  • onboardingNewWallet/total: -17%
  • assetDetails/assetClickToPriceChart: +50%
  • assetDetails/longTaskCount: +900%
  • assetDetails/longTaskTotalDuration: +1083%
  • assetDetails/longTaskMaxDuration: +700%
  • assetDetails/total: +50%
  • assetDetails/inp: -23%
  • assetDetails/lcp: -11%
  • assetDetails/cls: -94%
  • solanaAssetDetails/assetClickToPriceChart: -19%
  • solanaAssetDetails/total: -19%
  • solanaAssetDetails/cls: -84%
  • importSrpHome/loginToHomeScreen: -25%
  • importSrpHome/homeAfterImportWithNewWallet: -36%
  • importSrpHome/longTaskCount: -24%
  • importSrpHome/longTaskTotalDuration: -24%
  • importSrpHome/longTaskMaxDuration: -15%
  • importSrpHome/tbt: -29%
  • importSrpHome/total: -34%
  • importSrpHome/inp: -38%
  • importSrpHome/fcp: +18%
  • importSrpHome/cls: -64%
  • sendTransactions/openSendPageFromHome: +17%
  • sendTransactions/selectTokenToSendFormLoaded: +15%
  • sendTransactions/reviewTransactionToConfirmationPage: +13%
  • sendTransactions/longTaskCount: +11%
  • sendTransactions/longTaskTotalDuration: +18%
  • sendTransactions/tbt: +32%
  • sendTransactions/total: +12%
  • sendTransactions/inp: -30%
  • sendTransactions/cls: -87%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/FCP: p75 2.0s
  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.8s
  • 🟡 importSrpHome/FCP: p75 1.8s
  • 🟡 sendTransactions/FCP: p75 1.8s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: -27%
  • dappPageLoad/domContentLoaded: -23%
  • dappPageLoad/firstPaint: -17%
  • dappPageLoad/firstContentfulPaint: -17%
Bundle size diffs
  • background: 245 Bytes (0%)
  • ui: -47 Bytes (0%)
  • common: 188 Bytes (0%)

Base automatically changed from refactor/analytics-phase-b-foundation to main June 11, 2026 14:49
@gauthierpetetin gauthierpetetin force-pushed the refactor/analytics-phase-b-web3auth branch from 8cd43a7 to cfa7f76 Compare June 11, 2026 14:53
pull Bot pushed a commit to Reality2byte/metamask-extension that referenced this pull request Jun 11, 2026
MetaMask#43430)

## **Description**

Part 1 of the Analytics Phase B split (supersedes monolithic MetaMask#43406).

**Reason:** Phase B migrates off legacy `participateInMetaMetrics` /
`metaMetricsId` toward canonical `analyticsId`, `optedIn`, and
`completedMetaMetricsOnboarding`.

**Solution:** This PR lands the shared foundation: Redux initial state,
selectors, metrics context, background/Sentry/controller wiring, and
messenger/service inits. It also adds temporary backward-compat shims so
domain PRs can merge in parallel.

**Shim contract (removed in MetaMask#43442):**

| Legacy | Replacement | Shim behavior |
|--------|-------------|---------------|
| `getParticipateInMetaMetrics` | `completed && optedIn` | deprecated
alias |
| `getIsParticipateInMetaMetricsSet` |
`getCompletedMetaMetricsOnboarding` | alias |
| `getMetaMetricsId` | `getAnalyticsId` | alias |
| `state.metamask.metaMetricsId` | `state.metamask.analyticsId` |
projected in `getState()` |
| `state.metamask.participateInMetaMetrics` | derived from canonical
fields | projected in `getState()` |

**Merge order:** Must merge before consumer PRs (MetaMask#43431MetaMask#43441).

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Part of MetaMask/MetaMask-planning#7331

## **Manual testing steps**

1. Run `yarn start` and load the extension
2. Complete onboarding metrics opt-in and opt-out flows
3. Toggle metrics in Settings → Privacy
4. Confirm the extension loads without background selector errors

<!--
## **Screenshots/Recordings**

### **Before**

### **After**
-->

## **Pre-merge author checklist**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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**

- [ ] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes how analytics consent and user ID are read everywhere events,
Sentry, OAuth buffering, and sampling run; behavior should match the old
model but the split onboarding/opt-in gates add regression surface
across privacy flows.
> 
> **Overview**
> **Phase B foundation** for analytics: the extension stops treating
`participateInMetaMetrics` and `metaMetricsId` as the source of truth
and wires **`analyticsId`**, **`optedIn`**, and
**`completedMetaMetricsOnboarding`** through Redux, background,
controllers, and Sentry.
> 
> The UI Redux slice and selectors now expose the canonical fields
(`getOptedIn`, `getCompletedMetaMetricsOnboarding`, `getAnalyticsId`),
with **deprecated aliases** for `getParticipateInMetaMetrics`,
`getIsParticipateInMetaMetricsSet`, and `getMetaMetricsId`.
`MetaMetricsProvider` gates buffering and immediate tracking on
**onboarding complete + opt-in + analytics ID** instead of the old
combined flag.
> 
> Background and services apply the same split: `AppOpened` /
`AppInstalled` / dapp-viewed sampling, cookie handler setup, OAuth event
buffering, uninstall URL encoding, data-deletion Segment calls, and RPC
degraded/unavailable sampling all read **`analyticsId`** and require
**`completedMetaMetricsOnboarding && optedIn`** where metrics used to
check `participateInMetaMetrics`. Messenger inits fetch the ID via
**`AnalyticsController:getState`** rather than
`MetaMetricsController:getMetaMetricsId`.
> 
> Sentry helpers are renamed and reshaped (`getAnalyticsState`,
`AnalyticsParticipation`) so transport, breadcrumbs, and the MetaMetrics
integration drop or send events based on the two consent booleans and
attach `user.id` from `analyticsId`. `getState()` in the main controller
still **projects** legacy `participateInMetaMetrics` / `metaMetricsId`
for parallel consumer PRs.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7311dbb. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@metamaskbotv2

metamaskbotv2 Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
Builds ready [cfa7f76]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 10 warn · 🔴 0 fail)

Baseline (latest main): f159b1d | Date: 6/11/2026 | Pipeline: 27355743962 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +14%
  • loadNewAccount/total: +14%
  • loadNewAccount/inp: +67%
  • loadNewAccount/cls: -17%
  • bridgeUserActions/longTaskCount: -17%
  • bridgeUserActions/longTaskTotalDuration: -12%
  • bridgeUserActions/inp: +16%
  • loadNewAccount/load_new_account: +15%
  • loadNewAccount/total: +15%
  • loadNewAccount/lcp: +1153%
  • confirmTx/confirm_tx: +11%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/total: +11%
  • confirmTx/lcp: +1078%
  • bridgeUserActions/bridge_load_page: +294%
  • bridgeUserActions/bridge_load_asset_picker: +57%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +31%
  • bridgeUserActions/inp: -39%
  • bridgeUserActions/fcp: +14%
  • bridgeUserActions/lcp: +1226%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupPowerUserHome/domInteractive: +11%
  • startupPowerUserHome/numNetworkReqs: +50%
  • startupStandardHome/backgroundConnect: +13%
  • startupStandardHome/setupStore: +21%
  • startupStandardHome/inp: +108%
  • startupPowerUserHome/domInteractive: -18%
  • startupPowerUserHome/fcp: -21%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 536ms
  • 🟡 startupPowerUserHome/LCP: p75 3.4s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: +10%
  • onboardingImportWallet/confirmSrpToPwForm: +15%
  • onboardingImportWallet/pwFormToMetricsScreen: +12%
  • onboardingImportWallet/metricsToWalletReadyScreen: +27%
  • onboardingImportWallet/doneButtonToHomeScreen: -86%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -98%
  • onboardingImportWallet/longTaskCount: -38%
  • onboardingImportWallet/longTaskTotalDuration: -80%
  • onboardingImportWallet/longTaskMaxDuration: -86%
  • onboardingImportWallet/tbt: -96%
  • onboardingImportWallet/total: -85%
  • onboardingNewWallet/skipBackupToMetricsScreen: +16%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +12%
  • onboardingNewWallet/doneButtonToAssetList: -14%
  • onboardingNewWallet/longTaskCount: -38%
  • onboardingNewWallet/longTaskTotalDuration: -50%
  • onboardingNewWallet/longTaskMaxDuration: -27%
  • onboardingNewWallet/tbt: -73%
  • onboardingNewWallet/total: -12%
  • assetDetails/assetClickToPriceChart: -25%
  • assetDetails/total: -25%
  • assetDetails/inp: -34%
  • assetDetails/cls: -75%
  • solanaAssetDetails/assetClickToPriceChart: +66%
  • solanaAssetDetails/longTaskCount: +150%
  • solanaAssetDetails/longTaskTotalDuration: +243%
  • solanaAssetDetails/longTaskMaxDuration: +243%
  • solanaAssetDetails/tbt: +459%
  • solanaAssetDetails/total: +66%
  • solanaAssetDetails/cls: -93%
  • importSrpHome/loginToHomeScreen: -16%
  • importSrpHome/homeAfterImportWithNewWallet: -30%
  • importSrpHome/longTaskCount: -11%
  • importSrpHome/longTaskTotalDuration: -12%
  • importSrpHome/tbt: -11%
  • importSrpHome/total: -25%
  • importSrpHome/inp: -24%
  • importSrpHome/lcp: +16%
  • sendTransactions/selectTokenToSendFormLoaded: +15%
  • sendTransactions/reviewTransactionToConfirmationPage: +12%
  • sendTransactions/tbt: +17%
  • sendTransactions/total: +12%
  • sendTransactions/inp: -44%
  • sendTransactions/fcp: -23%
  • sendTransactions/lcp: -27%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.8s
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 sendTransactions/FCP: p75 1.8s
Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs
  • background: 246 Bytes (0%)
  • ui: -47 Bytes (0%)
  • common: 188 Bytes (0%)

@metamaskbotv2

metamaskbotv2 Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
Builds ready [2e2465b] [reused from cfa7f76]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 10 warn · 🔴 0 fail)

Baseline (latest main): 86afca4 | Date: 6/11/2026 | Pipeline: 27360408312 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +12%
  • loadNewAccount/total: +12%
  • loadNewAccount/inp: +58%
  • loadNewAccount/cls: -17%
  • bridgeUserActions/longTaskCount: -17%
  • bridgeUserActions/longTaskTotalDuration: -12%
  • bridgeUserActions/inp: +16%
  • loadNewAccount/load_new_account: +13%
  • loadNewAccount/total: +13%
  • loadNewAccount/inp: -12%
  • loadNewAccount/lcp: +1153%
  • confirmTx/confirm_tx: +11%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/total: +11%
  • confirmTx/lcp: +1121%
  • bridgeUserActions/bridge_load_page: +294%
  • bridgeUserActions/bridge_load_asset_picker: +52%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +30%
  • bridgeUserActions/inp: -39%
  • bridgeUserActions/fcp: +14%
  • bridgeUserActions/lcp: +1243%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupPowerUserHome/domInteractive: +13%
  • startupPowerUserHome/numNetworkReqs: +49%
  • startupStandardHome/backgroundConnect: +14%
  • startupStandardHome/firstReactRender: +11%
  • startupStandardHome/setupStore: +23%
  • startupStandardHome/inp: +150%
  • startupPowerUserHome/fcp: -12%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 536ms
  • 🟡 startupPowerUserHome/LCP: p75 3.4s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: +13%
  • onboardingImportWallet/confirmSrpToPwForm: +18%
  • onboardingImportWallet/pwFormToMetricsScreen: +15%
  • onboardingImportWallet/metricsToWalletReadyScreen: +29%
  • onboardingImportWallet/doneButtonToHomeScreen: -85%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -98%
  • onboardingImportWallet/longTaskCount: -44%
  • onboardingImportWallet/longTaskTotalDuration: -85%
  • onboardingImportWallet/longTaskMaxDuration: -89%
  • onboardingImportWallet/tbt: -97%
  • onboardingImportWallet/total: -84%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +11%
  • onboardingNewWallet/doneButtonToAssetList: -17%
  • onboardingNewWallet/longTaskCount: -44%
  • onboardingNewWallet/longTaskTotalDuration: -56%
  • onboardingNewWallet/longTaskMaxDuration: -34%
  • onboardingNewWallet/tbt: -76%
  • onboardingNewWallet/total: -14%
  • solanaAssetDetails/assetClickToPriceChart: +61%
  • solanaAssetDetails/longTaskCount: +150%
  • solanaAssetDetails/longTaskTotalDuration: +243%
  • solanaAssetDetails/longTaskMaxDuration: +243%
  • solanaAssetDetails/tbt: +459%
  • solanaAssetDetails/total: +61%
  • solanaAssetDetails/lcp: -10%
  • solanaAssetDetails/cls: -93%
  • importSrpHome/loginToHomeScreen: -16%
  • importSrpHome/openAccountMenuAfterLogin: +14%
  • importSrpHome/homeAfterImportWithNewWallet: -33%
  • importSrpHome/longTaskCount: -12%
  • importSrpHome/longTaskTotalDuration: -12%
  • importSrpHome/tbt: -13%
  • importSrpHome/total: -28%
  • importSrpHome/inp: -26%
  • importSrpHome/lcp: +15%
  • sendTransactions/reviewTransactionToConfirmationPage: +19%
  • sendTransactions/tbt: +23%
  • sendTransactions/total: +18%
  • sendTransactions/inp: -42%
  • sendTransactions/fcp: -22%
  • sendTransactions/lcp: -28%
  • sendTransactions/cls: -73%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.8s
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 sendTransactions/FCP: p75 1.8s
Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: -47 Bytes (0%)
  • common: 20 Bytes (0%)

Refresh slice from main-synced monolithic branch.
@metamaskbotv2

metamaskbotv2 Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
Builds ready [5a37f8d]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 20 pass · 🟡 5 warn · 🔴 0 fail)

Baseline (latest main): 5befce5 | Date: 6/12/2026 | Pipeline: 27394665960 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
🟡 bridge_search_token

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -26%
  • loadNewAccount/longTaskCount: -100%
  • loadNewAccount/longTaskTotalDuration: -100%
  • loadNewAccount/longTaskMaxDuration: -100%
  • loadNewAccount/tbt: -100%
  • loadNewAccount/total: -26%
  • loadNewAccount/inp: -39%
  • loadNewAccount/lcp: -67%
  • confirmTx/longTaskTotalDuration: -14%
  • confirmTx/tbt: -18%
  • confirmTx/inp: +25%
  • bridgeUserActions/bridge_load_page: -19%
  • bridgeUserActions/bridge_load_asset_picker: -20%
  • bridgeUserActions/tbt: -20%
  • bridgeUserActions/inp: +15%
  • loadNewAccount/load_new_account: +409%
  • loadNewAccount/longTaskCount: -100%
  • loadNewAccount/longTaskTotalDuration: -100%
  • loadNewAccount/longTaskMaxDuration: -100%
  • loadNewAccount/tbt: -100%
  • loadNewAccount/total: +409%
  • loadNewAccount/inp: -32%
  • loadNewAccount/lcp: +338%
  • confirmTx/confirm_tx: +12%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/total: +12%
  • confirmTx/inp: -20%
  • confirmTx/fcp: -62%
  • confirmTx/lcp: +1141%
  • bridgeUserActions/bridge_load_page: +153%
  • bridgeUserActions/bridge_load_asset_picker: +64%
  • bridgeUserActions/bridge_search_token: +199%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +196%
  • bridgeUserActions/fcp: -53%
  • bridgeUserActions/lcp: +1110%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -20%
  • startupStandardHome/load: -19%
  • startupStandardHome/domContentLoaded: -19%
  • startupStandardHome/domInteractive: -18%
  • startupStandardHome/backgroundConnect: -18%
  • startupStandardHome/firstReactRender: -19%
  • startupStandardHome/loadScripts: -19%
  • startupStandardHome/setupStore: -21%
  • startupStandardHome/longTaskTotalDuration: -22%
  • startupStandardHome/longTaskMaxDuration: -22%
  • startupStandardHome/tbt: -27%
  • startupStandardHome/inp: -22%
  • startupStandardHome/fcp: -19%
  • startupStandardHome/lcp: -16%
  • startupStandardHome/setupStore: +14%
  • startupStandardHome/inp: -17%
  • startupPowerUserHome/backgroundConnect: +50%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 528ms
  • 🟡 startupPowerUserHome/LCP: p75 3.2s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
importSrpHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/doneButtonToHomeScreen: -90%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -98%
  • onboardingImportWallet/longTaskCount: -71%
  • onboardingImportWallet/longTaskTotalDuration: -89%
  • onboardingImportWallet/longTaskMaxDuration: -83%
  • onboardingImportWallet/tbt: -98%
  • onboardingImportWallet/total: -89%
  • onboardingNewWallet/doneButtonToAssetList: -44%
  • onboardingNewWallet/longTaskCount: -55%
  • onboardingNewWallet/longTaskTotalDuration: -64%
  • onboardingNewWallet/longTaskMaxDuration: -34%
  • onboardingNewWallet/tbt: -79%
  • onboardingNewWallet/total: -37%
  • solanaAssetDetails/assetClickToPriceChart: -41%
  • solanaAssetDetails/longTaskCount: -100%
  • solanaAssetDetails/longTaskTotalDuration: -100%
  • solanaAssetDetails/longTaskMaxDuration: -100%
  • solanaAssetDetails/total: -41%
  • solanaAssetDetails/inp: +16%
  • solanaAssetDetails/cls: -92%
  • importSrpHome/openAccountMenuAfterLogin: +12%
  • importSrpHome/homeAfterImportWithNewWallet: -35%
  • importSrpHome/longTaskCount: -27%
  • importSrpHome/longTaskTotalDuration: -26%
  • importSrpHome/tbt: -24%
  • importSrpHome/total: -28%
  • importSrpHome/inp: -26%
  • importSrpHome/lcp: +11%
  • sendTransactions/openSendPageFromHome: -34%
  • sendTransactions/selectTokenToSendFormLoaded: +11%
  • sendTransactions/reviewTransactionToConfirmationPage: +13%
  • sendTransactions/tbt: +11%
  • sendTransactions/total: +13%
  • sendTransactions/inp: -33%
  • sendTransactions/cls: -89%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/FCP: p75 1.9s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: -47 Bytes (0%)
  • common: 20 Bytes (0%)

pull Bot pushed a commit to Reality2byte/metamask-extension that referenced this pull request Jun 12, 2026
…Mask#43467)

## **Description**

Part 2 of the Analytics Phase B split (supersedes monolithic MetaMask#43406).

After foundation
([MetaMask#43430](MetaMask#43430))
merged, child analytics PRs failed `yarn lint:tsc` because migrated E2E
tests used canonical fields (`analyticsId`, `optedIn`,
`MOCK_ANALYTICS_ID`) while unmigrated tests still used legacy fields
(`metaMetricsId`, `participateInMetaMetrics`, `MOCK_META_METRICS_ID`).

This PR adds transitional dual-support in E2E fixtures and flow helpers
so domain PRs
([MetaMask#43431](https://github.com/MetaMask/metamask-extension/pull/43431)–[#43441](https://github.com/MetaMask/metamask-extension/pull/43441))
can merge in parallel. Cleanup
([MetaMask#43442](MetaMask#43442))
removes this shim last.

**Changes:**
- `test/e2e/constants.ts` — `MOCK_ANALYTICS_ID` plus deprecated
`MOCK_META_METRICS_ID` alias
- `test/e2e/fixtures/fixture-builder-v2.ts` —
`withMetaMetricsController` accepts legacy and canonical patch fields
- `test/e2e/page-objects/flows/onboarding.flow.ts` —
`OnboardingMetricsFlowOptions` with `resolveOptedIn()`
- `test/e2e/page-objects/flows/vault-corruption.flow.ts` — accepts
canonical onboarding metrics options

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: MetaMask/MetaMask-planning#7331
(partial)

## **Manual testing steps**

1. None, E2E tests shall pass as before

<!--
## **Screenshots/Recordings**

### **Before**

### **After**
-->

## **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**

- [ ] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Test-only helpers and constants; no production wallet or analytics
runtime behavior changes.
> 
> **Overview**
> Adds a **transitional dual-support layer** in E2E so analytics
migration PRs can land in parallel without `yarn lint:tsc` failures from
mixed legacy and canonical naming.
> 
> **Constants:** Introduces `MOCK_ANALYTICS_ID` and keeps
`MOCK_META_METRICS_ID` as a deprecated alias to the same value.
> 
> **Fixtures:** `withMetaMetricsController` now accepts both legacy
(`metaMetricsId`, `participateInMetaMetrics`) and canonical
(`analyticsId`, `optedIn`) patches, resolves them with canonical taking
precedence for IDs, and writes `AnalyticsController` state
(`analyticsId`, `optedIn`) while still merging real
`MetaMetricsController` fields.
> 
> **Onboarding flows:** New `OnboardingMetricsFlowOptions` and
`resolveOptedIn()` unify opt-in behavior; flows accept `optedIn`
alongside deprecated `participateInMetaMetrics`. Post-metrics wait
accepts either `analyticsId` or `metaMetricsId` in app state.
> 
> **Vault corruption:** `onboardThenExecuteScript` /
`onboardThenTriggerCorruptionFlow` use the shared metrics options type
and forward `optedIn`.
> 
> Intended to be removed by a follow-up cleanup PR once all E2E tests
use canonical fields.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1f05308. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@gauthierpetetin gauthierpetetin marked this pull request as ready for review June 15, 2026 03:30
@gauthierpetetin gauthierpetetin requested a review from a team as a code owner June 15, 2026 03:30
@gauthierpetetin gauthierpetetin requested a review from Copilot June 15, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the Analytics Phase B migration by updating onboarding-flow UI/pages, related unit tests, the subscription support hook, and onboarding E2E coverage to read analytics state via the canonical selectors (getOptedIn, getCompletedMetaMetricsOnboarding, getAnalyticsId) instead of legacy MetaMetrics selectors/fields.

Changes:

  • Migrates multiple onboarding flow routes/pages to getCompletedMetaMetricsOnboarding / getOptedIn / getAnalyticsId.
  • Updates onboarding-flow unit tests to use analyticsId, optedIn, and completedMetaMetricsOnboarding in mocked state.
  • Updates onboarding E2E fixture patching to use canonical analytics fields.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/pages/onboarding-flow/welcome/welcome.tsx Switches onboarding routing gate from legacy “participation set” selector to getCompletedMetaMetricsOnboarding.
ui/pages/onboarding-flow/welcome/welcome.test.tsx Updates mock state to use analyticsId instead of metaMetricsId.
ui/pages/onboarding-flow/setup-passkey/setup-passkey.tsx Uses getCompletedMetaMetricsOnboarding to decide whether to show MetaMetrics step.
ui/pages/onboarding-flow/onboarding-flow-switch/onboarding-flow-switch.tsx Updates redirect logic to depend on getCompletedMetaMetricsOnboarding.
ui/pages/onboarding-flow/metametrics/metametrics.tsx Migrates checkbox initialization to use getOptedIn + getCompletedMetaMetricsOnboarding.
ui/pages/onboarding-flow/metametrics/metametrics.test.tsx Updates mocked state to canonical optedIn / completedMetaMetricsOnboarding.
ui/pages/onboarding-flow/download-app/download-app.test.tsx Updates test state override typing and defaults to canonical analytics fields.
ui/pages/onboarding-flow/creation-successful/creation-successful.tsx Uses getOptedIn to decide whether MetricsOptIn/Out is tracked.
ui/pages/onboarding-flow/create-password/create-password.tsx Migrates iframe injection + routing decisions to canonical analytics selectors/fields.
ui/pages/onboarding-flow/create-password/create-password.test.tsx Updates mocked state to canonical optedIn / completedMetaMetricsOnboarding.
ui/hooks/subscription/useSubscription.ts Replaces getMetaMetricsId usage with getAnalyticsId for support-link attribution.
test/e2e/tests/onboarding/onboarding.spec.ts Updates fixture patch to use completedMetaMetricsOnboarding / optedIn / analyticsId.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/pages/onboarding-flow/welcome/welcome.tsx
@gauthierpetetin gauthierpetetin added this pull request to the merge queue Jun 15, 2026
@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Jun 15, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2026
@gauthierpetetin gauthierpetetin added this pull request to the merge queue Jun 15, 2026
Merged via the queue into main with commit f43aa74 Jun 15, 2026
203 checks passed
@gauthierpetetin gauthierpetetin deleted the refactor/analytics-phase-b-web3auth branch June 15, 2026 18:14
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
@metamaskbot metamaskbot added the release-13.37.0 Issue or pull request that will be included in release 13.37.0 label Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.37.0 Issue or pull request that will be included in release 13.37.0 risk:low size-M team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants