Commit d472971
chore(runway): cherry-pick fix: cp-7.59.0 metaMetrics not tracking events for social login users (#22359)
- fix: metaMetrics not tracking events for social login users (#22259)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Bugfix: metaMetrics not tracking events for social login users
Fix: #22296
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Bugfix: metaMetrics not tracking events for social
login users
## **Related issues**
Fixes: metaMetrics not tracking events for social login
users(#22296)
## **Manual testing steps**
```gherkin
Feature: track events for social login
Scenario: New Google login wallet setup track "Wallet Setup Started" event
Given app is a clean install
And user is on the onboarding screen
And user presses "Continue with Google/Apple"
When user complete onboarding
Then "Wallet Setup Started" event appears in Segment for this user
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
N/A
### **After**
<img width="1296" height="821" alt="Screenshot 2025-11-07 at 1 18 15 PM"
src="https://github.com/user-attachments/assets/1460f986-e010-43b7-aee8-fcc8e0d6fc1d"
/>
<img width="1204" height="183" alt="Screenshot 2025-11-07 at 1 18 40 PM"
src="https://github.com/user-attachments/assets/750ada94-ce19-474b-b8b3-40453f6ecea0"
/>
## **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**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] 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]
> Use `isEnabled()` (includes social-login opt-in) instead of `enabled`
to gate `addTraitsToUser`, `group`, and `trackEvent`.
>
> - **Analytics**:
> - **`app/core/Analytics/MetaMetrics.ts`**:
> - Replace direct `enabled` checks with `isEnabled()` in
`addTraitsToUser`, `group`, and `trackEvent` to ensure events flow when
social-login metrics are enabled.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8057117. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[bec56bc](bec56bc)
Co-authored-by: Gaurav Goel <grvgoel19@gmail.com>
Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>1 parent fe42bad commit d472971
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
| 698 | + | |
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
711 | | - | |
| 711 | + | |
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
| 762 | + | |
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| |||
0 commit comments