Commit 54b58db
authored
feat: Add MetaMetrics event for "Use different login method" click during social login rehydration (#37349)
## **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
[](https://codespaces.new/MetaMask/metamask-extension/pull/37349?quickstart=1)
## **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 (welcome back screen)
4. Click "Use a different login method" button
5. Verify the `UseDifferentLoginMethodClicked` event is tracked with
`account_type: 'social'`
## **Screenshots/Recordings**
### **Before**
No MetaMetrics event tracked when clicking "Use a different login
method" during rehydration
### **After**
`UseDifferentLoginMethodClicked` 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
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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-extension/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 tracking on the unlock page for
clicks to use a different login method during social login rehydration.
>
> - **Analytics (MetaMetrics)**:
> - Add `UseDifferentLoginMethodClicked` to `MetaMetricsEventName` in
`shared/constants/metametrics.ts`.
> - **UI**:
> - Track `UseDifferentLoginMethodClicked` in
`ui/pages/unlock-page/unlock-page.component.js` when in social login
rehydration (onboarding not completed) before redirecting to
`onboarding_welcome`, with `properties.account_type = 'social'`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
96edf3a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent f3f9bcf commit 54b58db
2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| 845 | + | |
845 | 846 | | |
846 | 847 | | |
847 | 848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
394 | 403 | | |
395 | 404 | | |
396 | 405 | | |
| |||
0 commit comments