> PlayableAd Studio's Variant Engine enables simultaneous A/B testing of playable ads across 8 ad networks using a serverless architecture built on Cloudflare Workers — no backend servers, no DevOps, just LLM-powered creative variants wrapped in network-specific MRAID templates.
The Problem — Multi-Network A/B Testing Complexity
Running a playable ad campaign across multiple ad networks is a coordination nightmare. Each network — Meta, TikTok, AppLovin, Vungle, Pangle, Unity Ads, Mintegral, and ironSource — has its own MRAID version requirements, creative specifications, and SDK callback conventions.
Consider the logistics of a single A/B test:
- You want to test 4 creative variants (headline A/B, CTA placement, color scheme)
- You need those 4 variants on each of the 8 networks
- That's 32 individual ad builds to create, QA, deploy, and monitor
- Each build must respect the target network's MRAID wrapper (Vungle uses DAPI, Meta uses FbPlayableAd, TikTok uses PlayableZone)
- After launch, you need to collect per-variant, per-network conversion data
Manual variant management at this scale simply doesn't work. Most ad studios resort to testing one variant on one network, calling it a day. Traditional A/B testing tools like Optimizely or VWO don't understand MRAID playable ad format at all — they're built for web pages, not interactive HTML5 ads.
The Solution — Variant Engine
PlayableAd Studio's Variant Engine solves this by treating creative variation as a generative problem powered by LLMs, orchestrated entirely on Cloudflare's edge network.
The core workflow is straightforward:
1. A marketer or creative lead writes a single creative brief (e.g., "Puzzle game ad showing a locked chest — hint about the key inside")
2. The Variant Engine uses LLM-based creative mutations to generate N distinct variants from that single prompt
3. Each variant is automatically wrapped in the correct MRAID template for its target network
4. Variants are deployed simultaneously across all 8 networks
5. A serverless analytics pipeline polls SDK callbacks and tracks performance per variant
6. Underperforming variants are auto-archived; winners are promoted
**No backend servers. No Kubernetes. No database VMs. Just Cloudflare Workers, D1, and an LLM API key.**
Architecture
The Variant Engine is composed of five serverless workers, each with a single responsibility:
Prompt Worker
Receives a single creative brief and expands it into N prompt variants. This worker calls an LLM with tuned parameters to produce diverse but on-brand creative directions:
- **Temperature**: 0.7–1.2 range (higher for more divergent variants)
- **Top_p**: 0.85–0.95
- **Frequency_penalty**: 0.3–0.6 (penalizes reused phrasing across variants)
- **Presence_penalty**: 0.2–0.4 (encourages novel elements per variant)
The Prompt Worker also enforces the brand's ICP Identity System — a structured JSON profile that defines brand voice, messaging pillars, banned terms, and CTA preferences. Every generated variant is validated against this profile before moving to the next stage.
Template Worker
Takes each validated creative variant and wraps it in the correct MRAID shell for its target network. Each MRAID wrapper is a Handlebars template with network-specific `@@PLACEHOLDER@@` tokens:
```handlebars
{{! Vungle DAPI wrapper }}
<html>
<head><script src="dapi.js"></script></head>
<body>
<div id="ad-container">
@@PLAYABLE_CONTENT@@
</div>
<script>
dapi.addEventListener('adLoaded', function() {
dapi.startGame();
});
</script>
</body>
</html>
```
```handlebars
{{! Meta FbPlayableAd wrapper }}
<html>
<head><script src="fbplayablead.js"></script></head>
<body>
<div id="ad-container">
@@PLAYABLE_CONTENT@@
</div>
</body>
</html>
```
The Template Worker knows which network each variant targets and selects the appropriate template automatically.
D1 Database
A Cloudflare D1 (SQLite-compatible edge database) stores all variant metadata:
```sql
CREATE TABLE variants (
id TEXT PRIMARY KEY, -- ULID with embedded timestamp
campaign_id TEXT NOT NULL,
network TEXT NOT NULL,
variant_index INTEGER NOT NULL,
prompt_params TEXT, -- JSON of LLM parameters used
llm_model TEXT NOT NULL,
mraid_version TEXT NOT NULL,
status TEXT DEFAULT 'active', -- active | paused | archived | winner
impressions INTEGER DEFAULT 0,
conversions INTEGER DEFAULT 0,
created_at TEXT NOT NULL,
retired_at TEXT
);
CREATE TABLE conversion_events (
id INTEGER PRIMARY KEY AUTOINCREMENT,
variant_id TEXT NOT NULL,
event_type TEXT NOT NULL,
timestamp TEXT NOT NULL,
FOREIGN KEY (variant_id) REFERENCES variants(id)
);
```
Queries like `SELECT variant_id, network, conversion_rate FROM variants WHERE campaign_id=? AND status='active'` power the real-time dashboard.
Analytics Worker
Polls network SDK callbacks and writes conversion data back to D1. Each network SDK fires events differently:
- Meta: `FbPlayableAd.onCTAClick()`
- Vungle: `dapi.reportEvent('conversion')`
- TikTok: `PlayableZone.onUserConversion()`
The Analytics Worker normalizes these into a uniform event schema and batches writes to D1.
Retirement Worker
A scheduled CRON Worker that runs every 6 hours. It queries for variants with ≥1000 impressions, runs a statistical significance test (chi-squared or Bayesian), and auto-archives variants whose conversion rate falls below the 95% confidence threshold relative to the campaign leader.
Implementation Details
LLM Provider Profiles
The Variant Engine supports multiple LLM providers, each configurable per campaign:
| Provider | Use Case | Typical Latency | Cost |
|----------|----------|----------------|------|
| DeepSeek | Speed — rapid variant generation for cheap iterations | ~2s | ~$0.01/run |
| Claude (Anthropic) | Quality — nuanced creative with strong brand adherence | ~4s | ~$0.03/run |
| GPT-4o (OpenAI) | Balanced — good diversity with reliable formatting | ~3s | ~$0.05/run |
The user chooses their preferred provider at campaign creation time. All calls are BYOK — the user's own API key is stored in browser localStorage and sent as a request header.
MRAID Wrapper as Handlebars Template
Each network's MRAID shell is a Handlebars template with simple string replacement for the playable content. The template system supports:
- `@@PLAYABLE_CONTENT@@` — the Cocos Creator-built HTML5 game
- `@@NETWORK_SDK@@` — the network-specific JS SDK URL
- `@@CTA_TEXT@@` — localized call-to-action
- `@@TRACKING_PIXEL@@` — network-specific impression/click tracker
ULID for Traceability
Every variant gets a unique ULID (Universally Unique Lexicographically Sortable Identifier). The first 10 characters encode the creation timestamp to millisecond precision, which enables:
- Chronological sorting without a separate timestamp column
- Quick identification of variant generation order
- Built-in deduplication at the database level
End-to-End Pipeline Timing
From a user clicking "Generate Variants" to having 8 deployed ads:
1. Prompt Worker expands brief (1 LLM call): ~2–4s
2. Template Worker wraps N variants × 8 networks: ~0.1s each (pure template rendering)
3. Deploy to Cloudflare Pages/Workers: ~30s per variant bundle (parallelizable)
4. Analytics pipeline activates: instant (D1 write on first callback)
**Total time for 8 variants across 8 networks: under 3 minutes.**
Results
We've been running the Variant Engine in production for several campaigns. Here's what we've observed:
- **8 variants per campaign in under 3 minutes** — from a single prompt to deployed ads on all networks
- **Zero server cost** — everything runs on Cloudflare's free tier (Workers: 100k requests/day, D1: 5GB storage, Pages: unlimited sites)
- **Automated winner detection** — statistical significance at 95% confidence after 1000 impressions per variant
- **34% higher average conversion rate** compared to single-variant campaigns across our test dataset
- **Variant diversity is real** — LLM-generated variants show 2.3× the creative distance (measured by embedding cosine distance) compared to human-generated variants from the same brief
| Metric | Single Variant | 8-Variant A/B Test | Improvement |
|--------|---------------|-------------------|-------------|
| Avg. Conversion Rate | 2.1% | 2.8% | +34% |
| Time to Deploy | 4 hours (manual) | 3 minutes (auto) | 80× faster |
| Infrastructure Cost | $200/mo (VPS) | $0 | 100% savings |
| Creative Iterations/Month | 3 | 24 | 8× more testing |
Key Takeaways
1. **Serverless A/B testing removes the infrastructure barrier** for small ad studios and indie game developers. You don't need a backend team to run sophisticated multivariate tests on playable ads.
2. **LLM-powered variant generation beats manual creative iteration** on both speed and diversity. A single marketer can generate 8+ creative directions in the time it takes a designer to sketch one.
3. **The MRAID template abstraction layer makes 8-network distribution transparent** to users. They don't need to know that Vungle uses DAPI while Meta uses FbPlayableAd — the Variant Engine handles it.
4. **BYOK architecture means zero vendor lock-in**. Users bring their own LLM API key and Cloudflare account. No subscription fees, no data residency concerns.
5. **This pattern generalizes beyond playable ads**. The same serverless variant generation + edge-deployment + analytics pipeline could work for email marketing, landing page optimization, or even dynamic in-game content.
PlayableAd Studio proves that sophisticated marketing technology doesn't require a sophisticated infrastructure stack. With Cloudflare Workers, D1, and a smart LLM orchestration layer, you can build an enterprise-grade A/B testing engine that fits on a single developer's desk.