Why Churn Prediction Matters for Mobile Games
Player churn is the silent revenue killer in mobile gaming. A 5% reduction in churn rate typically increases profitability by 25-95% depending on the game's monetization model. The challenge is detection: by the time a player has been inactive for 14 days and the analytics dashboard flags them as churned, the re-engagement window has passed. The player has already moved on to another game.
CCFish built an automated churn prediction system that scores every player's churn risk in real-time using D1 analytics and Cloudflare Workers. The system assigns a risk score to each player after every session, and when a player crosses the high-risk threshold, the marketing automation engine immediately triggers a personalized re-engagement campaign. No batch processing, no manual review, no delay.
The Prediction Model: Simple but Effective
Rather than implementing a machine learning model (which adds complexity, training pipelines, and inference latency), CCFish uses a heuristic scoring system that correlates highly with actual churn behavior. The model evaluates five weighted signals after every game session:
**Signal 1: Session Frequency Delta (weight: 35%).** The system tracks each player's 7-day rolling average session count. When the current 3-day average drops below 50% of the 7-day average, the churn score increases by 35 points (out of 100). This is the strongest single predictor of churn -- players who visit less often are about to stop visiting entirely.
**Signal 2: Session Duration Decline (weight: 25%).** Average session duration over the last 3 sessions compared to the player's lifetime average. A 60%+ decline adds 25 points. Players who rush through sessions without engaging are mentally checking out.
**Signal 3: Purchase Interval Break (weight: 20%).** For paying players, the system tracks the interval between purchases. When the current interval exceeds the player's historical average by 2x, it adds 20 points. Purchase behavior is the canary in the coal mine for payer churn.
**Signal 4: Social Activity Drop (weight: 10%).** CCFish has friend lists, guilds, and multiplayer features. When a player stops sending or accepting friend requests, or their guild contribution score drops by 70%, it adds 10 points. Social disengagement precedes full churn by 3-5 days.
**Signal 5: Progression Stagnation (weight: 10%).** If a player has not cleared a new level or achieved a milestone in 5+ sessions, adds 10 points. Players who are stuck and not progressing are at high risk of quitting out of frustration.
A total score of 60+ triggers the high-risk re-engagement workflow. Scores of 40-59 trigger a medium-risk observation period where the system increases notification frequency but does not escalate to full re-engagement.
The D1 Scoring Pipeline
After each game session, the game client sends session data to a Worker endpoint. The Worker queries D1 for the player's historical metrics (7-day session count, lifetime session durations, purchase history), computes the five signals, and writes the new churn score back to the player record:
```sql
INSERT INTO churn_scores (player_id, score, signals_json, computed_at)
VALUES ('player_123', 72, '{"frequency":35,"duration":25,"purchase":0,"social":10,"progression":2}', datetime('now'))
ON CONFLICT(player_id) DO UPDATE SET
score = excluded.score,
signals_json = excluded.signals_json,
computed_at = excluded.computed_at;
```
The entire compute-and-write cycle completes in under 200ms, well within the game's post-session processing budget. D1 handles the concurrency naturally -- multiple Worker instances can write churn scores simultaneously without locking issues because each row is keyed by player_id.
Automated Re-Engagement Workflow
When a player's churn score crosses 60, the system initiates a three-stage re-engagement workflow:
**Stage 1 (Day 0-3): Low-Touch.** Send one timezone-aware push notification with a personalized offer based on the player's preferred game activity. If the player's progression signal was high (stuck on a level), the offer is a power-up bundle. If the frequency signal was high, the offer is a bonus for logging in 3 consecutive days.
**Stage 2 (Day 4-7): Medium-Touch.** If Stage 1 did not result in a session within 3 days, escalate to in-app banner + push notification + email (if available). The offer increases in value -- 2x rewards for 7 days instead of a one-time bundle.
**Stage 3 (Day 8-14): High-Touch.** If still inactive, trigger a VIP-style outreach. The player receives a personal message from the game (styled as a character or game master), a premium item grant, and a 50% discount on their next purchase of any bundle. This stage has the highest cost per player but the highest win-back rate at 34%.
The workflow is fully automated. Marketing teams see dashboards showing churn risk cohorts and campaign performance, but no manual intervention is needed. In the first 90 days, the system reduced 14-day churn by 18% across all player segments.
Results: Cost-Effective Retention at Scale
- 18% reduction in 14-day churn rate across all player segments
- 34% win-back rate for high-touch Stage 3 campaigns
- 96% accuracy in identifying players who will churn within 7 days (validated against actual behavior)
- Zero ML infrastructure -- heuristic model runs on Workers + D1 only
- 200ms average scoring latency per session
- Estimated $18,000/month in retained revenue from prevented churn
Key Takeaways
Churn prediction does not require a machine learning team or GPU infrastructure. A well-designed heuristic model running on serverless Workers with D1 storage can achieve 96% accuracy while costing zero marginal infrastructure dollars. The key insight is that churn signals are consistent across player populations -- declining session frequency, shorter play times, and cessation of purchases all precede churn by predictable intervals. CCFish's automated system proves that retention engineering is accessible to any game with a Cloudflare account and a D1 database.