> ## Documentation Index
> Fetch the complete documentation index at: https://lifters.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Player Behavior

> Active users, churn, new vs returning, sessions per player and behavioral analytics on the Atlas platform.

Player Behavior Analytics covers the player-engagement layer of the Atlas
Intelligence module — active users, churn rolling D7/D14/D30, new vs
returning per month, sessions per player and weekly heatmap by hour.
Powered by all event types and snapshotted daily in ClickHouse.

## Available Features

### Active Users (live)

* **DAU / WAU / MAU** — Unique players in window, computed via uniqHLL12 over
  Gold tables. Available in
  [`/v1/analytics/casino/overview`](/guides/analytics/casino-analytics#overview)
  (`players` field) and `/v1/analytics/casino/players-summary`
  (`total_players`).

### Retention & Churn (live)

* **Churn D7 / D14 / D30** — Rolling churn flags per player based on days
  since last bet. Available in
  [`/v1/analytics/casino/players-summary`](/guides/analytics/casino-analytics#players-summary).
  Snapshot refreshed daily; `snapshot_age_days` exposed in payload to flag
  stale data.
* **New vs Returning** — Monthly breakdown of first-time vs recurrent players
  for up to 12 months. Available in
  [`/v1/analytics/casino/new-vs-returning`](/guides/analytics/casino-analytics#new-vs-returning).
* **Cohort Analysis** — Planned: retention curves by registration cohort.
* **Reactivation Tracking** — Planned: win-back campaign effectiveness.

### Engagement (live)

* **Sessions per Player** — Average session count per active player.
  Available in `/v1/analytics/casino/players-summary` (`sessions_per_player`).
* **Volume by Hour** — 24-bucket BRT distribution of stake/GGR per hour, with
  optional bucket filter (slots/live/tables/outros). Available in
  [`/v1/analytics/casino/volume-by-hour`](/guides/analytics/casino-analytics#volume-by-hour).
* **Weekly GGR Heatmap** — 7×24 matrix (day-of-week × hour BRT) of GGR with
  min/max for gradient rendering. Available in
  [`/v1/analytics/casino/weekly-heatmap`](/guides/analytics/casino-analytics#weekly-heatmap).

### Player Segmentation

* **RFM Analysis** — Planned: Recency, Frequency, Monetary value segments.
* **VIP Tiers** — Planned: automatic classification based on betting volume.

### LTV Modeling

* **Predicted LTV** — Planned: AI-powered lifetime value prediction.
* **LTV by Acquisition Channel** — Planned.
* **Segment LTV** — Planned.

## Endpoints

| Path                                                                                           | Returns                                                                            |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [`/v1/analytics/casino/players-summary`](/guides/analytics/casino-analytics#players-summary)   | Total/Novos/Recorrentes + Sessions/Player + Churn D7/D14/D30 + snapshot\_age\_days |
| [`/v1/analytics/casino/new-vs-returning`](/guides/analytics/casino-analytics#new-vs-returning) | Monthly breakdown (event\_month, new\_players, returning\_players, total\_players) |
| [`/v1/analytics/casino/volume-by-hour`](/guides/analytics/casino-analytics#volume-by-hour)     | 24 buckets BRT (hour, stake, ggr, hold\_pct, rounds)                               |
| [`/v1/analytics/casino/weekly-heatmap`](/guides/analytics/casino-analytics#weekly-heatmap)     | 7×24 matrix + min/max GGR                                                          |
| `/v1/analytics/sport/players`                                                                  | Sport-side player activity                                                         |

## Data Prerequisites

Player behavior analytics requires all event types:

* [User events](/guides/events/tracking-users) — Registration and profile data
* [Transaction events](/guides/events/tracking-transactions) — Deposit/withdrawal patterns
* [Casino events](/guides/events/tracking-casino) — Game preferences (`casino_session_id` recommended for accurate session counts)
* [Sports events](/guides/events/tracking-sports) — Betting patterns

Churn rolling depends on a daily snapshot job. In staging/production this is
handled automatically by a Refreshable Materialized View. Local dev requires
manual `npm run refresh:churn` in the `data/` module.
