[Website] Track blueprint resource type if the resource doesn't have a theme/plugin slug - #3862
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates blueprint analytics so installPlugin/installTheme events always include a meaningful plugin/theme identifier by falling back to the resource type when no slug is available.
Changes:
- Log
plugin/themeasslug || resourcefor installPlugin/installTheme steps. - Update inline documentation to describe the fallback behavior.
- Add unit tests covering slug-present and slug-missing cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/playground/website/src/lib/tracking.ts | Adds fallback logging of plugin/theme identifier when slug is missing. |
| packages/playground/website/src/lib/tracking.spec.ts | Adds vitest coverage for slug and slugless resource tracking behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (step.step === 'installPlugin') { | ||
| const data = { | ||
| resource: (step as any).pluginData.resource, | ||
| plugin: | ||
| (step as any).pluginData.slug || | ||
| (step as any).pluginData.resource, | ||
| }; |
ashfame
left a comment
There was a problem hiding this comment.
Left a suggestion, rest looks good to go.
| resource: (step as any).pluginData.resource, | ||
| plugin: | ||
| (step as any).pluginData.slug || | ||
| (step as any).pluginData.resource, |
There was a problem hiding this comment.
Adding a prefix before logging resource type might be useful. resource:url and resource:git:directory. Otherwise, url just shows up as is, without any clue that it's not a plugin slug.
Motivation for the change, related issues
Blueprint analytics previously omitted the plugin/theme value when installPlugin/installTheme used a resource without a slug.
Implementation details
This records the resource type as the plugin/theme value when no slug is present, while preserving slug reporting for WordPress.org resources.
Testing Instructions (or ideally a Blueprint)