feat: common actions analytics [INS-2120]#9664
Conversation
✅ Circular References ReportGenerated at: 2026-02-23T16:57:32.283Z Summary
Click to view all circular references in PR (76)Click to view all circular references in base branch (76)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
There was a problem hiding this comment.
Pull request overview
This pull request adds analytics tracking for common user actions throughout the Insomnia application. It introduces new Segment events for tracking user interactions such as filtering, toggling UI elements, copying data, and using various menu actions. The PR also refactors once-daily tracking helper functions by moving them from temp-segment-tracking.ts to analytics.ts for better reusability.
Changes:
- Added 41 new Segment event types for tracking common user actions (homepage filtering, request operations, MCP interactions, etc.)
- Moved and exported helper functions for once-daily tracking (
getTodayDateString,hasTrackedToday,markTrackedToday) and introduced a newtrackOnceDailyutility function - Instrumented analytics tracking across multiple UI components including request panes, response viewers, command palette, and various action menus
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/insomnia/src/ui/analytics.ts | Added 41 new event types and once-daily tracking utilities |
| packages/insomnia/src/ui/temp-segment-tracking.ts | Removed duplicate helper functions, now imported from analytics.ts |
| packages/insomnia/src/ui/components/websockets/realtime-response-pane.tsx | Added tracking for MCP response headers copy action |
| packages/insomnia/src/ui/components/viewers/response-headers-viewer.tsx | Added optional callback for copy all action |
| packages/insomnia/src/ui/components/viewers/response-cookies-viewer.tsx | Added tracking for manage cookies button click |
| packages/insomnia/src/ui/components/request-url-bar.tsx | Added tracking for send menu actions (generate code, send after delay, repeat on interval, download) |
| packages/insomnia/src/ui/components/panes/response-pane.tsx | Added tracking for response headers copy action |
| packages/insomnia/src/ui/components/panes/request-pane.tsx | Added tracking for params/headers description toggle, bulk edit, import from URL, and script snippets |
| packages/insomnia/src/ui/components/mcp/mcp-roots-panel.tsx | Added tracking for roots notify button click |
| packages/insomnia/src/ui/components/mcp/mcp-request-pane.tsx | Added tracking for params beautify and headers description toggle |
| packages/insomnia/src/ui/components/mcp/mcp-pane.tsx | Added tracking for list filter and expand/collapse actions |
| packages/insomnia/src/ui/components/key-value-editor/key-value-editor.tsx | Added optional callback for description toggle |
| packages/insomnia/src/ui/components/editors/request-script-editor.tsx | Added optional callback for snippet additions |
| packages/insomnia/src/ui/components/editors/request-parameters-editor.tsx | Added support for description toggle tracking |
| packages/insomnia/src/ui/components/editors/request-headers-editor.tsx | Added support for description toggle tracking |
| packages/insomnia/src/ui/components/editors/body/raw-editor.tsx | Added tracking for beautify button click |
| packages/insomnia/src/ui/components/dropdowns/request-actions-dropdown.tsx | Added tracking for request menu actions (duplicate, pin, rename, settings, open in new tab) |
| packages/insomnia/src/ui/components/command-palette.tsx | Added tracking for quick search opening via keyboard and mouse |
| packages/insomnia/src/ui/components/.client/codemirror/code-editor.tsx | Added optional callback for prettify action and tracking for JSONPath entry |
| packages/insomnia/src/routes/organization.tsx | Added tracking for statusbar toggles and orphaned projects click |
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.spec.tsx | Added tracking for designer preview toggle and generate mock button |
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.debug.tsx | Added tracking for environment picker, add cookies/certificates, request list sort and expand/collapse |
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId._index.tsx | Added tracking for homepage filter using once-daily tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...a/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.spec.tsx
Show resolved
Hide resolved
| localStorage.setItem(key, getTodayDateString()); | ||
| } | ||
|
|
||
| export function trackOnceDaily(event: SegmentEvent, properties?: Record<string, unknown>): void { |
There was a problem hiding this comment.
Could we avoid this function in the client by moving the logic in the analytics pipeline?
My main concern is that filtering this on the client won't be 100% reliable and there will be cases where these events can be duplicated anyway (e.g. same user with two computers etc.)
There was a problem hiding this comment.
I'll explore taking it out in a follow-up as part of this: https://konghq.atlassian.net/browse/INS-884
I'm not sure if/how we'd perform this in Segment/Amplitude
gatzjames
left a comment
There was a problem hiding this comment.
I think we should move the once daily functionality to the analytics pipeline instead of having it in the client. Not pressing for this PR since this just moves it's place but we could have a TODO/comment somewhere to make sure we don't overuse this in other places.
LGTM
Another group of events to analyze. See linked Jira task for more info.