charlieviettq/awesome-agent-skill / .claude/skills/algo-ad-budget
"algo-ad-budget"
Verified"Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to distribute budget across multiple campaigns, optimize spend pacing, or maximize overall ROAS under budget constraints — even if they say 'how to split my ad budget', 'campaign budget optimization', or 'diminishing returns on ad spend'.".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.2 KB |
| examples/sample_scenario.md | markdown | 6.4 KB |
| references/attribution-integration.md | markdown | 14.3 KB |
| references/response-curves.md | markdown | 9.0 KB |
examples/sample_scenario.md
View on GitHub# Example: 電商品牌 Q4 旺季廣告預算分配
## Scenario
**公司:** TailorMade 台灣男裝電商
**時間:** 2025年10月初(雙11旺季備戰期)
**情境:** 行銷主管 Vivian 手邊有 NT$500,000 的Q4廣告月預算,目前跨四條渠道投放,但整體 ROAS 只有 2.8。她想在雙11前將預算重新配置,目標是把 ROAS 提升到 3.2 以上。
**現況資料(近三個月各渠道歷史數據):**
| 渠道 | 當前月預算 | 月營收 | ROAS | 備註 |
|------|-----------|--------|------|------|
| Google Search 品牌詞 | $120,000 | $480,000 | 4.0 | 已有3個spend level資料點 |
| Google Search 非品牌詞 | $130,000 | $325,000 | 2.5 | 已有3個spend level資料點 |
| Meta Lookalike 受眾 | $150,000 | $360,000 | 2.4 | 已有4個spend level資料點 |
| YouTube 品牌影片 | $100,000 | $135,000 | 1.35 | 已有3個spend level資料點 |
**約束條件:**
- 總預算不超過 $500,000
- YouTube 最低維持 $30,000(品牌曝光需求)
- Google Search 品牌詞最低 $80,000(品牌保護)
- 每渠道上限 $200,000(單一渠道集中風險)
---
## Analysis
### Phase 1:輸入驗證
各渠道均有 ≥3 個 spend level 歷史資料點,滿足 Gate 條件,可進行反應曲線擬合。
多點資料整理(從過去季報重建):
**Google Search 品牌詞(對數曲線適合):**
| Spend | Revenue | Marginal Revenue / $10K |
|-------|---------|------------------------|
| $80K | $340K | — |
| $100K | $400K | $30K |
| $120K | $480K | $40K |
| $150K | $540K | $20K |
**Google Search 非品牌詞:**
| Spend | Revenue | Marginal Revenue / $10K |
|-------|---------|------------------------|
| $80K | $216K | — |
| $100K | $260K | $22K |
| $130K | $325K | $21.7K |
| $160K | $368K | $14.3K |
**Meta Lookalike:**
| Spend | Revenue | Marginal Revenue / $10K |
|-------|---------|------------------------|
| $80K | $208K | — |
| $110K | $286K | $26K |
| $150K | $360K | $18.5K |
| $180K | $396K | $12K |
**YouTube 品牌影片(邊際回報最低):**
| Spend | Revenue | Marginal Revenue / $10K |
|-------|---------|------------------------|
| $30K | $54K | — |
| $60K | $81K | $9K |
| $80K | $101K | $10K |
| $100K | $135K | $17K(異常高,可能有attribution overlap)|
> ⚠️ **Attribution Overlap 警示:** YouTube $100K 的邊際回報異常上升,與觀測範圍符合的對數曲線不一致。懷疑此區間有跨渠道歸因重疊(YouTube 曝光後 Google Search 轉換被重複計算)。保守處理,採用 $80K 以下觀測值擬合,外插部分打 0.7 折。
---
### Phase 2:邊際回報均等化
**等邊際回報原則:** 逐步將下一個 $10K 分配給當前邊際 ROAS 最高的渠道,直到總預算用完。
使用 Greedy 迭代分配,起點為各渠道下限(品牌Search $80K、非品牌Search $80K、Meta $80K、YouTube $30K = 合計 $270K),剩餘 $230K 待分配。
**迭代過程(每輪分配 $10K):**
| 輪次 | 分配渠道 | 當前邊際ROAS | 累計各渠道預算 |
|------|---------|-------------|--------------|
| 1-3 | Brand Search | ~4.0 | Brand: $110K |
| 4-5 | Meta | ~2.6 | Meta: $100K |
| 6-7 | Non-Brand | ~2.2 | Non-Brand: $100K |
| 8-10 | Brand Search | ~2.0 | Brand: $140K |
| 11-13| Meta | ~1.85 | Meta: $130K |
| 14-16| Non-Brand | ~1.75 | Non-Brand: $130K |
| 17-19| Brand Search → 達上限$200K | — | Brand: $200K |
| 20-23| Meta | ~1.5 | Meta: $170K |
分配完畢,$500K 耗盡。**邊際 ROAS 均等化點約落在 1.4~1.6 區間。**
---
### Phase 3:驗證
| 檢查項 | 結果 |
|--------|------|
| 總預算 = $500K | $200K + $130K + $170K + $0K... |
重新計算:$200K(Brand)+ $130K(Non-Brand)+ $140K(Meta)+ $30K(YouTube)= **$500K ✓**
| 約束項 | 檢查 |
|--------|------|
| Brand Search ≥ $80K | $200K ✓ |
| YouTube ≥ $30K | $30K ✓(已達下限,不再加碼) |
| 各渠道 ≤ $200K | Brand $200K(達上限)✓,其他均低於 ✓ |
| 邊際 ROAS 近似均等 | 各渠道收斂於 1.4–1.6 ✓ |
---
### Phase 4:預期績效推算
| 渠道 | 新預算 | 預期營收 | 預期 ROAS |
|------|--------|---------|----------|
| Google Search 品牌詞 | $200,000 | $640,000 | 3.2 |
| Google Search 非品牌詞 | $130,000 | $325,000 | 2.5 |
| Meta Lookalike | $140,000 | $350,000 | 2.5 |
| YouTube 品牌影片 | $30,000 | $54,000 | 1.8 |
---
## Result
```json
{
"allocation": [
{
"campaign": "Google Search 品牌詞",
"budget": 200000,
"expected_revenue": 640000,
"expected_roas": 3.2
},
{
"campaign": "Google Search 非品牌詞",
"budget": 130000,
"expected_revenue": 325000,
"expected_roas": 2.5
},
{
"campaign": "Meta Lookalike",
"budget": 140000,
"expected_revenue": 350000,
"expected_roas": 2.5
},
{
"campaign": "YouTube 品牌影片",
"budget": 30000,
"expected_revenue": 54000,
"expected_roas": 1.8
}
],
"total": {
"budget": 500000,
"expected_revenue": 1369000,
"blended_roas": 2.74
},
"metadata": {
"optimization_method": "greedy_marginal",
"response_model": "log_curve",
"attribution_note": "YouTube marginal ROAS above $80K discounted 0.7x due to suspected cross-channel attribution overlap"
}
}
```
**關鍵決策說明:**
1. **Brand Search 大幅加碼至上限 $200K**:邊際回報最高,擴張空間明確。
2. **YouTube 降至下限 $30K**:邊際回報最低且有 attribution overlap 疑慮,維持品牌曝光最低量即可。
3. **Meta 從 $150K 降至 $140K**:略微削減,讓預算流向邊際回報更高的 Brand Search。
4. **整體 ROAS 從 2.8 → 2.74**:注意,加權平均 ROAS 下降,但**總營收從 $1,300,000 提升至 $1,369,000**(+5.3%),絕對獲利更高——這正是等邊際回報原則的核心:最大化總回報,而非最大化平均效率。
**給 Vivian 的後續行動:**
- 雙11前第一週執行新配置,監控 Brand Search 在 $200K 附近的邊際回報是否如預期
- 若 Non-Brand 在 $130K 仍有高邊際回報,下個月可嘗試推至 $160K
- YouTube attribution 問題需要與資料團隊確認 view-through 視窗設定
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |