metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat: adds "data collection for marketing" toggles

Open jonybur opened this issue 9 months ago • 4 comments

Adds data collection for marketing toggles (and toasts/warnings) on:

  • Onboarding
  • Toast in Wallet
  • Settings page

Description

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2437 https://github.com/MetaMask/MetaMask-planning/issues/2438 https://github.com/MetaMask/MetaMask-planning/issues/2526

Manual testing steps

Onboarding checkbox: Make the metametrics.js to return renderOnboarding instead of renderLegacyOnboarding

  1. Start a new account
  2. There should be a new checkbox that asks for marketing consent
  3. Checking it should set the marketing consent to true (check at Settings, Securty tab page)

Security tab:

  1. Go to Security tab
  2. When checking the "Data collection for marketing" to true, the "Participate in MetaMetrics" toggle should turn to true
  3. When checking "Participate in MetaMetrics" to false, "Data collection for marketing" should be set to false
  4. When "Participate in Metametrics" is true and "Data collection for marketing" is true, and the latter is set to false, a warning message should appear.

Toast: An already onboarded user will have the "dataCollectionForMarketing" value as null (neither true or false). This will trigger the toast.

  1. By clicking on "I accept", it should set the "Data collection for marketing" to true.
  2. By closing the toast or clicking on "No thanks", it should set the "Data collection for marketing" to false.

All of these actions should trigger subsequent Segment events.

Screenshots/Recordings

Before

After

Screenshot 2024-05-20 at 14 19 53

https://github.com/MetaMask/metamask-extension/assets/11148144/5eb59902-768d-4d07-a112-5aeb5471587d

Pre-merge author checklist

  • [ ] I’ve followed MetaMask Coding Standards.
  • [ ] I've completed the PR template to the best of my ability
  • [ ] I’ve included tests if applicable
  • [ ] I’ve documented my code using JSDoc format if applicable
  • [ ] I’ve applied the right labels on the PR (see labeling guidelines). 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.

jonybur avatar May 20 '24 09:05 jonybur

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

github-actions[bot] avatar May 20 '24 09:05 github-actions[bot]

@NidhiKJha you will need to render the new onboarding screen, right now it's hidden through the privacy policy date. Just make the metametrics.js to return renderOnboarding instead of renderLegacyOnboarding

jonybur avatar May 21 '24 16:05 jonybur

@NidhiKJha you will need to render the new onboarding screen, right now it's hidden through the privacy policy date. Just make the metametrics.js to return renderOnboarding instead of renderLegacyOnboarding

Yup! That resolves this. It wasn't previously mentioned in the steps. But looks good now

NidhiKJha avatar May 21 '24 16:05 NidhiKJha

Toast: An already onboarded user will have the "dataCollectionForMarketing" value as null (neither true or false). This will trigger the toast. By clicking on "I accept", it should set the "Data collection for marketing" to true. By closing the toast or clicking on "No thanks", it should set the "Data collection for marketing" to false.

Do we have tests for these two? (Alternatively/complimentary: Instead of testing if preference is set, verify if metric is sent or not in either case)

legobeat avatar May 21 '24 23:05 legobeat