A complete, production-ready analytics engineering system for mobile free‑to‑play games.
Includes data pipelines, event schema, attribution modeling, LTV/ROAS analytics, friction diagnostics, and an interactive KPI dashboard built with Chart.js.
- Production-grade event schema
- Real-time + batch pipelines
- BigQuery modeling (Bronze → Silver → Gold)
- Cohort LTV & ROAS system
- SKAN CV 6-bit mapping
- Gameplay friction diagnostics
- Retention heatmaps
- Funnel & economy analytics
- Interactive dashboard (HTML + JSON)
- Game client events
- Ad/attribution networks (SKAN, Singular, Adjust)
- External ETL systems
- Load Balancer → Pub/Sub queue
- GCS Staging
- Speed Layer: Dataflow streaming
- Batch Layer: dbt incremental models
- Bronze: Raw logs
- Silver: Cleaned/clustered events
- Gold: Pre‑aggregated metrics (DAU, Retention, LTV)
Example fields:
user_idtimestamp_client,timestamp_serverdevice,platform,app_versionlevel,attempt_id,session_idcurrency_balancesad_impressionsis_cheater
Example: gameplay.level.complete.v2.
- Primary: Advertising ID
- Fallback: probabilistic matching
- SKAN: campaign-level mapping
- ARPU by day-since-install
- Windowed cumulative LTV
- Stored in
fact_cohort_ltv_daily
- UserInstall CTE (Attribution + Internal User Profiles Join)
DailyUserRevenueSource AS (
SELECT
user_id,
DATE(event_timestamp) AS revenue_date,
SUM(
CASE WHEN event_name = 'monetization.iap.verified.v1'
THEN properties.iap_total_spend_usd
ELSE 0 END
) AS iap_revenue,
SUM(properties.ad_revenue_usd) AS ad_revenue
FROM Silver.events
WHERE event_name IN ('monetization.iap.verified.v1', 'ads.impression.v1')
GROUP BY 1, 2
),- DailyUserRevenue – Aggregated IAP + Ad Revenue (clean version)
Step A — First aggregation level
DailyUserRevenueSource AS (
SELECT
user_id,
DATE(event_timestamp) AS revenue_date,
SUM(
CASE WHEN event_name = 'monetization.iap.verified.v1'
THEN properties.iap_total_spend_usd
ELSE 0 END
) AS iap_revenue,
SUM(properties.ad_revenue_usd) AS ad_revenue
FROM Silver.events
WHERE event_name IN ('monetization.iap.verified.v1', 'ads.impression.v1')
GROUP BY 1, 2
),Step B — Final daily revenue calculation
DailyUserRevenue AS (
SELECT
*,
iap_revenue + ad_revenue AS total_daily_revenue
FROM DailyUserRevenueSource
),- CohortDSI (Day Since Install + Joined Revenue)
CohortDSI AS (
SELECT
t1.install_cohort_date,
t1.campaign_id,
t1.media_source,
t2.user_id,
t2.revenue_date,
t2.total_daily_revenue,
DATE_DIFF(t2.revenue_date, t1.install_cohort_date, DAY) AS days_since_install
FROM UserInstall AS t1
INNER JOIN DailyUserRevenue AS t2
ON t1.user_id = t2.user_id
),- FinalLTV – Cohort LTV Calculation (Window + ARPU)
FinalLTV AS (
SELECT
install_cohort_date,
campaign_id,
media_source,
days_since_install,
COUNT(DISTINCT user_id)
OVER (PARTITION BY install_cohort_date, campaign_id)Contains 4 analytical layers:
- Pulse: DAU, ARPDAU, crashes, trends
- Growth Engine: LTV curves, ROAS recovery
- Retention: Triangle heatmap
- Gameplay Friction: Level‑based churn, economy issues
python3 -m http.server 8000Open:
http://localhost:8000/dashboard.html
Right‑click → Open with Live Server
MIT License


.png)