chore(runway): cherry-pick feat: MUSD-454 add quick convert event tracking cp-7.70.0#27455
Merged
Merged
Conversation
…cking (#27305) <!-- 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** ### 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 | <!-- 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? --> ## **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 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](https://consensyssoftware.atlassian.net/browse/MUSD-454) ## **Manual testing steps** ```gherkin 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** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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** > 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. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e2e686. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.70.0) All E2E tests pre-selected. |
Matt561
approved these changes
Mar 12, 2026
chloeYue
approved these changes
Mar 12, 2026
|
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Changes:
Transaction*events formusdConversiontransactions
confirmation_sourceto differentiate between the "Max" convertbottom sheet and custom amount confirmations
is_maxwhich istruewhen "Max" conversion flow is used orwhen custom amount is used and user clicks "Max" button in percentage
button row
Events
mUSD Quick Convert Screen ViewedMusdQuickConvertView(on mount)mUSD Bonus Terms of Use PressedMusdQuickConvertView(quick_convert_home_screen),EarnMusdConversionEducationView(conversion_education_screen),useMusdConversionNavbar(custom_amount_navbar),PercentageRowpercentage_row)locationproperty differentiates the sourcemUSD Quick Convert Token Row Button ClickedMusdQuickConvertViewbutton_action,redirects_to, asset detailsconfirmation_sourceTransaction*eventsuseMusdConversionConfirmationMetrics'quick_convert_max_bottom_sheet_confirmation_screen'or'custom_amount_screen'— only attached tomusdConversionis_maxTransaction*eventsuseMusdConversionConfirmationMetricsTransactionPayController.isMaxAmount— only attached tomusdConversiontransactionsTransaction*eventsuseMusdConversionConfirmationMetricsgetMusdConversionQuoteTrackingData— only attached tomusdConversionChangelog
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
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
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), andMUSD_BONUS_TERMS_OF_USE_PRESSEDwith location/context properties.Introduces a shared analytics utility
(
getMusdConversionQuoteTrackingData+deepSnakeCaseKeys) andrefactors
useMusdConversionStatusto use it when emittingMUSD_CONVERSION_STATUS_UPDATED, standardizing quote-derivedproperties.
Enriches confirmation metrics for
musdConversionby adding a newuseMusdConversionConfirmationMetricshook (wired intoMusdConversionInfoRoot) that dispatchesconfirmation_source,is_max, and select quote fields intoconfirmationMetrics. Tests areupdated/added accordingly, and
EVENT_LOCATIONS/MetaMetricsEventsareextended to support the new instrumentation.
Written by Cursor
Bugbot for commit
6e2e686. This will update automatically
on new commits. Configure
here.