Backstage plugin analytics instrumentation
Capture semantic plugin-owned outcomes and user intent, not every interaction or component lifecycle event.
When to invoke
- "Add analytics events to this Backstage plugin."
- "Review captureEvent usage."
- "Test AnalyticsContext behavior."
- "Avoid duplicate events from Backstage UI components."
Procedure
- Confirm frontend mode, installed Analytics API and BUI versions, and the questions the events must answer.
- Read the pinned upstream procedure.
- Inventory existing analytics context, built-in BUI events, manual events, and tests.
- Define stable action, subject, and context fields for semantic plugin-owned behavior.
- Prefer BUI components' built-in navigation instrumentation.
- Use
noTrackonly when replacing a built-in event with a more meaningful event. - Avoid lifecycle, hover, generic tab, duplicate click, and field-by-field form noise.
- Add tests for event presence, payload, context, and non-duplication.
- Validate that event values contain no secrets, tokens, or sensitive user data.
Output template
## Plugin analytics result
| User intent | Action | Subject | Context | Test |
| --- | --- | --- | --- | --- |
### Removed or avoided events
- <event and reason>
Quality gate
- Every event answers a named product or operational question.
- BUI built-in events are reused rather than duplicated.
- Action, subject, and context remain independently queryable.
- Event payloads contain no secrets or sensitive user data.
- Tests cover event capture and non-capture cases.
- Lifecycle and low-value UI noise are not instrumented.