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
| State | Type | Description |
|---|
new | Active | First active day ever for this path. |
current | Active | Active today and was active within the last 7 days. |
reactivated | Active | Active today after being at-risk (WAU window lapsed but MAU window still open). |
resurrected | Active | Active today after being dormant (MAU window lapsed). |
at_risk_wau | Inactive | Was active within 30 days but not in the last 7 days. |
at_risk_mau | Inactive | Was active within max_dormant_days days but not in the last 30 days. |
dormant | Inactive | Not active within max_dormant_days days. |
Parameters
| Parameter | Type | Default | Description |
|---|
active_events | list[str] | None | None | Events that count as user activity. When None, all events count. |
max_dormant_days | int | 30 | Days of inactivity after which a path transitions from at_risk_mau to dormant. |
path_id_col | str | None | None | Override the path ID column. |
event_col | str | None | None | Override the event column. |