Skip to content

feat: MUSD-454 add quick convert event tracking cp-7.70.0#27305

Merged
Matt561 merged 16 commits into
mainfrom
feat/musd-454-add-segment-events-for-quick-convert-flow
Mar 12, 2026
Merged

feat: MUSD-454 add quick convert event tracking cp-7.70.0#27305
Matt561 merged 16 commits into
mainfrom
feat/musd-454-add-segment-events-for-quick-convert-flow

Conversation

@Matt561

@Matt561 Matt561 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Description

Changes:

  • Adds Segment event tracking for the mUSD Quick Convert flow
  • Enriches generic Transaction* events for musdConversion transactions
    • Adds confirmation_source to differentiate between the "Max" convert bottom sheet and custom amount confirmations
    • Adds is_max which is true when "Max" conversion flow is used or when custom amount is used and user clicks "Max" button in percentage button row
    • Adds mUSD quote tracking data

Events

Event Type Location Description
mUSD Quick Convert Screen Viewed New standalone event MusdQuickConvertView (on mount) Fires when the quick convert token list screen is viewed
mUSD Bonus Terms of Use Pressed New standalone event MusdQuickConvertView (quick_convert_home_screen), EarnMusdConversionEducationView (conversion_education_screen), useMusdConversionNavbar (custom_amount_navbar), PercentageRow (percentage_row) Fires when user presses the bonus terms of use link; location property differentiates the source
mUSD Quick Convert Token Row Button Clicked New standalone event MusdQuickConvertView Fires on "Max" or "Edit" button tap; includes button_action, redirects_to, asset details
confirmation_source New property on Transaction* events useMusdConversionConfirmationMetrics 'quick_convert_max_bottom_sheet_confirmation_screen' or 'custom_amount_screen' — only attached to musdConversion transactions
is_max New property on Transaction* events useMusdConversionConfirmationMetrics Derived from TransactionPayController.isMaxAmount — only attached to musdConversion transactions
Quote tracking data New properties on Transaction* events useMusdConversionConfirmationMetrics Standardized quote/pay data via getMusdConversionQuoteTrackingData — only attached to musdConversion transactions

Changelog

CHANGELOG entry: Added Segment event tracking for mUSD Quick Convert flow and enrich generic Transaction* events for mUSD conversion transactions

Related issues

Fixes: MUSD-454: Add segment events for Quick Convert flow

Manual testing steps

Feature: mUSD Quick Convert Segment event tracking

  Scenario: user views the quick convert screen
    Given user navigates to the mUSD Quick Convert screen

    When the screen mounts
    Then "mUSD Quick Convert Screen Viewed" event fires with location "quick_convert_home_screen"

  Scenario: user taps Max on a token row
    Given user is on the mUSD Quick Convert screen with convertible tokens

    When user taps "Max" on a token row
    Then "mUSD Quick Convert Token Row Button Clicked" event fires with button_action "max" and redirects_to "quick_convert_max_bottom_sheet_confirmation_screen"

  Scenario: user taps Edit on a token row
    Given user is on the mUSD Quick Convert screen with convertible tokens

    When user taps the edit icon on a token row
    Then "mUSD Quick Convert Token Row Button Clicked" event fires with button_action "custom" and redirects_to "custom_amount_screen"

  Scenario: user taps "Terms apply" link on the quick convert screen
    Given user is on a screen displaying the mUSD bonus "Terms apply" link

    When user taps "Terms apply"
    Then "mUSD Bonus Terms of Use Pressed" event fires with the location of the current screen

  Scenario: user confirms a max mUSD conversion
    Given user is on the max convert bottom sheet confirmation

    When user taps "Convert"
    Then "Transaction Approved" event includes confirmation_source "quick_convert_max_bottom_sheet_confirmation_screen", "is_max: true", and quote tracking data

  Scenario: user confirms a custom amount mUSD conversion
    Given user is on the custom amount conversion screen

    When user taps "Convert"
    Then "Transaction Approved" event includes confirmation_source "custom_amount_screen", "is_max: false"

Screenshots/Recordings

Before

After

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.

Note

Medium Risk
Adds new MetaMetrics events and confirmation-metric dispatches across mUSD conversion/confirmation screens; while behavior is mostly observational, it touches confirmations flow and transaction status tracking and could affect analytics payloads or introduce unintended side effects if hooks fire unexpectedly.

Overview
Adds MetaMetrics tracking for the mUSD Quick Convert flow, including MUSD_QUICK_CONVERT_SCREEN_VIEWED, MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED (Max/Edit), and MUSD_BONUS_TERMS_OF_USE_PRESSED with location/context properties.

Introduces a shared analytics utility (getMusdConversionQuoteTrackingData + deepSnakeCaseKeys) and refactors useMusdConversionStatus to use it when emitting MUSD_CONVERSION_STATUS_UPDATED, standardizing quote-derived properties.

Enriches confirmation metrics for musdConversion by adding a new useMusdConversionConfirmationMetrics hook (wired into MusdConversionInfoRoot) that dispatches confirmation_source, is_max, and select quote fields into confirmationMetrics. Tests are updated/added accordingly, and EVENT_LOCATIONS/MetaMetricsEvents are extended to support the new instrumentation.

Written by Cursor Bugbot for commit 6e2e686. This will update automatically on new commits. Configure here.

@Matt561 Matt561 requested review from a team as code owners March 10, 2026 23:11
@Matt561 Matt561 added No QA Needed Apply this label when your PR does not need any QA effort. team-earn labels Mar 10, 2026
@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.

Comment thread app/components/UI/Earn/utils/analytics.types.ts
matthewwalsh0
matthewwalsh0 previously approved these changes Mar 11, 2026
Comment thread app/components/UI/Earn/Views/MusdQuickConvertView/index.tsx Outdated

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@Matt561 Matt561 requested a review from matthewwalsh0 March 11, 2026 16:01
nickewansmith
nickewansmith previously approved these changes Mar 11, 2026
@nickewansmith nickewansmith self-requested a review March 11, 2026 16:56
@Matt561 Matt561 enabled auto-merge March 11, 2026 18:19
@Matt561 Matt561 disabled auto-merge March 11, 2026 18:19
…order to keep typing of DeepSnakeCaseKeys accurate
nickewansmith
nickewansmith previously approved these changes Mar 11, 2026
matthewwalsh0
matthewwalsh0 previously approved these changes Mar 12, 2026
@Matt561 Matt561 requested a review from matthewwalsh0 March 12, 2026 15:02
@Matt561 Matt561 enabled auto-merge March 12, 2026 17:39
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokeTrade
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 75%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes focus on the Earn mUSD conversion feature, including new/updated views, hooks, analytics utilities, and confirmation UI components (musd-conversion-info-root, percentage-row, confirmation metrics hooks). Additionally, app/core/Analytics/MetaMetrics.events.ts (a critical file) was modified, which can affect analytics event definitions used across the app.

Key impact areas:

  1. Confirmation UI Layer (High relevance to SmokeConfirmations):

    • Changes under app/components/Views/confirmations/components/info/ and rows/ directly modify confirmation screen subcomponents.
    • New metrics hooks for mUSD conversion confirmations indicate integration with the confirmation flow.
    • Even if scoped to mUSD, these components live in the shared confirmation system, which is used by send, approve, swap, and contract interactions.
      → SmokeConfirmations is required to validate no regressions in transaction/signature confirmation flows.
  2. Earn feature entry via Trade wallet actions (Relevant to SmokeTrade):

    • Earn is accessed from the TradeWalletActions bottom sheet (same entry surface as Swap, Bridge, Perps, Predictions).
    • UI and analytics changes in Earn views could affect navigation or shared wallet actions infrastructure.
    • While not directly modifying swap logic, SmokeTrade ensures the Trade entry points and related flows remain stable.
      → SmokeTrade selected as a safety net for Trade menu integration.
  3. Analytics (MetaMetrics.events.ts):

    • Changes to event definitions can affect tracking across flows, but are unlikely to break functional behavior.
    • No direct controller, Engine, network, multi-chain, or account architecture changes detected.

No changes were found in Engine, Controllers, network management, account management, multi-SRP, Snaps, Card, Perps, Predictions, Ramps, or MultiChain API layers.

Therefore, targeted validation of confirmation flows and Trade entry points is sufficient without running the entire E2E suite.

Performance Test Selection:
Changes are limited to UI components, hooks, and analytics related to mUSD conversion and confirmation display. There are no modifications to Engine initialization, account lists, token/balance loading, onboarding, swaps performance paths, predictions/perps market loading, or app launch logic. No large list rendering or performance-critical code paths were altered. Therefore, performance tests are not required.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
16 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

@Matt561 Matt561 added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 15edc39 Mar 12, 2026
117 of 122 checks passed
@Matt561 Matt561 deleted the feat/musd-454-add-segment-events-for-quick-convert-flow branch March 12, 2026 19:28
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 12, 2026
@metamaskbot metamaskbot added the release-7.71.0 Issue or pull request that will be included in release 7.71.0 label Mar 12, 2026
@chloeYue chloeYue changed the title feat: MUSD-454 add quick convert event tracking feat: MUSD-454 add quick convert event tracking cp-7.70.0 Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.71.0 Issue or pull request that will be included in release 7.71.0 size-XL team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants