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:
| Question | Query over |
|---|---|
| Bounce rate by landing page | $pageview / $pageleave sessions grouped by entry $pathname |
| Acquisition funnel by source | Funnel $pageview → sign_up → purchase, broken down by first_touch_source |
| Where signups stall | Funnel signup_started → sign_up → onboarding_started → onboarding_completed |
| Low-scroll pages | Max 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 touch | Server purchase (has providerEventId) grouped by first_touch_source |
| Search misses | search events with resultCount = 0 (no query text is captured) |
| Pricing interest vs. intent | pricing_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
| Metric | Definition |
|---|---|
| Bounce | Session with one $pageview and no engagement before $pageleave |
| Engagement rate | Sessions with a second $pageview, a conversion event, or meaningful dwell, over all sessions |
| Scroll depth | Max scroll percentage PostHog attaches per pageview at $pageleave |
| Pogo-sticking proxy | Search-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
Google Ads conversions
Wire Google Ads conversion tracking onto the gtag.js that GA4 already loads with the ads key under config.analytics.google - conversion ID, per-event labels, and the Consent Mode v2 signals.
Support chat
Render a Crisp or Chatwoot live-chat widget from config.support, identified to the signed-in user, on both web and the desktop app.