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.

ParameterTypeDescription
stepslist of str, optionalOrdered event names defining the funnel steps.
difftuple, optional(segment_col, value1, value2) or (path_ids1, path_ids2); value2 may be <REST>.
path_colstr, optionalPath ID column override; defaults to schema.path_col.
heightint, default 420Widget height in pixels.
sidebar_openbool, default TrueWhether 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"]
)