-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Move "tracks" analytics into a shared calypso-analytics package #39001
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~9 bytes removed 📉 [gzipped])
Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. App Entrypoints (~38560 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~191446 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~98107 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
dc3266a
to
e01e6f7
Compare
aa31733
to
2448b0e
Compare
rebased |
tracksDebug( 'Recording event "%s" with actual props %o', eventName, eventProperties ); | ||
analyticsEvents.once( 'record-event', ( _eventName, _eventProperties ) => { | ||
analytics.emit( 'record-event', _eventName, _eventProperties ); | ||
} ); |
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.
The record-event
event has only one usage: reporting the last tracks event as part of debug info when the JS app crashes.
That could be replaced with a getLastTracksEvent()
function that's part of the tracks API.
And maybe it could be removed altogether -- I'm not sure if we use that info for anything and I don't see why it would be interesting when debugging JS crashes.
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.
Hmm I'd rather not take this out in this PR, so the PR can stay pure refactoring.
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 did investigate it and I believe adding the getLastTracksEvent
would work but I saw it was possible that other events are added also using the recordEvent
name so the behavior might change slightly.. It probably wouldn't be an issue to anyone but I don't want to take on the burden of testign it etc.
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.
Alright, let's address the suggestion in another PR 👍
55aa236
to
ad5a978
Compare
ad5a978
to
74618ce
Compare
Was this a wonky rebase? That commit list looks humungous! :) |
This reverts commit b6c1c71a02caa1e7f39a2bbc0247863570db22b5.
a7e4474
to
a452f92
Compare
In relation to this commit: 3f7a7d0 You can trigger the tests by removing the "Needs review" label and re-adding it 👍 |
Since #39001, the suffix for Tracks was changed from ":tracks" to "" (empty string). This commit updates the README to reflect this.
Since #39001, the suffix for Tracks was changed from ":tracks" to "" (empty string). This commit updates the README to reflect this.
Changes proposed in this Pull Request
tracks
analytics into a shared packageautomattic/calypso-analytics
.lib/analytics
, leave GA and refer tracking there for nowlib/analytics
code to use the newautomattic/calypso-analytics
packageTesting instructions
npm start
)stats.wp.com
with ublock)analytics.recordEvent
are still notifiedFixes #38799