You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8c8868c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .agents/skills/analytics/SKILL.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,9 +115,10 @@ Every `trackAnalytics` call flows through the GetSentry override in `static/gsAp
115
115
116
116
## Non-Negotiable Constraints
117
117
118
-
1.**All events must be type-safe.** Every event key must exist in a `*EventParameters` type and be registered in the domain's event map.
119
-
2.**All events flow through `trackAnalytics()`.** Never call `window.analytics`, `Amplitude.track()`, or any other analytics SDK directly.
120
-
3.**Organization context is automatic.** Pass `organization` to `trackAnalytics` — the override system handles the rest.
121
-
4.**Reuse over create.** Always search for existing events before defining new ones.
122
-
5.**One event per interaction.** Do not fire multiple events for the same user action.
123
-
6.**No PII in event parameters.** Never include user emails, IP addresses, full names, or other personally identifiable information. Use opaque IDs (org ID, user ID) when identity context is needed.
118
+
1.**`trackAnalytics()` calls must be type-safe.** Every event key passed to `trackAnalytics()` must exist in a `*EventParameters` type and be registered in the domain's event map. This enforces that `organization` is always passed and that call sites sharing the same event key use consistent parameters. Declarative helpers — button `analyticsEventKey`/`analyticsParams` props and `useRouteAnalyticsParams` — are exempt because each instance is a one-off: two buttons labeled "Save" are inherently different (different forms, different contexts), so there are no shared call sites and less value in centralized types.
119
+
2.**Prefer declarative helpers.** Use button analytics props and route analytics hooks when they fit. Fall back to `trackAnalytics()` only for interactions those helpers don't cover.
120
+
3.**All events flow through `trackAnalytics()` or built-in helpers.** Never call `window.analytics`, `Amplitude.track()`, or any other analytics SDK directly.
121
+
4.**Organization context is automatic.** Pass `organization` to `trackAnalytics` — the override system handles the rest.
122
+
5.**Reuse over create.** Always search for existing events before defining new ones.
123
+
6.**One event per interaction.** Do not fire multiple events for the same user action.
124
+
7.**No PII in event parameters.** Never include user emails, IP addresses, full names, or other personally identifiable information. Use opaque IDs (org ID, user ID) when identity context is needed.
Copy file name to clipboardExpand all lines: .agents/skills/analytics/references/tracking-patterns.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ useRouteAnalyticsParams({
49
49
50
50
## Button Click Tracking
51
51
52
-
Use built-in button analytics props for simple click tracking. No event definition required for Reload-only tracking.
52
+
Use built-in button analytics props for simple click tracking. These are the preferred approach when a `<Button>` already exists — no event definition or type registration required.
53
53
54
54
```tsx
55
55
<Button
@@ -72,7 +72,7 @@ Use built-in button analytics props for simple click tracking. No event definiti
72
72
**Rules:**
73
73
74
74
- Prefer button props over a manual `trackAnalytics` call in an `onClick` handler.
75
-
-If you need the event to be type-safe and appear in the typed event registry, also define it in the domain event file. Button props work without registration but lose type safety.
75
+
-Button props do not require registration in the typed event registry. Each button instance is inherently a one-off — even two "Save" buttons are different buttons tied to different forms — so there are no shared call sites that would benefit from centralized types.
76
76
- The tracking fires via `TrackingContext` — the GetSentry override wires it to Reload/Amplitude.
Copy file name to clipboardExpand all lines: src/AGENTS.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,6 +247,34 @@ analytics.record(
247
247
)
248
248
```
249
249
250
+
### Tracing / Spans
251
+
252
+
Use the wrappers in `sentry.utils.tracing` instead of calling the SDK directly. This is required while we dogfood the streaming trace lifecycle (Span First rollout).
0 commit comments