> A/B testing every price point is impractical. Here's how CCFish uses price elasticity models, purchase funnel analytics, and serverless workers to optimize IAP pricing — achieving a 27% revenue lift without running a single multivariate price test.
The Pricing Problem
Mobile game monetization is notoriously hard to optimize. The standard approach — A/B test every price point for every item in every market — is impractical for small teams. With 50+ IAP items across 10+ currency regions, you'd need thousands of experiment variants.
CCFish faced this exact problem. A small team, limited data science resources, and a growing catalog of in-game purchases. They needed a pricing optimization system that worked with the data they already had, not one that required expensive experiment infrastructure.
The Solution: Analytics-Driven Pricing Models
CCFish built a pricing intelligence pipeline that runs entirely on Cloudflare Workers and D1:
```
Raw Purchase Data → Price Elasticity Model → Optimal Price Point → Auto-Update IAP Config
```
Step 1: Collect Purchase Funnel Data
Every IAP interaction is logged to D1:
```typescript
// CCFish IAP tracking worker
async function logIAPEvent(playerId: string, itemSku: string, eventType: string, price?: number) {
await env.DB.prepare(
`INSERT INTO iap_events (player_id, item_sku, event_type, price, timestamp)
VALUES (?, ?, ?, ?, ?)`
).bind(playerId, itemSku, eventType, price || null, Date.now()).run();
}
```
Events tracked per item:
- `impression` — player saw the offer
- `detail_view` — player opened the purchase screen
- `checkout_started` — player began the purchase flow
- `purchase_completed` — transaction succeeded
- `purchase_cancelled` — player abandoned at payment step
Step 2: Build Price Elasticity Curves
CCFish aggregates purchase data by item SKU and price point to estimate price elasticity:
```sql
-- Daily cron: compute price elasticity per item
SELECT
item_sku,
price,
COUNT(DISTINCT CASE WHEN event_type = 'impression' THEN player_id END) as impressions,
COUNT(DISTINCT CASE WHEN event_type = 'purchase_completed' THEN player_id END) as purchases,
ROUND(
COUNT(DISTINCT CASE WHEN event_type = 'purchase_completed' THEN player_id END) * 1.0 /
NULLIF(COUNT(DISTINCT CASE WHEN event_type = 'impression' THEN player_id END), 0),
4
) as conversion_rate
FROM iap_events
WHERE timestamp > strftime('%s','now','-30 days') * 1000
GROUP BY item_sku, price
ORDER BY item_sku, price;
```
Step 3: Find the Revenue-Optimal Price
CCFish uses a simple but effective model: revenue = impressions × conversion_rate × price. The system finds the price that maximizes this product for each item:
```python
Simplified pricing optimizer (runs daily as a cron worker)
import json
def optimal_price(purchase_data: list) -> dict:
"""Find price that maximizes revenue across available data points."""
best = {"price": 0, "revenue": 0, "confidence": 0}
for point in purchase_data:
estimated_revenue = point["impressions"] * point["conversion_rate"] * point["price"]
if estimated_revenue > best["revenue"] and point["samples"] > 100:
best = {
"price": point["price"],
"revenue": estimated_revenue,
"confidence": min(1.0, point["samples"] / 1000)
}
return best
```
Step 4: Auto-Update IAP Pricing via KV
Optimal prices are written to Cloudflare KV, which the game client reads on startup:
```typescript
// Apply optimal pricing
async function applyPricing(env: Env) {
const items = await env.DB.prepare(
"SELECT item_sku, optimal_price FROM pricing_model WHERE confidence > 0.7"
).all();
for (const item of items.results) {
await env.PRICING_CACHE.put(
`iap:${item.item_sku}`,
JSON.stringify({ price: item.optimal_price, updated_at: Date.now() })
);
}
}
```
Architecture Overview
| Component | Tech | Cost | Function |
|-----------|------|------|----------|
| Event collection | Cloudflare Worker | $0 (included) | Logs every IAP interaction |
| Data storage | D1 | $0.89/month | Stores raw purchase events |
| Pricing model | Cron Worker | $0 (under free tier) | Daily price optimization |
| Price cache | KV | $0.50/month | Serves prices to game clients |
| Dashboard | EmDash CMS | Included | Visualizes pricing performance |
Results
- **27% revenue lift** in the first 30 days after optimization
- **3.4x improvement** in checkout-to-purchase conversion
- **Zero additional A/B testing infrastructure** required
- **9 regions** with optimized pricing (vs. flat global pricing before)
Key Takeaways
1. **You already have the data.** Most games collect purchase funnels but don't analyze them.
2. **Price elasticity is real.** A $0.99 item optimized to $1.49 can increase revenue by 40% if demand is inelastic.
3. **Serverless makes it affordable.** CCFish's entire pricing optimization pipeline costs under $2/month.
4. **Regional pricing is essential.** A price that works in the US may be prohibitive in Southeast Asia. The model handles this automatically.
5. **Start simple, iterate.** The basic revenue-maximization model works well. CCFish plans to add ML-based demand forecasting in Q3.