Funnels
A funnel answers: of the sessions that did step 1, how many then did step 2, then step 3? ouo11y computes it from the session events already in Loki. Nothing new is collected, and nothing changes in your app for page steps.
Funnels need rum-api 0.5.0 and the Grafana app 0.9.0 (the grafana image 0.5.0). In Grafana: More apps → ouo11y RUM → Funnels. The funnels quickstart builds one from 50 generated sessions.
What a step can be
Section titled “What a step can be”| Step | Example | Matches |
|---|---|---|
| Page is | /checkout |
a navigation event whose url.path is exactly that |
| Page starts with | /products/ |
a navigation event whose url.path starts with it |
| Event | add_to_cart |
any event with that event.name, except navigation |
@ouo11y/browser records every page load and every history.pushState, replaceState and back or forward as a navigation event, so page steps work without code. For an event step, record the action where it happens:
rum.addEvent("add_to_cart", { "product.id": product.id });Name events after what happened, in snake_case, and keep the set small and stable: the funnel matches the name, not the attributes. Built-in events such as exception can be steps too.
How a funnel is counted
Section titled “How a funnel is counted”- 1Grafana appAsk2 to 10 steps, a time range up to 31 days, optional filters and
within.POST /v1/funnels/query
read token - 2rum-apiRead LokiOne LogQL query for the page steps, one for the event steps, in parallel.events with
session.id - 3rum-apiWalk each sessionFind the deepest path through the steps, in order.counts, times
- 4Grafana appShowBars per step, conversion, time between steps, the sessions that dropped.
The rules:
- The unit is the session. Each step reports the sessions that reached it, and the distinct
user.idof those sessions. Events without asession.idare ignored. - Strict order within one session. A session reaches step n when it has a step-n event after the event it used for step n − 1. Other events in between do not matter. A repeated step counts once. A step done before the previous one does not count.
- Best attempt. Every occurrence of step 1 is tried as a start, and the deepest path wins. A shopper who stalls, goes back to the home page and buys later in the same session is counted as a purchase.
- Optional window (
within). Every step must be reached within that time of the attempt’s step 1. At most 7 days. - Only events inside the time range count. A session whose step 1 happened before the range does not enter, even if later steps fall inside it. Widen the range rather than shifting it.
navigation/ (step 1)navigation/products/7 (step 2)navigation/ (step 1 again)navigation/products/3 (step 2)add_to_cartstep 3order_paidstep 4Reading one
Section titled “Reading one”- The bar is the sessions that reached the step. The big percentage is relative to step 1.
- % of previous step is the step’s own conversion. The lowest one is the leak to fix first.
- median · p75 is the time from the previous step, for the sessions that made it. A long p75 with an ordinary median means a slow minority: watch their replays.
- sessions · users: one user with three sessions counts three times in sessions and once in users.
- The dropped count above a bar opens the list of sessions that reached the previous step and stopped: when they entered, how long they took, their last page, and a link to the session with its replay, errors and traces.
The funnel lives in the URL (?step=page:/&step=page:/products/*&step=event:add_to_cart). Copy the address bar to share it. There are no saved funnels yet.
Filters
Section titled “Filters”service (service.name), environment (deployment.environment.name), platform (ouo.platform) and project (ouo.project.id) are Loki labels and narrow the query cheaply. release (service.version) is structured metadata. All are exact matches.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| steps | 2 to 10 |
| a step value | 1 to 256 characters, case-sensitive |
within |
up to 7 days |
| time range | up to 31 days |
| events read per step kind | 100,000 |
| cache | 60 s per funnel and range (loki.funnel_cache_ttl) |
Past 100,000 events of one kind the funnel is computed on the first 100,000 and undercounts the end of the range. Narrow the range or add a filter for a busy app.
Session sampling (session.sampleRate in the SDK) scales every step down equally: percentages stay right, counts do not.