-
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
Editor Stats - track core global styles updates & saves #53801
Editor Stats - track core global styles updates & saves #53801
Conversation
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-9030 |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for wpcom-block-editor To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-l4k-p2 |
e5923db
to
1539fd1
Compare
So far looking good! I was happy to see you moved on to a deep diff algorithm rather than typing out all the cases 😄 I think we should hook this up to |
Updated, this should be working for both update and save events for global styles. 😅 |
This PR modifies the release build for notifications To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-elI-p2 |
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.
Tests for both update and save events are now in place.
test/e2e/specs/specs-wpcom/wp-calypso-gutenberg-site-editor-tracking-spec.js
Outdated
Show resolved
Hide resolved
test/e2e/specs/specs-wpcom/wp-calypso-gutenberg-site-editor-tracking-spec.js
Outdated
Show resolved
Hide resolved
test/e2e/specs/specs-wpcom/wp-calypso-gutenberg-site-editor-tracking-spec.js
Outdated
Show resolved
Hide resolved
test/e2e/specs/specs-wpcom/wp-calypso-gutenberg-site-editor-tracking-spec.js
Outdated
Show resolved
Hide resolved
…acking-spec.js Co-authored-by: Bart Kalisz <[email protected]>
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.
Looks good from the E2E perspective! 🚀
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 is a huge PR 😄 E2E test files' lines are growing fast.
Works as expected ✅ Thanks for working on this!
Changes proposed in this Pull Request
Adds tracking for global styles update and save events (
wpcom_block_editor_global_styles_update
andwpcom_block_editor_global_styles_save
). Unfortunately, core Global Styles seems to update throughuseEntityProp
(which in turn usesupdateEntityRecord
), which requires passing the entire content object of Global Styles and not only the items that have changed. This means if we want to track individual changes we need to compare the updated content object to the original content object.Here we attempt to dissect the changes made to
wp_global_styles
and map them into events with the following properties:block_type
- the block name if the change is to an individual block style or setting.section
- the type of style being updated (color, typography, etc.)field
- the property being changed (text, background, fontSize, fontFamily, etc.)field_value
- the value of the property being changed. This is currently populated asreset
if the field is removed. (is this better than just not having a field value in this case?)element_type
- The element type the setting corresponds to. Currently I only see this aslink
, but given the structure of the content object I think its important we leave this property as case other items are added in this way (span, etc?).palette_slug
- Slug of the color palette value that was updated.Some examples of how these event properties populate in GS update events (note any global properties such as blog_id, editor_type, etc. are also included):
{ section: "color", field: "text", field_value: "var:preset|color|green" }
{ section: "color", field: "background", field_value: "var:preset|color|green" }
{ section: "typography", field: "fontSize", field_value: "20px" }
{ section: "typography", field: "fontSize", field_value: "reset" }
{ element_type: "link", section: "color", field: "text", field_value: "var:preset|color|green" }
{ section: "color", field: "palette", field_value: "#3ec71a", palette_slug: "green"}
Performing any of these actions at the individual block level will also add the
block_type
property (exblock_type: "core/buttons"
)Testing instructions
wpcom_block_editor_global_styles_update
tracks events follow the format noted above.wpcom_block_editor_global_styles_save
tracks events follow the format above.Related to #53410