PostHog Analysis Recipes
Step-by-step PostHog recipes — funnels, scroll depth, drop-off, CTA clicks, and before/after deploy comparisons, with runnable HogQL and insight configs.
- How to Build a Retention Chart in PostHog for a SaaS — Build a retention chart in PostHog: use the native Retention insight to see what share of new users come back each week, and track weekly active users in HogQL as a supporting signal.
- How to Create a Cohort of High-Intent Visitors in PostHog — Create a high-intent visitor cohort in PostHog from behaviour like viewing pricing or deep scrolling, then size and use it. Includes the native cohort builder and a HogQL check.
- How to Create a Conversion Goal in PostHog — Create a conversion goal in PostHog: capture the event that represents the goal, track it as a Trends insight, and watch the rate over time with a weekly HogQL trend.
- How to Find Your Most-Viewed Pages in PostHog with HogQL — Find your most-viewed pages in PostHog with one HogQL query: group $pageview events by $pathname, count views and unique visitors, and order by traffic. Includes the native path.
- How to Measure Time on Page in PostHog — Measure time on page in PostHog: use the native session duration, or compute a session-duration proxy in HogQL with dateDiff between the first and last event in each session.
- How to Track a Button Click as a Custom Event in PostHog — Track a button click as a custom event in PostHog with posthog.capture, add properties for context, then count and segment the clicks in HogQL — with a runnable query.
- How to Track Outbound Link Clicks in PostHog — Track outbound link clicks in PostHog with a custom event that records the destination, then rank where your traffic leaves to in HogQL. A reliable, no-guesswork approach.
- How to Use PostHog Paths to See Where Users Go After the Homepage — Use PostHog's Paths insight to see the routes visitors take after the homepage, then confirm the most common destinations with a supporting HogQL pageview query.
- How to Build a Signup Funnel in PostHog for a SaaS Site — Build a signup funnel in PostHog step by step: define the events, create a Funnel insight, and reproduce it in HogQL with windowFunnel so you can see exactly which step leaks the most users.
- How to Measure Scroll Depth in PostHog — Measure scroll depth in PostHog using the $pageleave event's $prev_pageview_max_scroll_percentage property — including bounced sessions. Runnable HogQL for per-page averages and a distribution histogram.
- How to Track CTA Clicks in PostHog with Autocapture — Track CTA clicks in PostHog two ways: read them from $autocapture by element text, or fire a named custom event for reliability. Runnable HogQL to rank your most-clicked buttons and compute click-through.