Skip to content

Add privacy-conscious playground analytics - #118

Merged
a-baran-orhan merged 1 commit into
mainfrom
agent/privacy-conscious-analytics
Aug 1, 2026
Merged

Add privacy-conscious playground analytics#118
a-baran-orhan merged 1 commit into
mainfrom
agent/privacy-conscious-analytics

Conversation

@a-baran-orhan

Copy link
Copy Markdown
Member

Summary

  • keep one Vercel pageview baseline per loaded route while disabling editor-driven soft-navigation pageviews
  • redact query strings, hashes, and individual movement path segments before analytics events leave the browser
  • track confirmed prompt_copied, the first valid user-authored non-preset movement_attempted, and confirmed share_created
  • deduplicate the focused funnel events in memory per page load without cookies, identifiers, source hashes, movement text, or PII
  • document production configuration, dashboard interpretation, privacy boundaries, and limitations

Why

The existing first-edit and render events do not measure a real custom movement attempt: invalid edits can count, while initial, preset, and shared renders inflate the signal. The playground also updates browser history while editing, which can create misleading route activity.

This change records the first valid custom movement only after a user edit parses cleanly and successfully loads in the viewer. Clipboard outcomes are recorded only after the copy operation succeeds.

User and developer impact

The Vercel dashboard can compare route visitors with prompt copies, valid custom movement attempts, and successful share copies. Event payloads remain bounded to closed enums or no properties, and analytics failures never interrupt product behavior.

Custom product events remain opt-in through VITE_PRODUCT_ANALYTICS_PROVIDER=vercel and require a Vercel plan that exposes custom events.

Validation

  • npx vitest run playground/test/analytics.test.ts playground/test/analytics-wiring.test.ts playground/test/vercel-analytics.test.ts — 14 tests passed
  • npx tsc --noEmit -p playground/tsconfig.json — passed
  • npx vite build from playground/ — passed
  • git diff --check — passed

Limitations

  • deduplication is scoped to one page load and intentionally does not link users, tabs, or reloads
  • successful share means the generated link reached the clipboard; it does not prove the link was opened
  • Vercel's aggregate visitor and event views are not a user-level funnel

@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
posecode Ready Ready Preview Aug 1, 2026 7:30pm

@a-baran-orhan
a-baran-orhan marked this pull request as ready for review August 1, 2026 19:37
@a-baran-orhan
a-baran-orhan merged commit de5c49b into main Aug 1, 2026
3 checks passed
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