Funnel
Interactive conversion funnel for Jupyter notebooks.
A path is counted at step N if it contains that step's event after
already passing through all previous steps. Supports diff mode to
compare two segments side by side. steps is also editable from the
widget's sidebar without re-running the cell.
Usage
stream.funnel(steps=["page_view", "add_to_cart", "purchase"])
stream.funnel(steps=["add_to_cart", "purchase"], diff=("plan", "pro", "free"))
Parameters
Data
Data parameters change the computed result. They are exactly the arguments of
the widget's headless twin stream.funnel_data() — see
headless mode below.
No parameters.
Display
Display parameters only affect how the widget is rendered.
| Parameter | Type | Description |
|---|---|---|
steps | list of str, optional | Ordered event names defining the funnel steps. |
diff | tuple, optional | (segment_col, value1, value2) or (path_ids1, path_ids2); value2 may be <REST>. |
path_col | str, optional | Path ID column override; defaults to schema.path_col. |
height | int, default 420 | Widget height in pixels. |
sidebar_open | bool, default True | Whether the sidebar starts open. |
Headless mode
stream.funnel_data()
Compute funnel conversion metrics and return a dict (headless).
Examples
Basic
stream.funnel(
steps=["catalog", "product_view", "add_to_cart", "purchase"],
)
Diff mode
stream.funnel(
steps=["catalog", "product_view", "add_to_cart", "purchase"],
diff=["platform", "mobile", "desktop"]
)