Tracks: preview site events (STU-2119) - #4482
Open
wojtekn wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 06737ca vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
Claude Code explored the existing Tracks patterns (the sibling STU-2115/STU-2116 work), drafted and verified the plan, and implemented the events, tests, and docs. I reviewed the emitter loci, the CLI-vs-renderer split, and the delete-all decision, and verified the emit paths myself (unit tests + a CLI smoke test confirming channel attribution).
Proposed Changes
Preview-site sharing (WordPress.com hosted previews) had no analytics, so we couldn't tell how many users share their work via preview links, or how reliable create/update is in the field. This adds Tracks events across the preview-site lifecycle:
studio_preview_site_create/studio_preview_site_update— withsuccess,failure_reason, andtime_ms, so we get both adoption and a success/latency funnel.studio_preview_site_delete— a single preview deleted.studio_preview_site_delete_all— the "delete all" action, carrying acountof previews removed.studio_preview_site_open— a user opening a preview URL to visit it.Create/update/delete/delete-all all fire from the CLI, which is the sole funnel: the desktop Previews tab delegates every one of these actions to the app-spawned CLI, so each action is counted exactly once whether it originated in the UI or standalone, and is attributed to the right surface via
channel/ui_version.openhas no CLI equivalent and fires from the renderer. No PII is ever sent — no site names, paths, or URLs;failure_reasonis a coarse, low-cardinality bucket and the raw error is never included.Testing Instructions
npm startWould have recorded Tracks event: studio_preview_site_*withchannel: studio-uiand the correctui_version, and that each action logs exactly once.studio_preview_site_openlogs.studio preview create/update/delete [--all]log the same events withchannel: studio-cli.Follow-up (issue DoD, not code)
Each event and all its eventprops (including the wrapper-attached common props) still need registering via the Tracks Registration tool — documentation/CI integrity, separate from ingestion.
Pre-merge Checklist