refactor(analytics): C3-d migrate Bridge hook analytics from useMetrics to useAnalytics#27985
Conversation
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The hook is used in the Bridge navigation flow (navigating to the MetaMask Portfolio Bridge webpage). The functional behavior (URL construction, browser tab navigation, chain ID handling) is completely unchanged. Only the analytics tracking mechanism is updated. Grep confirmed this hook is only referenced in its own file and a unit test file - no broad component usage. SmokeTrade is selected because it covers cross-chain bridging flows. SmokeConfirmations is included as required by SmokeTrade's tag description (bridge flows require transaction confirmations). No performance tests are needed as this is a pure analytics hook change with no impact on rendering, data loading, or app startup performance. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
Replaces the deprecated
useMetricshook with the newuseAnalyticshook inuseGoToPortfolioBridge.ts.This is part of the broader C3 analytics migration (#26686) that standardises all analytics calls across the mobile app to use the new
useAnalyticsabstraction instead ofuseMetrics. The hook interface is identical (trackEvent,createEventBuilder), so no behaviour changes.Changelog
CHANGELOG entry: null
Related issues
Refs: #26814
Manual testing steps
N/A
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: swaps analytics hook wiring and adds legacy
action/nameproperties to the emitted event, without changing navigation or URL-building logic.Overview
Updates
useGoToPortfolioBridgeto use the newuseAnalyticshook instead of deprecateduseMetricsforBRIDGE_LINK_CLICKEDtracking.Also explicitly adds legacy
actionandnameproperties to the tracked event payload to preserve existing analytics fields during the migration.Written by Cursor Bugbot for commit 4b45bf0. This will update automatically on new commits. Configure here.