-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat: Adding "cookie id" to metrics event #26697
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. |
0cde2bb
to
09186f5
Compare
Builds ready [09186f5]
Page Load Metrics (1560 ± 42 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #26697 +/- ##
===========================================
- Coverage 70.04% 69.90% -0.13%
===========================================
Files 1435 1439 +4
Lines 49920 50044 +124
Branches 13980 13995 +15
===========================================
+ Hits 34963 34983 +20
- Misses 14957 15061 +104 ☔ View full report in Codecov by Sentry. |
ee1b204
to
df8983a
Compare
Builds ready [df8983a]
Page Load Metrics (1762 ± 102 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [32f8155]
Page Load Metrics (2928 ± 291 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Hey @NiranjanaBinoy I must be missing the implementation of this - we need to modify the body of event sent to segment and add context to it:
Can you show me where is it? thank you ! |
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.
@NiranjanaBinoy Thanks for putting everything together !
Can you add the description in this ticket for manual tests as
- test the track event sending after this has this id
It is also valuable to add a screen recording of if works for
- marketing whitelist site
- site doesn't have this id passing
Thanks a lot !
7e1ce7f
to
978f71b
Compare
Builds ready [978f71b]
Page Load Metrics (1943 ± 107 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.
Generally looks good. I have left some questions and suggestions
@@ -5114,6 +5119,42 @@ export default class MetamaskController extends EventEmitter { | |||
); | |||
} | |||
|
|||
setUpCookieHandlerCommunication({ connectionStream }) { |
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.
We should create a github issue for adding unit tests for this method and for setupPhishingCommunication
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.
done. #27119
@@ -0,0 +1,193 @@ | |||
import browser from 'webextension-polyfill'; |
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.
This file looks good
978f71b
to
0677ee6
Compare
Quality Gate passedIssues Measures |
Builds ready [0677ee6]
Page Load Metrics (1686 ± 66 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
We are saving the cookieId to the state of the MetaMetrics controller as |
LGTM 🔥 |
Missing release label release-12.3.0 on PR. Adding release label release-12.3.0 on PR and removing other release labels(release-12.6.0), as PR was cherry-picked in branch 12.3.0. |
Description
The PR sets up a stream communication with the label 'metamask-cookie-handler'. The data sent from the page will be intercepted at the content-script and forwarded to the extension. The 'ga_client_id' sent from the page is saved as
marketingCampaignCookieId
in the metaMetricsController state and fetched when building the context for each event.Related issues
Part of https://github.com/MetaMask/MetaMask-planning/issues/2916
Manual testing steps
To test the stream, Open https://metamask.io/ , and write a request in dev tools console with the following
window.postMessage
would do. This should update the metametricsController state withmarketingCampaignCookieId
. Logging the payload in_track()
in MetaMetricsController will show that themarketingCampaignCookieId
is added to the context.Test the track event sending after this has this id in its context as
marketingCampaignCookieId
.Screenshots/Recordings
After
Loading a website in the from the white list:
whitelist-website.mov
Initially loading a website not from the whitelist and then loading a website from whitelist to compare the context data:
website_not_in_whitelist.mov
Pre-merge author checklist
Pre-merge reviewer checklist