Skip to content

[FEAT] Product analytics: app-analytics kit v8 tracker for the desktop app - #121

Merged
ScottieR merged 1 commit into
masterfrom
feature/app-analytics
Oct 12, 2026
Merged

ScottieR merged 1 commit into
masterfrom
feature/app-analytics

Conversation

@ScottieR

Copy link
Copy Markdown
Owner

What

Adds first-party product analytics (app-analytics kit v8, ported to Tauri) beside the existing opt-in telemetry, which is unchanged. Pairs with the feature/app-analytics PR in ScottieR/canopy-admin, which hosts the collector and stats.

  • src/lib/analytics/: the tracker (client.ts), the event list (events.ts) and startup wiring (start.ts). Started once, in the main window only.
  • Screen views and active time, named by the app (/architect/overview), never by agent or forum id.
  • Events: onboarding_step_completed, agent_created, reply_received, forum_created, forum_completed, connection_added, companion_paired, artifact_published; copying a published page's link is a tracked share.
  • On by default, with a new Profile → Product Analytics switch to turn it off. This changes the privacy posture: the README privacy table and Architecture section (and diagram) are updated to say so.
  • CLAUDE.md tells later sessions to keep events current.

What is sent

A random device id and session id, the screen, active time, and the events above with small enumerated props. Never message or file content, agent names, credentials, or anything typed.

Notes

  • events.ts must stay identical to canopy-admin/analytics/events.ts; a parity test there fails when they differ.
  • Until canopy-admin is deployed with the collector, the posts get no handler and are ignored; the app is unaffected.
  • Dev builds also send events, to whatever VITE_API_URL points at.

Testing

  • npm run typecheck, npm run build, and the full vitest suite (374 tests) pass.
  • End to end locally in a browser against a local admin server: screen views arrived, the opt-out switch stopped and resumed sending, and the funnel and share showed in the stats.
  • Not exercised: a real Tauri build. Milestone events were fired through the tracker by hand, not by deploying an agent.

Known gaps

  • The public share page has no tracker, so opens of a shared link aren't recorded yet.
  • No way to mark the owner's own device yet.

🤖 Generated with Claude Code

…p app

Adds the first-party usage tracker (src/lib/analytics) beside the existing
opt-in telemetry: screen views and active time, the first-agent funnel steps,
milestone events, and a tracked link when a published page's URL is copied.
Events post to the control plane's /api/e. On by default, with an opt-out
switch in Profile. README architecture, privacy table and a Usage stats
section are updated; CLAUDE.md tells later sessions to keep events current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ScottieR
ScottieR merged commit 8fa6bd1 into master Oct 12, 2026
5 of 7 checks passed

Copy link
Copy Markdown
Owner Author

Merged at the owner's request, with the verify check red. The red check isn't from this PR.

  • What's failing: npm audit --audit-level=high in security.yml. Advisories published since master last passed on 2026-09-10 now flag braces, micromatch, chokidar and fast-glob through tailwindcss@3.4.19, and source-map-js. master fails the same gate today.
  • No in-range fix: every version of braces is affected, so npm's only fix is tailwindcss 4 (a semver-major migration). npm audit fix itself also crashes (Cannot read properties of null (reading 'edgesOut')).
  • This PR's own code: tsc --noEmit, all 374 vitest tests, and vite build pass on the PR head.

The Tailwind 4 upgrade needs its own PR to turn the gate green again.


Generated by Claude Code

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.

1 participant