Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure marketing consent is explicitly tracked as boolean (MetaM…
…ask#12926) <!-- 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** <!-- 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? --> Currently, when users decline marketing consent during onboarding, the `has_marketing_consent` property is not being set at all in the analytics. This creates inconsistent data where we can't properly track users who explicitly opted out of marketing. This PR modifies the OptinMetrics component to explicitly set `has_marketing_consent` to either `true` or `false` based on the user's choice, ensuring we have complete analytics data for all user decisions regarding marketing consent. ## **Related issues** Fixes: MetaMask/mobile-planning#2086 ## **Manual testing steps** 1. Fresh install the app 2. Go through onboarding until you reach the "Help us improve MetaMask" screen 3. Test both scenarios: - Accept metrics but decline marketing consent checkbox - Accept both metrics and marketing consent 4. Verify in analytics that `has_marketing_consent` is properly set to `false` in first case and `true` in second case ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** Analytics data missing `has_marketing_consent` property when user declines marketing consent ### **After** Analytics data showing explicit `has_marketing_consent: false` when user declines marketing consent ## **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.
- Loading branch information