Funnel#

Funnel Class#

class retentioneering.tooling.funnel.funnel.Funnel(eventstream)[source]#

A class for the calculation and visualization of a conversion funnel.

Parameters:
eventstreamEventstreamType

See also

Eventstream.funnel

Call Funnel tool as an eventstream method.

Notes

See Funnel user guide for the details.

fit(stages, stage_names=None, funnel_type='closed', groups=None, group_names=None)[source]#

Calculate the funnel internal values with the defined parameters. Applying fit method is necessary for the following usage of any visualization or descriptive Funnel methods.

Parameters:
stageslist of str

List of events used as stages for the funnel. Absolute and relative number of users who reached specified events at least once will be plotted. Multiple events can be grouped together as an individual state by combining them as a sub list.

stage_nameslist of str, optional

List of stage names, this is necessary for stages that include several events.

funnel_type‘open’, ‘closed’ or ‘hybrid’, default ‘closed’
  • If open, all users will be counted on each stage;

  • If closed, each stage will include only users, that were present on all previous stages;

  • If hybrid, combination of 2 previous types. The first stage is required to go further. And for the second and subsequent stages it is important to have all previous stages in their path, but the order of these events is not taken into account.

groupstuple[list, list], tuple[str, str, str], str, optional

Specify two groups of paths to plot grouped funnel.

  • If tuple[list, list], each sub-list should contain valid path ids.

  • If tuple[str, str, str], the first str should refer to a segment name, the others should refer to the corresponding segment values.

  • If str, it should refer to a binary (i.e. containing two segment values only) segment name.

  • If None, all users from the dataset will be plotted. A user can only belong to one segment at a time.

group_nameslist of str, optional

Names of the groups defined in the group argument.

plot()[source]#

Create a funnel plot based on the calculated funnel values. Should be used after fit().

Returns:
go.Figure
property params#

Returns the parameters used for the last fitting.

property values#

Returns a pd.DataFrame representing the calculated funnel values. Should be used after fit().

Returns:
pd.DataFrame

segment_name

stages

unique_users

%_of_initial

%_of_previous

segment_1

stage_1

2000

100.00

100.00

Eventstream#

Eventstream.funnel(stages, stage_names=None, funnel_type='closed', groups=None, group_names=None, show_plot=True)[source]#

Show a visualization of the user sequential events represented as a funnel.

Parameters:
show_plotbool, default True

If True, a funnel visualization is shown.

See other parameters’ description

Funnel

Returns:
Funnel

A Funnel class instance fitted to the given parameters.