plugin-analytics-instrumentation

Instrument Backstage plugins with analytics events using React hooks.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/olafkfreund/backstage --skill plugin-analytics-instrumentation-olafkfreund
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plugin-analytics-instrumentation
Source: https://github.com/olafkfreund/backstage/tree/main/.agents/skills/plugin-analytics-instrumentation
Command: npx skills add https://github.com/olafkfreund/backstage --skill plugin-analytics-instrumentation-olafkfreund

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers instrument their Backstage frontend plugins with analytics events, enabling them to measure plugin usage and user interactions.

Core Features & Use Cases

  • Analytics Instrumentation: Add analytics events to plugin components for tracking user interactions.
  • Event Capture: Utilize captureEvent and AnalyticsContext for defining and capturing events.
  • Best Practices: Follow guidelines for event naming, action, subject, and attribute usage.
  • Testing: Write unit tests for event capture using mockApis.analytics().

Quick Start

Use the plugin-analytics-instrumentation skill to add analytics events to your plugin component, for example: captureEvent('click', 'button clicked').

Frequently Asked Questions about plugin-analytics-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add analytics event tracking to a Backstage plugin?

To add analytics event tracking to a Backstage plugin, use `captureEvent` to log user interactions and `AnalyticsContext` to define event metadata. This Skill guides instrumentation for components using React hooks and the Backstage Analytics API.

What is the best way to capture user interactions in Backstage frontend plugins?

The best way to capture user interactions in Backstage frontend plugins is by instrumenting components with `captureEvent` and `AnalyticsContext`. Follow event naming best practices for action, subject, and attributes to measure plugin usage effectively.

Do I need to know React hooks to instrument analytics events in Backstage?

Yes, you need knowledge of React hooks and the Backstage Analytics API to instrument analytics events. This Skill requires understanding these concepts to properly integrate `captureEvent` and `AnalyticsContext` within your plugin components.

Can I write unit tests for analytics event capture in Backstage?

Yes, you can write unit tests for analytics event capture in Backstage using `mockApis.analytics()`. This allows you to verify that your plugin components correctly emit `captureEvent` calls and interact properly with `AnalyticsContext`.

What are the guidelines for event naming in Backstage plugin analytics?

Guidelines for event naming in Backstage plugin analytics involve properly defining the action, subject, and attributes within `captureEvent` and `AnalyticsContext`. Following these best practices ensures consistent measurement of user interactions across plugin components.