Skip to content

fix(onboarding): migrate interest questionnaire to generic Onboarding Question events#30890

Merged
wachunei merged 12 commits into
mainfrom
feat/TMCU-792-onboarding-interest-generic-events
Jun 3, 2026
Merged

fix(onboarding): migrate interest questionnaire to generic Onboarding Question events#30890
wachunei merged 12 commits into
mainfrom
feat/TMCU-792-onboarding-interest-generic-events

Conversation

@wachunei

@wachunei wachunei commented Jun 1, 2026

Copy link
Copy Markdown
Member

Description

Migrates the onboarding interest questionnaire from legacy Onboarding Interest Question Viewed/Submitted events to the shared Onboarding Question Viewed/Submitted MetaMetrics events with question_type: 'interest', completing mobile consolidation per segment-schema #590.

  • OnboardingInterestQuestionnaire fires ONBOARDING_QUESTION_VIEWED / ONBOARDING_QUESTION_SUBMITTED with question_type: 'interest'.
  • Submitted payload is unchanged aside from the discriminator: selected_interests, item_count, skipped, and optional account_type (no name).
  • Removed unused ONBOARDING_INTEREST_QUESTION_* constants from MetaMetrics.events.ts.

Analytics note: Segment event names change for the interest step; property shapes are the same plus question_type. Dashboards keyed on Onboarding Interest Question * should filter on question_type: interest instead.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-792

Related: https://github.com/Consensys/segment-schema/pull/590

Manual testing steps

Feature: Onboarding interest questionnaire generic analytics (TMCU-792)

  Scenario: user views the interest questionnaire
    Given the user is eligible for the onboarding interest questionnaire
    And the user has opted in to basic usage data on OptinMetrics

    When the interest questionnaire screen is shown
    Then analytics records Onboarding Question Viewed with question_type "interest"
    And account_type is included only when supplied by the route

  Scenario: user submits interests or skips
    Given the user is on the interest questionnaire

    When the user selects one or more interests and taps Continue
    Then analytics records Onboarding Question Submitted with question_type "interest"
    And selected_interests, item_count, and skipped false are included

    When the user taps Continue without selecting any interests
    Then analytics records Onboarding Question Submitted with question_type "interest"
    And selected_interests is empty, item_count is 0, and skipped is true

Unit tests:

  • yarn run jest app/components/Views/OnboardingInterestQuestionnaire/OnboardingInterestQuestionnaire.test.tsx (19 passed)

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Low Risk
Analytics-only rename and property discriminator; no UI or wallet logic changes. Main risk is downstream dashboards keyed on legacy event names until updated.

Overview
The onboarding interest questionnaire now emits shared Onboarding Question Viewed / Onboarding Question Submitted MetaMetrics events instead of the legacy Onboarding Interest Question * names. Both events include question_type: 'interest'; submitted payloads still send selected_interests, item_count, skipped, and optional account_type.

MetaMetrics.events.ts drops the unused ONBOARDING_INTEREST_QUESTION_* enum entries and generateOpt mappings. Unit tests assert the new event names and question_type on view and submit paths.

Analytics impact: Segment event names change for this step; reporting should filter Onboarding Question * with question_type: interest rather than the old interest-specific event names.

Reviewed by Cursor Bugbot for commit bb57eed. Bugbot is set up for automated code reviews on this repo. Configure here.

wachunei added 6 commits May 28, 2026 15:08
Add single-select crypto experience step after the interest questionnaire,
with analytics events and navigation wiring through to onComplete.
Align TMCU-834 Segment payload: rename experience_level to name (null when skipped).
Add a page object for the onboarding crypto experience screen and tap
Continue after the interest questionnaire in CreateNewWallet and import
wallet flows so analytics smoke tests reach onboarding success.
…perience

Align with segment-schema #590: fire Onboarding Question Viewed/Submitted
with question_type crypto_experience instead of crypto-specific event names.
@github-actions github-actions Bot added the size-S label Jun 1, 2026
@wachunei wachunei added the team-mobile-ux Mobile UX team label Jun 1, 2026

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

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit f4c26bd. Configure here.

vinnyhoward
vinnyhoward previously approved these changes Jun 1, 2026
wachunei added 4 commits June 1, 2026 16:18
Replace Pressable with TouchableOpacity and activeOpacity={0.7} to match
onboarding touch target conventions.
…step

Migrate interest questionnaire from Onboarding Interest Question Viewed/Submitted
to Onboarding Question Viewed/Submitted with question_type interest, aligned
with segment-schema #590 and crypto experience instrumentation on #30767.
Use exact match so the test fails if account_type is erroneously included.
@wachunei wachunei force-pushed the feat/TMCU-792-onboarding-interest-generic-events branch from 2e659a2 to 99574f2 Compare June 2, 2026 13:03
Base automatically changed from feat/TMCU-833-onboarding-crypto-experience to main June 3, 2026 19:21
@wachunei wachunei dismissed vinnyhoward’s stale review June 3, 2026 19:21

The base branch was changed.

@wachunei wachunei requested review from a team as code owners June 3, 2026 19:21
sleepytanya
sleepytanya previously approved these changes Jun 3, 2026
vinnyhoward
vinnyhoward previously approved these changes Jun 3, 2026
Merge with main left duplicate enum entries and object keys in
MetaMetrics.events.ts, causing lint:tsc failures.
@wachunei wachunei dismissed stale reviews from vinnyhoward and sleepytanya via bb57eed June 3, 2026 19:46
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are limited to analytics event renaming in the OnboardingInterestQuestionnaire component:

  1. MetaMetrics.events.ts: Removed ONBOARDING_INTEREST_QUESTION_VIEWED and ONBOARDING_INTEREST_QUESTION_SUBMITTED event names, replacing them with the already-existing generic ONBOARDING_QUESTION_VIEWED and ONBOARDING_QUESTION_SUBMITTED events. Confirmed via grep that the removed event names have zero other usages in the codebase.

  2. OnboardingInterestQuestionnaire.tsx: Updated to use the new generic event names and added question_type: 'interest' as a discriminating property. No functional/UI changes.

  3. OnboardingInterestQuestionnaire.test.tsx: Unit test updates to match the new event names and properties.

Why SmokeWalletPlatform: The SmokeWalletPlatform tag covers wallet lifecycle analytics tracking for new wallet creation and SRP import events. The OnboardingInterestQuestionnaire is part of the onboarding flow (used in wallet creation, SRP import flows per wallet.flow.ts). Running this tag validates that the analytics rename doesn't break the onboarding flow and that the questionnaire still functions correctly.

Why not broader tags: The changes are purely analytics-related (event name renaming + adding a property). No UI, navigation, controller, or functional logic was modified. The questionnaire component behavior is unchanged. No E2E tests validate specific analytics event names/properties directly — they only interact with the UI.

Performance tests: Not needed — no rendering, state management, data loading, or performance-sensitive code was changed.

Performance Test Selection:
No performance-sensitive code was changed. The modifications are purely analytics event renaming (changing event name strings and adding a property). No UI rendering, state management, data loading, or app initialization code was affected.

View GitHub Actions results

@wachunei wachunei enabled auto-merge June 3, 2026 19:48
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jun 3, 2026
@wachunei wachunei added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 61cbb8e Jun 3, 2026
264 of 268 checks passed
@wachunei wachunei deleted the feat/TMCU-792-onboarding-interest-generic-events branch June 3, 2026 22:56
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.81.0 Issue or pull request that will be included in release 7.81.0 risk:low AI analysis: low risk size-S team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants