MetaMask / MetaMask/metamask-mobile
[Analytics] Network prompt events not implemented — 4 events missing from codebase
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
## Description
Four analytics events related to network prompt flows are not implemented anywhere in the codebase — no constant in `MetaMetrics.events.ts` and no `trackEvent` call in any component. All four show 0 counts in Mixpanel QA (project `3354001`, report `Mobile Core UX` #91404720).
**Missing events:**
- `Network Switch Prompt Displayed`
- `Network Switch Prompt Resolved`
- `Add Network Prompt Displayed`
- `Add Network Prompt Resolved`
## Steps to Reproduce
1. Trigger a dapp network switch request (`wallet_switchEthereumChain`).
2. Trigger a dapp add network request (`wallet_addEthereumChain`).
3. Check Mixpanel for any of the four events above.
## Expected Result
Each event fires at the appropriate moment — when the prompt appears and when it is resolved (approved or rejected).
## Actual Result
Zero events recorded for all four. Constants do not exist in `MetaMetrics.events.ts` and no `trackEvent` calls exist anywhere in the repo.
## Fix
1. Add the four constants to `MetaMetrics.events.ts`.
2. Wire `trackEvent` calls into the network switch and add-network approval flows (likely `app/components/Views/NetworkSelector/` and/or `app/components/UI/NetworkModal/`).
## Severity
Medium
---
*Filed via Claude bug reporter*
Contributor guide
Research direction
Start with MetaMetrics.events.ts, then trace the network switch and add-network flows in app/components/Views/NetworkSelector/ and app/components/UI/NetworkModal/. Confirm where each prompt is displayed and resolved, then verify that all four constants and corresponding trackEvent calls are present for approved and rejected outcomes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- analytics, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 56/100