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

feat: ramp analytics segment migration

Open NicolasMassart opened this issue 1 year ago • 4 comments
trafficstars

Description

Use the new Segment metametrics hook in the ramp specific analytics hook

  • update the hook
  • remove anonymous tracking logic as it's handled on the useMetrics hook
  • update types to be compatible with Segment's JsonMap

Related issues

Fixes #8455

Manual testing steps

  1. On wallet touch "Buy ETH" button
  2. Wait for the onramp screen to complete (select region if needed)
  3. touch "cancel" on top right
  4. check the logs (fi in dev mode) you must see: TRACK event saved {"event": "On-ramp Canceled", "properties": {"chain_id_destination": "1", "location": "Amount to Buy Screen"}, "type": "track"}
  5. check the segment source debugger and you must see the following image

Screenshots/Recordings

screenshot

Before

NA

After

NA

Pre-merge author checklist

  • [x] I’ve followed MetaMask Coding Standards.
  • [x] I've clearly explained what problem this PR is solving and how it is solved.
  • [x] I've linked related issues
  • [x] I've included manual testing steps
  • [x] I've included screenshots/recordings if applicable
  • [x] I’ve included tests if applicable
  • [x] I’ve documented my code using JSDoc format if applicable
  • [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • [x] I’ve properly set the pull request status:
    • [ ] In case it's not yet "ready for review", I've set it to "draft".
    • [x] In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

NicolasMassart avatar Feb 22 '24 11:02 NicolasMassart

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 Feb 22 '24 11:02 github-actions[bot]

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6bd0cc2d-fb34-494b-97ee-0f281dc7be31 You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

github-actions[bot] avatar Feb 22 '24 11:02 github-actions[bot]

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 41.53%. Comparing base (291bc71) to head (c94f040).

Files Patch % Lines
app/components/UI/Ramp/hooks/useAnalytics.ts 50.00% 2 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8670   +/-   ##
=======================================
  Coverage   41.53%   41.53%           
=======================================
  Files        1260     1260           
  Lines       30615    30614    -1     
  Branches     3005     3005           
=======================================
  Hits        12716    12716           
+ Misses      17145    17144    -1     
  Partials      754      754           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 22 '24 11:02 codecov-commenter

Looks like both unit and e2e test is failing. Is the E2E failure related to your changes?

I don't think it's related at all

NicolasMassart avatar Feb 23 '24 11:02 NicolasMassart

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1cbae046-3608-4162-8404-444f9d66dacc You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

github-actions[bot] avatar Feb 23 '24 11:02 github-actions[bot]