Skip to content

Funnels, paths and retention ​

Ad-hoc funnel ​

POST /properties/{pid}/funnels/run

json
{
  "date_range": "last_28_days",
  "steps": [
    { "type": "page", "label": "Product page", "path": "/p/*" },
    { "type": "element", "label": "Add to cart", "el_name": "add-to-cart" },
    { "type": "page", "label": "Shipping", "path": "/checkout/shipping" },
    { "type": "element", "label": "Pick a delivery slot", "el_name": "delivery-slot-picker" },
    { "type": "event", "label": "Purchase", "name": "purchase" }
  ],
  "window_seconds": 3600,
  "breakdown": "actor_family"
}

Step types (2 to 12 steps):

typeFields
pagepath (exact or glob such as /checkout/*; a regex with regex: true), optional hostname
eventname, optional props filters [{key, op, value}]
elementAt least one of el_name (the element's data-ah-name), selector (CSS selector) or text; optional path

Options:

FieldValues
window_secondsConversion window in seconds (default 1,800). window is an alias.
unitCount session (default) or visitor
modeclosed (default: visitors must enter at step 1) or open
strict_ordertrue: no other event between steps
breakdownnone (default), actor_family (agents vs humans vs bots), actor_type, navigation_mode, device_type, channel_group, country

The response has one entry per breakdown value with, for each step, the visitors or sessions that reached it, the conversion from the previous and the first step, and the median time between steps.

Saved funnels ​

GET /properties/{pid}/funnels lists saved funnels; POST /properties/{pid}/funnels/{id}/run runs one with {date_range, actor?, compare?}. Creating and editing them: Configuration objects.

Paths ​

POST /properties/{pid}/paths/run

json
{ "date_range": "last_7_days", "node": "page_and_element", "start": "/", "direction": "next", "depth": 4, "split_by_actor": true }
FieldValues
nodepage (default), element, event, page_and_element
startStarting page, element label or event; empty = session start
directionnext (default) or previous
depth1 to 8 (default 4)
split_by_actorSeparate agent and human flows
collapse_repeatsMerge repeated identical steps (default true)
limitMaximum flows (default 200)

Returns the flows between nodes, ready for a sankey or sunburst chart.

Retention ​

POST /properties/{pid}/retention/run with {date_range, granularity: "day" | "week" | "month", actor?} returns cohorts of first visits and the share of each cohort coming back in the following periods. Available on Pro and Scale.

Agents & humans, every visit counts!