analyzing-funnel-correlation
What it does
This skill finds the actions and user traits that are linked to people converting or dropping off in a funnel. It is for product and growth teams who want to know what successful users do differently.
When to use it
- ✓When you want to know why people convert or drop off in a funnel.
- ✓When you want to know what converters do differently from people who drop out.
- ✓When you want to find which events or user properties predict success or failure.
Skill link
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/analyzing-funnel-correlation/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Why do people drop off in my signup funnel? Compare the ones who finish with the ones who do not.”
5 new skills a week. 1 minute to read.
How it works
It runs the funnel, then compares people who completed it with people who did not, for each event and property. It ranks the signals by how strongly they go with conversion or drop-off.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Analyzing funnel correlation
Correlation compares two groups of people who entered a funnel: people who completed the last step (success) and people who did not (failure). For each candidate event or property value, build a contingency table and compute the odds ratio. An odds ratio above 1 means the signal goes with conversion. Below 1 means it goes with drop-off. The further the ratio is from 1, the stronger the correlation.
Correlation is not causation. Tell the user that, and suggest an experiment to test a strong signal.
Workflow
- Get the funnel definition: the step events, the date range, and the conversion window.
If the user names a saved insight, read it with
insight-get. Confirm the step events withread-data-schema. - Run the funnel with
query-funneland note the total entrants and converters. The SQL below must give totals in the same range. If not, fix the step filters first. - Run the event correlation query below with
execute-sql. - If the user asks about person attributes, run the property variant.
- Report the top success signals and the top failure signals with their counts.
To show who is behind a signal, use
query-funnel-actorsor filter the funnel by that event or property.
Event correlation
Replace the step events, the date range, the conversion window (seconds in windowFunnel, days in the INTERVAL), and the step count.
Add more event = '...' conditions to windowFunnel for more steps, and set steps = N to the last step.
WITH
funnel_actors AS (
SELECT
person_id AS actor_id,
windowFunnel(1209600)(toDateTime(timestamp), event = 'step one', event = 'step two') AS steps,
arraySort(groupArrayIf((toUnixTimestamp(timestamp), event = 'step two'), event IN ('step one', 'step two'))) AS step_events,
arrayReverseFill(t -> t > 0, arrayMap(x -> if(x.2, x.1, 0), step_events)) AS next_final,
arrayFirstIndex((x, t) -> NOT x.2 AND t > 0 AND t <= x.1 + 1209600, step_events, next_final) AS attempt,
toDateTime(if(attempt > 0, step_events[attempt].1, arrayFirst(x -> NOT x.2, step_events).1)) AS first_timestamp,
toDateTime(next_final[greatest(attempt, 1)]) AS final_timestamp
FROM events
WHERE event IN ('step one', 'step two')
AND timestamp >= now() - INTERVAL 30 DAY
GROUP BY actor_id
HAVING steps >= 1
),
totals AS (
SELECT countIf(steps = 2) AS success_total, countIf(steps < 2) AS failure_total
FROM funnel_actors
),
per_event AS (
SELECT
e.event AS name,
countDistinctIf(a.actor_id, a.steps = 2) AS success_count,
countDistinctIf(a.actor_id, a.steps < 2) AS failure_count
FROM events AS e
JOIN funnel_actors AS a ON e.person_id = a.actor_id
WHERE e.timestamp >= now() - INTERVAL 30 DAY
AND e.timestamp > a.first_timestamp
AND e.timestamp < if(a.steps = 2, a.final_timestamp, a.first_timestamp + INTERVAL 14 DAY)
AND e.event NOT IN ('step one', 'step two')
GROUP BY name
)
SELECT
name,
success_count,
failure_count,
success_total,
failure_total,
((success_count + 1) * (failure_total - failure_count + 1))
/ ((success_total - success_count + 1) * (failure_count + 1)) AS odds_ratio
FROM per_event
CROSS JOIN totals
WHERE success_count + failure_count >= least(25, 0.02 * (success_total + failure_total))
ORDER BY abs(log(odds_ratio)) DESC
LIMIT 20
The query only counts events between funnel entry and conversion.
step_events holds the first-step and last-step events in time order. next_final gives the next last-step time for each of them in one pass.
For people who converted, attempt picks the first entry that has a last step inside the window, so both timestamps come from the same attempt.
For more steps, keep only the first and last step events in groupArrayIf. The attempt then ignores the middle steps, so the interval can start at an earlier entry than the one that converted.
For people who did not convert, it counts events from their first entry until the conversion window closes.
The timestamps use whole seconds because windowFunnel compares whole seconds. Keep them the same, or some converters get no matched attempt.
It excludes the funnel step events, because they correlate with conversion by definition.
Property correlation
To compare
FAQ
Does a strong signal prove that it causes conversion?
No. Correlation is not causation, so the skill suggests an experiment to test a strong signal.
What does the odds ratio mean?
A number above 1 goes with conversion and a number below 1 goes with drop-off. The further from 1, the stronger the link.
Can it show who is behind a signal?
Yes. The skill can show the people behind a signal using funnel actor queries.
Details
Original description by the author
Find the events and person properties that correlate with funnel conversion or drop-off. Use when the user asks why people convert or drop off in a funnel, what converters do differently, which events or properties predict success or failure, or asks for "correlation analysis" on a funnel. Computes odds ratios with HogQL, because PostHog has no built-in funnel correlation view.
repo: PostHog/posthog
Popularity
- GitHub stars
- 41k
- Ranking position
- #6899
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.