-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat(snap-keyring): more snap account metrics #23113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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. |
8409680 to
74ee095
Compare
3f4499f to
70c85c9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #23113 +/- ##
===========================================
- Coverage 68.70% 68.66% -0.05%
===========================================
Files 1105 1105
Lines 43275 43330 +55
Branches 11570 11581 +11
===========================================
+ Hits 29731 29749 +18
- Misses 13544 13581 +37 ☔ View full report in Codecov by Sentry. |
Builds ready [70c85c9]
Page Load Metrics (1736 ± 45 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
3a2a16a to
b292bef
Compare
Builds ready [b292bef]
Page Load Metrics (1807 ± 50 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
b292bef to
46b6652
Compare
Builds ready [46b6652]
Page Load Metrics (1208 ± 460 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| origin, | ||
|
|
||
| // User should now see the "Successfuly added account" page | ||
| trackSnapAccountEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the reviewers:
I thought of maybe augmenting the showSuccess function (or event deeper, to the component itself) to support those events, like having a:
events: {
onLoad: MetaMetricsEventName.AddSnapAccountSuccessViewed,
onSubmit: MetaMetricsEventName.AddSnapAccountSuccessClicked
},
So that our component would take care "hooking" those actions and fire events automatically. But this requires a bit more effort to implement properly.
I'm also open for suggestion here, since having those metrics in the snap-keyring.ts feels a bit wrong to me.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this idea and I agree that the implementation would scope creep this task a bit. If you strongly feel that it should be done first then I recommend opening a new PR for that change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I'd like to move on with this PR, I'll probably keep it that way for now, and I'll leave a TODO to improve that later on.
46b6652 to
923f5f1
Compare
43ba093 to
401d1bd
Compare
Builds ready [401d1bd]
Page Load Metrics (1188 ± 525 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review notes,
- The event
Account Snap Experimental Toggle Onis missing - The event
Add Snap Account Clickedis not being triggered - The event
Add Snap Account Cancelledis being triggered twice - The event
Remove Snap Account Cancelledis being triggered twice - The event
Snap Account Transaction Finalize Viewedis being triggered twice - Confirm if
Snap Account Transaction Finalize Redirect "Go To Site" Clickedis correct when the user clicks the “Go to site” button. The metrics document says that the event should beSnap Account Transaction Finalize Closed
@ccharly the code LGTM but some events were not 100% correct and others were triggered twice, that could be because of the confirmations screens and may require a separate fix since it occurs to other unrelated confirmations too
| origin, | ||
|
|
||
| // User should now see the "Successfuly added account" page | ||
| trackSnapAccountEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this idea and I agree that the implementation would scope creep this task a bit. If you strongly feel that it should be done first then I recommend opening a new PR for that change
|
It seems like |
The toggle events are showing up for me. |
|
The event |
|
Is this right? |
@gantunesr Yes, it also works for me. Did you went to the experimental tab? Also, I'm using flask "flavored" build, IDK if this is important or no? |
@montelaidev True! Actually I forgot to remove it, I used the same event than other account types |
You're right about this one. Those new events are only linked to specific snap account screens (triggered externally - outside of the extension). I'll double check if we need to hook that "path" too. Thanks! |
7f39894 to
b83cdbc
Compare
Builds ready [b83cdbc]
Page Load Metrics (1328 ± 392 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
gantunesr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Builds ready [27723df]
Page Load Metrics (1461 ± 494 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [1ab98e8]
Page Load Metrics (1081 ± 486 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Requirements:
Add more MetaMetrics events related to snap account interactions (see scenarios below).
Scenarios
Settings:
Account menu:
Snap account creation:
Snap account removal:
Snap account transactions:
Related issues
Fixes: https://github.com/MetaMask/accounts-planning/issues/247
Manual testing steps
Start the
mock-segment.jsserver. If you also wish to see event's content, you can use this branch to run the server first:feature/mock-segment-verbose.Run the server:
Then:
Screenshots/Recordings
snap-account-toggle.mov
add-snap-account-link.mov
create-snap-account-success.mov
create-snap-account-cancel.mov
delete-snap-account-success.mov
delete-snap-account-cancel.mov
transaction-spinner-and-go-to-site.mov
Pre-merge author checklist
Pre-merge reviewer checklist