GenerateSaaS

AI-driven analytics review

Connect an AI coding agent to PostHog via MCP, run the standard growth queries against the built-in events, and close the measure → change → re-measure loop.

Your coding agent can read PostHog directly and propose the next growth change. This page holds the queries and definitions that loop runs on - point your agent at it.

Prerequisite: PostHog enabled in config.analytics.posthog (Analytics). The loop is PostHog-specific - it is the only provider with server-side events and an MCP server.

Connect the PostHog MCP

Create a personal API key in PostHog: Settings → Personal API keys (scope it read-only to the project).

Register PostHog's MCP server (https://mcp.posthog.com/mcp, HTTP transport, Authorization: Bearer <personal key> header) with whatever agent you use. For Claude Code:

claude mcp add --transport http posthog https://mcp.posthog.com/mcp --header "Authorization: Bearer <personal key>"

Verify: ask the agent to list PostHog insights. It should answer from your project.

The standard growth queries

Exact event and property names from the built-in catalog; the first_touch_* properties come from attribution:

QuestionQuery over
Bounce rate by landing page$pageview / $pageleave sessions grouped by entry $pathname
Acquisition funnel by sourceFunnel $pageviewsign_uppurchase, broken down by first_touch_source
Where signups stallFunnel signup_startedsign_uponboarding_startedonboarding_completed
Low-scroll pagesMax scroll depth (on $pageleave) by $pathname, ascending
Frustration pages$rageclick and $dead_click counts by $pathname
Web vitals by route$web_vitals (LCP, CLS, INP) grouped by $pathname
Pogo-sticking (proxy)Sessions entering from a search-engine referrer with $pageleave under ~10s and no second $pageview
Revenue by first touchServer purchase (has providerEventId) grouped by first_touch_source
Search missessearch events with resultCount = 0 (no query text is captured)
Pricing interest vs. intentpricing_viewed vs. begin_checkout by source

Revenue questions use the server purchase event (it carries providerEventId); the client purchase exists for the client-only providers and double-counts in PostHog.

Metric definitions

MetricDefinition
BounceSession with one $pageview and no engagement before $pageleave
Engagement rateSessions with a second $pageview, a conversion event, or meaningful dwell, over all sessions
Scroll depthMax scroll percentage PostHog attaches per pageview at $pageleave
Pogo-sticking proxySearch-referrer entry that leaves within seconds without a second pageview - a proxy, since the true behavior (returning to the results page) is only observable on the search engine

The loop

Measure: run the queries above; write the baseline numbers down (in the PR or an insight).
Change one thing: the worst page, the biggest funnel drop-off, the slowest route.
Wait for volume: enough sessions to move past noise - days, not hours, on small sites.
Re-measure: the SAME queries. Keep the change if the number moved, revert if it did not.

On this page