metamask-mobile
metamask-mobile copied to clipboard
feat: ramp analytics segment migration
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
- On wallet touch "Buy ETH" button
- Wait for the onramp screen to complete (select region if needed)
- touch "cancel" on top right
- 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"} - check the segment source debugger and you must see the following
Screenshots/Recordings
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.
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.
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
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.
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
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
Quality Gate passed
Issues
0 New issues
Measures
0 Security Hotspots
50.0% Coverage on New Code
0.0% Duplication on New Code