You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 -->
0 commit comments