Daily States

Converts an eventstream into daily lifecycle-state events. Each path gets one synthetic event per calendar day, labelled with the user's lifecycle state on that day. Active days produce one of four engagement states; inactive days produce one of three churn-risk states.

Usage

# All events count as activity
stream.daily_states()

# Only specific events count as activity
stream.daily_states(active_events=["login", "purchase"])

# Custom dormancy threshold
stream.daily_states(active_events=["login"], max_dormant_days=60)

Output states

StateTypeDescription
newActiveFirst active day ever for this path.
currentActiveActive today and was active within the last 7 days.
reactivatedActiveActive today after being at-risk (WAU window lapsed but MAU window still open).
resurrectedActiveActive today after being dormant (MAU window lapsed).
at_risk_wauInactiveWas active within 30 days but not in the last 7 days.
at_risk_mauInactiveWas active within max_dormant_days days but not in the last 30 days.
dormantInactiveNot active within max_dormant_days days.

Parameters

ParameterTypeDefaultDescription
active_eventslist[str] | NoneNoneEvents that count as user activity. When None, all events count.
max_dormant_daysint30Days of inactivity after which a path transitions from at_risk_mau to dormant.
path_id_colstr | NoneNoneOverride the path ID column.
event_colstr | NoneNoneOverride the event column.