Analytics
Use this skill for product event tracking.
When to use
- Adding or migrating event tracking in UI or non-UI code
- Writing or updating tests for analytics call sites
- Reviewing a PR that introduces or changes tracked events
Workflow
- Register this interaction in the catalog (
EVENT_NAME+generateOptin catalog modules). Reuse an existing catalog name only when this control is another instance of that same interaction (same dashboard event, same owners). - Attach properties on the event builder.
- Send the built event through the tracking entry point.
- In UI tests, wrap
useAnalyticswith the test factory (including files that already mock the hook). In non-React tests, assert the builder and the helper or Engine tracking util.