Skip to content

feat(analytics): add source field to creation and execution events [INS-2427]#9933

Open
pavkout wants to merge 6 commits into
Kong:developfrom
pavkout:INS-2427
Open

feat(analytics): add source field to creation and execution events [INS-2427]#9933
pavkout wants to merge 6 commits into
Kong:developfrom
pavkout:INS-2427

Conversation

@pavkout
Copy link
Copy Markdown
Contributor

@pavkout pavkout commented May 19, 2026

Summary

  • Adds a source property to analytics creation and execution events to
    differentiate where users trigger actions from (home page, sidebar, navbar, etc.)
  • Covers: Request Created, Request Executed, Collection Created, Document Created,
    Mock Created, MCP Client Workspace Created, and Environment Created
  • Import Started already had source on all call sites — no change needed

Analytics Events

requestExecuted — added source property

Source Trigger
request-pane Send button in the request pane

environmentCreate — added source property

Source Trigger
environment-editor "Add environment" in the environment editor route
environment-editor "Add environment" in the workspace environments modal

workspaceCreate — added source property (all scopes: collection, design, environment, mcp, mock-server)

Source Trigger
navbar Top-bar "New" dropdown on the project home page
empty-state Empty state card on the project home page (design doc only)
home-page First request creation button on the project home page
sidebar-dropdown Project context menu in the sidebar
sidebar Empty-node actions inside the sidebar navigation tree
design-view "Create mock server" button in the API spec/design tab (mock-server only)

requestCreated — new event

Fired when a collection is created together with a first HTTP request.

Source Trigger
home-page Create collection with first request on the project home page

mockCreatesource now dynamic

Previously hardcoded as menu. Now inherits the same source values as workspaceCreate (navbar, sidebar-dropdown, sidebar, design-view). Omitted entirely when no source is provided.

Copilot AI review requested due to automatic review settings May 19, 2026 09:08
@pavkout pavkout self-assigned this May 19, 2026
@pavkout pavkout requested a review from a team May 19, 2026 09:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a source attribute to multiple analytics “creation” and “execution” events so product analytics can distinguish where actions were triggered from (home page, navbar, sidebar, tab bar, etc.).

Changes:

  • Thread a source string through request/workspace/environment creation flows and attach it to corresponding analytics events.
  • Add source attribution for request execution (“Request Executed”) from the request pane.
  • Plumb source through dashboard → NewWorkspaceModal → workspace/new route, and through request/environment fetcher submit hooks.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/insomnia/src/ui/components/tabs/tab-list.tsx Adds source: 'tab-bar' when creating a request via the tab bar “+”.
packages/insomnia/src/ui/components/panes/placeholder-request-pane.tsx Adds source: 'placeholder' when creating a request from the empty request pane CTA.
packages/insomnia/src/ui/components/modals/workspace-environments-edit-modal.tsx Adds source: 'environment-editor' when creating environments from the env editor modal.
packages/insomnia/src/ui/components/modals/new-workspace-modal.tsx Accepts optional source prop and forwards it to the workspace/new action payload.
packages/insomnia/src/ui/components/dropdowns/request-group-actions-dropdown.tsx Adds source: 'context-menu' for request creation from the request group actions menu.
packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.new.tsx Adds source to workspace creation analytics and mock-create analytics payloads; threads source into mock server creation helper.
packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.environment.tsx Adds source: 'environment-editor' when triggering environment creation from the environment page.
packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.environment.create.tsx Accepts source in the create-environment action and attaches it to environmentCreate analytics.
packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.debug.tsx Threads source into request creation calls (sidebar + keyboard shortcut).
packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.debug.request.new.tsx Accepts source in request creation action and adds it to requestCreated analytics properties.
packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.debug.request.$requestId.send.tsx Adds source: 'request-pane' to the “Request Executed” analytics payload.
packages/insomnia/src/routes/organization.$organizationId.project.$projectId._index.tsx Captures source when opening the new-workspace modal from navbar/sidebar/home page and when creating “first collection” directly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pavkout pavkout force-pushed the INS-2427 branch 4 times, most recently from e821cf4 to d817e88 Compare May 29, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants