-
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
Block Editor Tracking: Add pattern_category property to wpcom_pattern_inserted event #53492
Block Editor Tracking: Add pattern_category property to wpcom_pattern_inserted event #53492
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-9134 |
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. |
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.
These questions are mainly for @ianstewart and @kurt213 regarding how we would want this to work.
Open Post Editor, and insert a pattern from the inserter sidebar. Make sure wpcom_pattern_inserted is fired and includes a pattern_category which is equal to the selected pattern category.
A pattern may have multiple categories, so I think either we need to:
- track whichever category is selected (as is done here)
OR - track the list of categories the pattern corresponds to?
However, when we select from the quick inserter where there are no categories to select.
Now insert a pattern from the quick inserter. Make sure wpcom_pattern_inserted is fired and includes a pattern_category which is equal to the first category of the pattern.
I would think instead of this we should either:
- Populate the field as
undefined
since no category can be selected. (If we are going with the first option above)
OR - once again track the list of categories the pattern corresponds to?
3e2a426
to
8ae94da
Compare
This seems like it would be useful. cc @kurt213 |
@david-szabo97 I think we can move ahead with the approaches confirmed by @ianstewart:
|
This sounds great and this logic makes the most sense to me for understanding a user's 'intent'. |
a07aea5
to
45ce8e9
Compare
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 |
45ce8e9
to
944ade1
Compare
Im not seeing this at all. In both post editor and site editor inserting a pattern from the quick inserter doesn't seem to track any pattern_inserted event (on this PR or on trunk). Maybe I am missing something? 🤔 |
🤔 Looks like quick inserter isn't using an object as metadata: Look how the pattern name is just a string in the array. Whereas inserting patterns from the inserter sidebar: Is using an object with a patternName property, and this is what we use. |
Quick Inserter's source code: which leads to Compared to the block inserter sidebar: This looks like something we should fix in Gutenberg too. These shouldn't differ in my opinion. Although we still need to support this implementation in the tracking code. I'll come up with something. |
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 |
Maybe this is part of the issue I was noticing before - but Im running into another oddity 😅 . It seems that whether we are using the sidebar or the quick inserter, it may fire In the case of inserting patterns via the sidebar, it seems we are getting the However, with the quick inserter it seems that we are only getting the |
Ughhh! The pattern name is on a different index so the Replaced with a more robust logic. |
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.
This is all working as expected now 😁
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.
Just one comment!
Co-authored-by: Bart Kalisz <[email protected]>
51fd119
to
35c6101
Compare
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, thanks! 🚀
Changes proposed in this Pull Request
pattern_category
property towpcom_pattern_inserted
eventTesting instructions
wpcom_pattern_inserted
is fired and includes apattern_category
which is equal to the selected pattern category.wpcom_pattern_inserted
is fired and andpattern_category
doesn't exist..Related to #53410