Commit c291d98
authored
feat: Add MetaMetrics event for "Use different login method" click during social login rehydration (#21903)
## **Description**
This PR adds MetaMetrics tracking for when users click the "Use a
different login method" button during social login rehydration flow
**What is the reason for the change?**
We need to track when users decide to switch login methods during the
rehydration phase
**What is the improvement/solution?**
Added a new MetaMetrics event `UseDifferentLoginMethodClicked` that
fires when:
- User is in social login flow
- Onboarding is not completed (rehydration phase)
- User clicks "Use a different login method" on the welcome back screen
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/SL-241
## **Manual testing steps**
1. Start a social login import flow (Google or Apple)
2. Complete authentication with the provider
3. Navigate to the unlock/rehydration screen
4. Click "Use a different login method" button
5. Verify the `USE_DIFFERENT_LOGIN_METHOD_CLICKED` event is tracked with
`account_type: 'social'`
## **Screenshots/Recordings**
### **Before**
No MetaMetrics event tracked when clicking "Use a different login
method" during rehydration
### **After**
`USE_DIFFERENT_LOGIN_METHOD_CLICKED` event tracked with proper
account_type property
## **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**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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]
> Adds a new MetaMetrics event and triggers it when users in OAuth
rehydration click "Use a different login method".
>
> - **Analytics**
> - Add `USE_DIFFERENT_LOGIN_METHOD_CLICKED` to `EVENT_NAME` and expose
via `MetaMetricsEvents` in `app/core/Analytics/MetaMetrics.events.ts`.
> - **Login**
> - In `app/components/Views/Login/index.tsx`, fire
`MetaMetricsEvents.USE_DIFFERENT_LOGIN_METHOD_CLICKED` with `{
account_type: 'social' }` when `handleUseOtherMethod` is used during
OAuth onboarding rehydration.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9951208. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 42d139d commit c291d98
File tree
2 files changed
+9
-0
lines changed- app
- components/Views/Login
- core/Analytics
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
367 | 372 | | |
368 | 373 | | |
369 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
767 | 768 | | |
768 | 769 | | |
769 | 770 | | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
770 | 774 | | |
771 | 775 | | |
772 | 776 | | |
| |||
0 commit comments