Skip to content

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.

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.

  1. 1Grafana app
    Ask
    2 to 10 steps, a time range up to 31 days, optional filters and within.
  2. 2rum-api
    Read Loki
    One LogQL query for the page steps, one for the event steps, in parallel.
  3. 3rum-api
    Walk each session
    Find the deepest path through the steps, in order.
  4. 4Grafana app
    Show
    Bars per step, conversion, time between steps, the sessions that dropped.
One query per step kind, joined in memory per session. Results are cached for 60 seconds.

The rules:

  • The unit is the session. Each step reports the sessions that reached it, and the distinct user.id of those sessions. Events without a session.id are 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.
0s75s150s225s300s
0snavigation/ (step 1)
20snavigation/products/7 (step 2)
90snavigation/ (step 1 again)
120snavigation/products/3 (step 2)
150sadd_to_cartstep 3
280sorder_paidstep 4
Funnel home → product page → add_to_cart → order_paid. The first attempt stops at the product page; the second, from the later home visit, reaches order_paid. The session counts as converted.
  • 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.

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.

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.