Skip to content

feat(web-analytics): set up web analytics and a conversion goal after install - #1623

Draft
lricoy wants to merge 1 commit into
mainfrom
lricoy/web-analytics-setup
Draft

lricoy wants to merge 1 commit into
mainfrom
lricoy/web-analytics-setup

Conversation

@lricoy

@lricoy lricoy commented Nov 27, 2026

Copy link
Copy Markdown
Member

Problem

The wizard installs posthog-js, but web analytics is left half set up. Nothing sets authorized URLs, web vitals, heatmaps or a conversion goal, so users finish those steps by hand in PostHog.

Changes

A prototype behind the flag wizard-web-analytics-setup, for projects with a web frontend. It is skipped in CI.

  • A deterministic scan (web-analytics/conversion-candidates.ts) finds sign up, checkout, demo and contact flows, plus success pages such as /thank-you.
  • The top candidate goes to capture as a detected fact, so its event is instrumented in the same run.
  • A new seeded web-analytics task runs after review. It asks once, then creates the goal's action, adds the domain to app_urls and turns on web vitals and heatmaps through the MCP. It edits no code.
  • PostHog can't save a web analytics goal, so the report links /web?conversionGoal.actionId=<id>. docs/proposals/web-analytics-conversion-goal-api.md proposes the backend fix.

WEB-ANALYTICS-SETUP.md has the checklist, design and open questions. It is for review and shouldn't merge as is.

Test plan

  • 17 tests in web-analytics.test.ts use temp-dir fixture apps. They cover the ranking, routes, flag, CI and non-web gating, and facts.
  • tsc -b and vitest run pass.
  • Not yet run end to end with a live model.

LLM context

Written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, as an overnight crew task.

🤖 Generated with Claude Code

…tall

Behind the wizard-web-analytics-setup flag, web projects get a runner-seeded
web-analytics task. A static scan proposes the likely conversion (sign up,
checkout, demo, contact), the capture task is told to instrument it, and the
task confirms the goal, the authorized domain and web vitals or heatmaps with
one wizard_ask before creating them through the PostHog MCP.

Adds WEB-ANALYTICS-SETUP.md and a backend proposal for a saved conversion goal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/go-sdk
  • /wizard-ci mcp-analytics/python-sdk
  • /wizard-ci mcp-analytics/ruby-sdk
  • /wizard-ci mcp-analytics/rust-sdk
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

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