Get funnel conversion across ordered steps
umami_get_funnelAnalyze user funnels by passing an ordered sequence of page paths or custom events to get session counts per step and drop-off rates between steps.
Instructions
Get session counts and drop-off across an ordered sequence of pages and/or custom events.
Umami has no funnel endpoint, so this walks every session's activity trail in the range (capped by max_sessions) looking for the steps in order. A step matches a page path or a custom event name, whichever it equals; a session only advances once it has completed the previous step.
Args:
website (string, optional): Website ID, name, or domain.
steps (string[], required): 2-8 steps in order, each a page path (e.g. '/pricing') or event name (e.g. 'signup').
range (string): Date range, default '7d'.
start_date / end_date (string, optional): Explicit bounds, overriding 'range'.
filters (object, optional): Segment filters applied to the session pool, e.g. { device: 'mobile' }.
max_sessions (number): Cap on sessions scanned, default 500, max 2000.
response_format ('markdown' | 'json'): Output format (default: 'markdown').
Returns: JSON shape: { "steps": [ { "step": string, "sessions": number, "pct_of_first": number, "pct_of_previous": number } ], "scanned_sessions": number, "total_sessions_in_range": number, "truncated": boolean }
Examples:
"Funnel from pricing to signup to activation" -> steps=["/pricing", "/signup", "activation"]
Error handling:
If 'truncated' is true, total sessions in the range exceeded max_sessions; raise it for a more complete picture, at the cost of more API calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | Date range for the query, default '7d'. Relative ("30m", "24h", "7d", "4w", "3mo", "1y"), named ("today", "yesterday", "this_week", "last_week", "this_month", "last_month", "this_year", "last_year", "mtd", "ytd", "all_time"), or an explicit ISO date via start_date/end_date. | |
| steps | Yes | Ordered steps: page paths or event names. | |
| filters | No | Optional segment filters. Supported keys: path, referrer, title, query, browser, os, device, country, region, city, language, hostname, tag, event, distinctId, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, segment, cohort. Example: { country: 'US', device: 'mobile' }. | |
| website | No | Website ID (UUID), name, or domain. Optional if UMAMI_DEFAULT_WEBSITE is set. Use umami_list_websites to discover values. | |
| end_date | No | Explicit end date (YYYY-MM-DD, ISO 8601 timestamp, or epoch ms). Overrides 'range'. | |
| start_date | No | Explicit start date (YYYY-MM-DD, ISO 8601 timestamp, or epoch ms). Overrides 'range'. | |
| max_sessions | No | Maximum sessions to scan. Higher is more accurate but slower (one extra API call per session). | |
| response_format | No | Output format: 'markdown' for a readable summary, 'json' for raw structured data. | markdown |