# Cross Platform Budget Allocator

> Splits ad budget across Google Ads, Meta, Microsoft, LinkedIn, TikTok and other platforms by what the next dollar buys, and plans the yearly marketing budget. Use when asked how to split budget between platforms, next quarter's ad budget, or how much to spend on marketing.

- Skill: `insightful-pipe/cross-platform-budget-allocator` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx get-skill add insightful-pipe/cross-platform-budget-allocator`
- Raw SKILL.md: https://api.skillmd.com/api/skills/insightful-pipe/cross-platform-budget-allocator/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Marketing & Growth
- Author: Insightful-Pipe (https://skillmd.com/u/insightful-pipe)
- Updated: 2026-11-18
- Page: https://skillmd.com/skills/insightful-pipe/cross-platform-budget-allocator

---


# Cross-Platform Budget Allocator

The platform with the lowest average cost per result is not always the best home for the next dollar. Every channel gets dearer as it scales, and each one saturates at a different point. This skill reads every connected ad account, works out what each platform and campaign buys now and what more money would buy, and moves budget to where the next result is cheapest, inside the limits the business sets.

## Before you start

You need the InsightfulPipe MCP connected with at least one ad account. No connection? See "Without a connection" at the end.

1. Call `query_contexts` with `request="accounts"` and **no platform**. That lists every connected source. Note `workspace_id`, `brand_id` and each ad account's id.
2. **Pick one business.** A brand can hold accounts for several businesses (an agency's clients, test accounts). Group the accounts by business, ask which one this plan is for, and never mix two businesses in one plan. Never read a Google Ads manager account directly; use the client accounts under it.
3. Call `query_contexts` with `request="actions_details"` for every action below on each platform you will use, and follow the body shapes it returns.
4. Ask for these, and use the defaults when the user doesn't know:
   - **Mode.** Rebalance the current total (default), propose next quarter's budget, plan the channel mix (including channels not running yet), or plan the whole marketing budget for the year (how much to spend in total, or how to split a total the user already has, by line and month). The ad data pull is the same for all four; the marketing budget mode also asks for the figures in its step A.
   - **Total budget and period.** Default for a rebalance: the last 30 days' spend, kept the same. Default for next quarter: the last 90 days' spend as a monthly run-rate.
   - **What counts as a result,** and its value. Purchase, lead, booked call or sign-up. Default: each platform's own conversion count (see Step 1). If results differ in value between channels or campaigns (a demo request against a newsletter sign-up, a large job against a small one), ask for a value per result. Without one, every result counts the same, and the report says so.
   - **Goal.** A target CPA or ROAS, or "most results within the total". Default: the yardstick in Step 4.
   - **Limits.** A minimum or maximum per platform or campaign, a brand-search amount to leave alone, contracts or commitments, and the share to keep for tests. Default: brand search is left alone, a 10% test reserve in channel-mix and next-quarter modes and none in a rebalance, and no other limits.

## How to run the queries

Every read goes through `query_data` with the platform named in the body. Three windows:
- **Decision window:** the last 30 complete days. `CUR_START` and `CUR_END` are its first and last day; `CUR_END_PLUS_1` is the day after.
- **Trend window:** the 60 days before it, with `PRI_START` and `PRI_END` swapped into the same blocks.
- **Change window:** the last 14 days up to and including today, `CHG_START` to `TODAY` (the run date), for recent budget edits.

Rules:
- **Money:** Google Ads `_micros` fields and Snapchat `spend` are millionths: divide by 1,000,000. Meta `spend` and LinkedIn `costInUsd` arrive as strings. TikTok `spend` arrives as a string in the advertiser's currency. Meta `daily_budget` is in the currency's minor unit (cents for USD).
- **Rates come from totals.** Compute cost per result, ROAS, frequency and shares from summed numerators and denominators, never by averaging campaign or daily rates.
- **An empty result is a zero, not an error.** Meta, LinkedIn, Pinterest, X and OpenAI Ads return an empty list when nothing ran, Snapchat returns a spend of 0, TikTok lists every campaign with zero spend, and a Microsoft Ads report comes back with `data_csv` null. Record the account as idle.
- **Rate limits.** When a call is refused with `rate_limit_exceeded`, wait the `retry_after` seconds and try again. Don't drop the platform.

If a call fails for another reason, keep going, mark that platform **unknown**, and say which call failed and why. Never fill a gap with a guess, and never move money to or from an unknown platform.

## Step 1: pull spend, results, budgets and saturation signals

Skip a platform that isn't connected. When the business has several accounts on one platform, run the block on each.

**Google Ads** (one row per campaign; impression share fields exist for Search campaigns only):
```sql
SELECT campaign.id, campaign.name, campaign.status, campaign.advertising_channel_type,
       campaign.bidding_strategy_type, campaign_budget.amount_micros, campaign_budget.explicitly_shared,
       metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.conversions, metrics.conversions_value,
       metrics.search_impression_share, metrics.search_budget_lost_impression_share,
       metrics.search_rank_lost_impression_share
FROM campaign WHERE segments.date BETWEEN 'CUR_START' AND 'CUR_END' AND metrics.impressions > 0
```
Run it with `action="gaql"` and the `account_id`. `campaign_budget.amount_micros` is **today's** daily budget, which may not be the budget the window ran on (see the next block). For the account's currency and time zone:
```sql
SELECT customer.descriptive_name, customer.currency_code, customer.time_zone FROM customer
```
Budget and bid-target edits in the change window (`change_event` refuses a start date more than 30 days back and needs a LIMIT; the end is today at 23:59:59, because a bare date stops at midnight at the start of that day):
```sql
SELECT change_event.change_date_time, change_event.change_resource_type, change_event.campaign,
       change_event.changed_fields, change_event.client_type, change_event.old_resource, change_event.new_resource
FROM change_event
WHERE change_event.change_date_time >= 'CHG_START' AND change_event.change_date_time <= 'TODAY 23:59:59'
  AND change_event.change_resource_type IN ('CAMPAIGN_BUDGET', 'CAMPAIGN')
ORDER BY change_event.change_date_time DESC LIMIT 200
```
Edits often come in bursts (one bulk edit is many events seconds apart, sometimes up and back down). Judge each campaign by its **net** change: the earliest `old_resource.campaign_budget.amount_micros` in the window against today's budget.

Google's own budget simulations, one per campaign that has one:
```sql
SELECT campaign_simulation.campaign_id, campaign_simulation.type, campaign_simulation.modification_method,
       campaign_simulation.start_date, campaign_simulation.end_date, campaign_simulation.budget_point_list.points
FROM campaign_simulation WHERE campaign_simulation.type = 'BUDGET'
```
Each point has a daily `budget_amount_micros` and Google's estimate of the cost (`cost_micros`) and conversions (`biddable_conversions`; missing means 0) that budget would have bought over the simulation's dates, usually the last 7 days. Cost and conversions are totals for those dates, not per day; marginal cost is a ratio, so that doesn't matter. Most accounts have simulations for only some campaigns.

**Meta** (one row per campaign; `reach` and `frequency` are the saturation signals):
```json
{"platform": "facebook-ads", "action": "get_insights_adaccount", "ad_account_id": "<META_AD_ACCOUNT_ID>",
 "level": "campaign", "time_range": {"since": "CUR_START", "until": "CUR_END"},
 "fields": ["account_currency", "campaign_id", "campaign_name", "objective", "spend", "impressions",
            "reach", "frequency", "inline_link_clicks", "actions", "action_values"]}
```
`actions` and `action_values` are lists of `{action_type, value}`. Count only the action type that matches the result (`purchase`, `lead`, `complete_registration`, an `offsite_conversion.*` type), never every type added together. Engagement types (`post_engagement`, `page_engagement`, `video_view`, `link_click`) are never results. Meta's default attribution includes one-day view-through, so its counts run higher than click-only platforms.

Current Meta budgets:
```json
{"platform": "facebook-ads", "action": "get_campaigns", "ad_account_id": "<META_AD_ACCOUNT_ID>",
 "fields": ["id", "name", "status", "objective", "daily_budget", "lifetime_budget"]}
```
A campaign with no `daily_budget` or `lifetime_budget` keeps its budgets on the ad sets. List them:
```json
{"platform": "facebook-ads", "action": "get_adsets", "ad_account_id": "<META_AD_ACCOUNT_ID>",
 "fields": ["id", "name", "status", "campaign_id", "daily_budget", "lifetime_budget"]}
```
For such a campaign, today's budget is the sum of its active ad sets' `daily_budget` (cents). Keep each ad set's id and budget: a rollout step on that campaign moves each active ad set by the same share, at most 25% of that ad set's own daily budget, and `update_adset` needs the id. An ad set with only a `lifetime_budget` can't be stepped by day: give its new budget as a number for the user to set.

**Microsoft Ads** submits a campaign report, then polls it with the `ReportRequestId` the first call returns:
```json
{"platform": "microsoft-ads", "action": "submit_campaign_performance_report", "account_id": "<MICROSOFT_ADS_ID>",
 "columns": ["CampaignName", "CurrencyCode", "Impressions", "Clicks", "Spend", "Conversions", "Revenue",
             "ImpressionSharePercent", "ImpressionLostToBudgetPercent", "ImpressionLostToRankAggPercent"],
 "aggregation": "Summary",
 "time": {"CustomDateRangeStart": {"Year": 2026, "Month": 9, "Day": 6}, "CustomDateRangeEnd": {"Year": 2026, "Month": 10, "Day": 5},
          "ReportTimeZone": "PacificTimeUSCanadaTijuana"}}
```
```json
{"platform": "microsoft-ads", "action": "poll_report_status", "account_id": "<MICROSOFT_ADS_ID>", "report_request_id": "<REPORT_REQUEST_ID>"}
```
Set `Year`, `Month` and `Day` from `CUR_START` and `CUR_END` (the block shows one 30-day window). When the status is `Success`, the rows are CSV in `data_csv`; null means nothing ran. If it isn't ready, wait a few seconds and poll again.

**LinkedIn Ads** (`approximateMemberReach` gives frequency: impressions ÷ reach):
```json
{"platform": "linkedin-ads", "action": "get_account_analytics", "ad_account_id": "<LINKEDIN_AD_ACCOUNT_ID>",
 "start_date": "CUR_START", "end_date": "CUR_END", "time_granularity": "ALL",
 "fields": ["dateRange", "impressions", "clicks", "costInUsd", "approximateMemberReach",
            "externalWebsiteConversions", "oneClickLeads", "conversionValueInLocalCurrency"]}
```
A LinkedIn lead is `oneClickLeads` (lead-form leads) plus `externalWebsiteConversions`.

**TikTok Ads** (copy the `action` value the helper gives for `integrated_report_basic`). Rows sit in `data.data.list`. The account returns every campaign, including ones that never spent, so keep only rows with spend above 0:
```json
{"platform": "tiktok-ads", "action": "report/integrated/get/", "method": "GET",
 "account_id": "<TIKTOK_ADVERTISER_ID>", "advertiser_id": "<TIKTOK_ADVERTISER_ID>",
 "service_type": "AUCTION", "report_type": "BASIC", "data_level": "AUCTION_CAMPAIGN",
 "start_date": "CUR_START", "end_date": "CUR_END", "page_size": 1000, "dimensions": ["campaign_id"],
 "metrics": ["campaign_name", "spend", "impressions", "reach", "frequency", "clicks", "conversion", "total_purchase_value"]}
```

**Pinterest Ads** keeps analytics for the last 90 days only. A trend window that starts earlier is **outside its window**: don't call; mark the trend unknown.
```json
{"platform": "pinterest-ads", "action": "get_ad_account_analytics", "ad_account_id": "<PINTEREST_AD_ACCOUNT_ID>",
 "start_date": "CUR_START", "end_date": "CUR_END", "granularity": "TOTAL",
 "columns": ["SPEND_IN_DOLLAR", "IMPRESSION_1", "CLICKTHROUGH_1", "TOTAL_CONVERSIONS", "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR"]}
```

**Snapchat Ads** (the account level accepts only `spend`; start and end fall on the hour, so use the next day's midnight to cover the last day):
```json
{"platform": "snapchat-ads", "action": "get_adaccount_stats", "ad_account_id": "<SNAPCHAT_AD_ACCOUNT_ID>",
 "fields": ["spend"], "granularity": "TOTAL",
 "start_time": "CUR_STARTT00:00:00.000Z", "end_time": "CUR_END_PLUS_1T00:00:00.000Z"}
```
When spend is above 0, read the campaigns' results with `get_campaigns` and `get_campaign_stats`, using the bodies `actions_details` gives. That follow-up is untested until it runs on an account with Snapchat spend.

**X Ads** (which campaigns delivered; one call covers at most 90 days):
```json
{"platform": "x-ads", "action": "get_active_entities", "account_id": "<X_ADS_ACCOUNT_ID>", "entity": "CAMPAIGN",
 "start_time": "CUR_STARTT00:00:00Z", "end_time": "CUR_END_PLUS_1T00:00:00Z"}
```
When it lists campaigns, get their spend and results from `get_stats` with the body `actions_details` gives (`billed_charge_local_micro` is spend in millionths). That path is untested until an X campaign delivers.

**OpenAI Ads** (spend, impressions and clicks; no results at this level, so it is judged on site-side results only):
```json
{"platform": "openai-ads", "action": "get_ad_account_insights", "ad_account_id": "<OPENAI_AD_ACCOUNT_ID>",
 "time_ranges": [{"type": "date_range", "since": "CUR_START", "until": "CUR_END"}], "time_granularity": "none",
 "fields": ["ad_account.impressions", "ad_account.clicks", "ad_account.spend"]}
```

**Any other connected ad platform:** call `actions_details` for its account-level stats action and add it only if the call works. Otherwise list it as unknown.

## Step 2: the site-side cross-check (GA4, recommended)

Platforms count results their own way, so a channel can look cheap because it claims more. If GA4 is connected, pull key events by source for the decision window:
```json
{"platform": "google-analytics", "action": "get_report", "property_id": "properties/<GA4_PROPERTY_ID>",
 "dimensions": ["sessionSourceMedium"], "metrics": ["sessions", "keyEvents", "totalRevenue"],
 "start_date": "CUR_START", "end_date": "CUR_END"}
```
Match a row to a platform when its source is the platform's (`google`, `bing`, `facebook`/`fb`/`instagram`/`ig`/`meta`, `linkedin`, `tiktok`, `pinterest`, `snapchat`, `twitter`/`x`) and its medium is paid (`cpc`, `ppc`, `paid`, `paid_social`, `paidsocial`, `cpm`). Use the user's own tags when they differ.

**Claim ratio** = platform results ÷ GA4 key events from its matched sessions. When one platform's ratio is more than 1.5 × another's, both with 10 or more GA4 key events, rank them on site-side cost per result (spend ÷ GA4 key events) instead of their own counts, and say so. When fewer than half a platform's clicks show up as GA4 sessions, its links are probably not tagged: rank it on its own count and flag it.


## Step 3: build the lines

Allocate across **lines**, not just platforms: one line per platform and campaign role.

| Role | How to tell |
|---|---|
| Brand search | a Google or Microsoft campaign with "brand" in its name, or the brand terms the user gives |
| Non-brand search | other Search campaigns |
| Performance Max, Shopping, Display, Video, Demand Gen | Google's `advertising_channel_type` |
| Prospecting | social campaigns not marked as retargeting |
| Retargeting | names with `retarget`, `remarketing`, `RT`, `warm`, `customers` or `existing` |
| Lead forms | LinkedIn `oneClickLeads` above 0, or Meta campaigns with the `lead` objective |

**When only one platform has spend, go one level down: one line per campaign.** Each campaign has its own budget, so it is the lever that can actually move, and a two-line plan (brand and everything else) tells the user nothing. Do the same for any role line that holds campaigns with very different costs per result. Show the grouping and ask the user to confirm it before allocating.

**Current level** of a line = the lower of its 30-day spend and today's budget × 30.4. Google never charges more than 30.4 × the daily budget in a month, so a budget cut made inside the window caps what the line can spend now. Use the same rule for a Meta `daily_budget` (the campaign's, or the sum of its active ad sets'). On platforms where the budget isn't read, the current level is the 30-day spend.

**Floors before verdicts.** A line is **judged** when it has 10 or more results, or has spent 5 × the yardstick (then its few results are evidence enough). Otherwise it is **too little data: hold** at its current level. A platform with fewer than 30 results across its lines can be shifted only in the conservative scenario.

**Settling.** A line whose budget moved more than 20% net in the change window, or whose bid strategy or bid target changed there, is **settling**. Grade it as usual, but schedule any move of its money for 14 days after its last edit, and name it in the report. A line the user says changed its main creative or offer in the last 14 days is treated the same.

## Step 4: score each line

**Yardstick (T):** the user's target CPA, or the blended cost per result of all non-brand lines with spend. Brand search is left out because searches for the business's own name are cheap and would make every other line look worse. In ROAS mode use cost ÷ value the same way.

**Efficiency tier** (cost per result ÷ T):

| Tier | Ratio | Default verdict |
|---|---|---|
| Star | under 0.75 | eligible for more budget if it has headroom |
| Solid | 0.75 to 1.00 | eligible for more budget if it has headroom |
| Borderline | 1.00 to 1.25 | hold |
| Underperformer | 1.25 to 2.00 | cut 25% |
| Bleeder | over 2.00, or no result after 5 × T of spend | cut 50% |

When values per result were given, rank on cost ÷ value instead. When they weren't, add to each Underperformer and Bleeder the break-even value: how many times an average result it would need to be worth to reach T (its ratio). Cuts wait for the user to confirm that value.

**Volume against efficiency:** label each judged line by its share of results (above or below an even share, 1 ÷ number of lines) and whether it is a Star or Solid:
- **Maximize:** a big share, efficient.
- **Niche:** a small share, efficient.
- **Fix before scaling:** a big share, not efficient.
- **Test or cut:** a small share, not efficient.

**Trend:** cost per result in the decision window against the trend window, when both have 10 or more results. **Worsening** above 1.25 ×, **improving** under 0.80 ×, otherwise steady; below the floor, **thin**. A worsening Star gets smaller steps; a worsening Bleeder is cut first.

**Headroom** from the platform's own signals, checked in this order:

| Platform | Rule |
|---|---|
| Google, Microsoft search | lost to rank over 50%: **low**. Else lost to budget 10% or more: **high**. Else impression share 70% or more: **low**. Else **medium**. |
| Meta, TikTok, LinkedIn | 30-day frequency under 2.0: **high**; 2.0 to 3.0: **medium**; over 3.0: **low**. One level lower when CPM rose 20% or more against the trend window while CTR fell. |
| Others, or no signal | **medium**, and say the signal is missing |

More budget doesn't fix a line that loses impression share to rank: say so in its row and point to bids, ads or Quality Score.

**Marginal cost per result** (what the next result costs), from the first source that exists:
1. **Google's budget simulation** for the campaign. Sort the points by budget and take the point nearest today's daily budget. The marginal cost is the extra cost of the next point up divided by the extra conversions it buys. It stays that value until the budget passes the next point, then the next segment applies. No point above the nearest one (even when today's budget sits below it), or no extra conversions, means the simulation can't be used: fall back to the estimate and say why.
2. **An estimate** from headroom: the line's own cost per result × 1.10 (high), × 1.25 (medium) or × 1.50 (low). After each funding step the line takes, move it one headroom level down (high to medium, medium to low). Label it an estimate.

For a line made of several Google campaigns, use the spend-weighted marginal cost of the campaigns that have a simulation, and the estimate for the rest.

## Step 5: allocate

1. **Fixed:** brand search, held lines (too little data, Borderline, no headroom), the user's minimums and maximums, and contracts keep their current level. The **test reserve** R is set aside from the total.
2. **Cuts** by tier, on judged lines only, never below the user's minimum.
3. **The pool** = total − the sum of all current levels − R + the cuts. A positive gap between the total and current levels (for example, when budgets were cut inside the window) joins the pool. When the pool is negative, cut further in the order under "Cutting the total".
4. **Fund** in steps of 5% of the total. Each step goes to the judged Star or Solid line, with headroom above low (counting the steps it has already taken), that has the lowest marginal cost per result, as long as that cost is at or under 1.25 × T. A step can be smaller than 5% when the pool or a cap runs out.
5. **Caps:** no line more than doubles in one plan; the user's maximums win.
6. **Money left over:** first undo cuts, starting with the cut line that has the lowest cost per result. What is still left is reported as **not allocated: no line can use it well**, never pushed onto a weak line.
7. **Concentration:** when one platform holds more than 60% of the plan, say so. It is a dependency risk, not an error; the test reserve is how the plan reduces it.
8. **Cost of a limit:** when a user minimum, maximum or carve-out blocks a move, show the results it costs: the money it holds back ÷ the marginal cost of the line that would have received it.

**Three scenarios,** all inside the same total:
- **Conservative:** cut Bleeders by 25% only, no test reserve, and funding capped at 10% of the total.
- **Balanced (recommended):** Underperformers −25%, Bleeders −50%, the test reserve as set.
- **Aggressive:** Underperformers −50%, Bleeders −100%, the test reserve doubled.

Show a naive split next to them, the total in proportion to 1 ÷ cost per result, as a reference only. It ignores saturation, which is why it is never the recommendation.

**Projection** (per 30 days, against each line's actual 30-day spend):
- Gained = added money ÷ the line's marginal cost per result.
- Lost = removed money ÷ the line's own cost per result. That overstates the loss a little, since a line's last dollars buy the least; say so. A line capped by a budget cut inside the window shows a loss even when the plan doesn't touch it; say which.
- The test reserve counts as zero results until the test has data.
- Show results and blended cost per result before and after for every scenario, with and without the test spend.
- **Confidence:** **high** when every funded line's marginal cost comes from a simulation, every changed line has 10 or more results, and results come from one platform or GA4 agrees with each platform's count. **Low** when GA4 disagrees with a platform's count by more than 1.5 ×, or a changed platform has fewer than 30 results. Otherwise **medium**. List the reasons.

These are estimates. Google's simulations are Google's own models of the last few days, and the headroom multipliers are rules of thumb. Say both plainly.

## Mode: next quarter's budget

1. **Base:** the last 90 days' spend (decision plus trend window ÷ 3) is the monthly total, unless the user gives one.
2. **Seasonality:** if the account ran a year ago, pull the quarter's months last year and the 3 months before them. Index each month by its clicks against the average of those 3 months. For Google Ads:
```sql
SELECT segments.month, metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.conversions
FROM customer WHERE segments.date BETWEEN 'LY_START' AND 'LY_END'
```
   Clicks show demand better than spend, which last year's budgets capped. A month more than 30% off the average may be a pause or a budget cut rather than demand: show its index, hold it at 1.00, and ask the user. With no year-ago data, use no seasonality and say so.
3. **Months:** the Step 5 split × each month's index. The first month is the rollout month: each line gets the average of its weekly levels in that month (and in any later month the rollout still reaches). The test reserve starts in the first full month after the rollout's last step, and stays unspent until then.
4. **The gate** that releases each later month's money: the lines that grew kept their cost per result within 1.25 × the marginal cost used over the previous 4 weeks. When the gate fails, the month's extra money stays unspent.
5. **If the total can grow:** keep walking the funding steps past the plan, with the same caps, and list each step with its marginal cost per result and the results it buys, until no line qualifies (marginal cost over 1.25 × T, headroom dropped to low, or the line has doubled). Track headroom as in Step 4: each step on an estimate line moves it one level down. Show it whenever the user asks how much to spend, not only how to split it.

## Mode: channel mix

For channels the business doesn't run yet. Use the data for what it shows (which intent converts, what a result costs and is worth) and the table below for fit. Ask about the business model, the buyer and the average order or deal value first.

| Channel | Fits when | Watch for |
|---|---|---|
| Google Search | people search for the problem or the product | brand search flatters the blend |
| Microsoft Ads | Google Search works; same intent at a smaller volume | lower volume; import from Google to start |
| Meta | the product can be shown, and a broad consumer or small-business buyer | view-through credit; creative wears out |
| TikTok, Snapchat | a younger buyer, a visual product, video creative available | creative wears out fastest |
| LinkedIn | B2B, a buyer defined by job title, company or industry, and a deal worth a high cost per lead | small audiences saturate; high cost per click |
| Pinterest | planning and shopping categories (home, food, fashion, weddings, events) | a long gap between save and purchase |
| X | conversation-driven topics, tech and media audiences | uneven delivery |
| OpenAI Ads | people ask an AI assistant about the problem | new channel, little benchmark data; judge on site-side results |

**Test budget for a new channel:** enough for 30 results at an expected cost per result of 1.5 × T (new channels start expensive): 30 × 1.5 × T, ideally within 4 to 6 weeks. When the reserve buys less than that in the time available, say when the decision will land and what reserve would bring it forward, or test one channel at a time. Ad platforms also want enough results each week per ad set to finish learning; at low volume, use one campaign and one ad set.
- **Continue** when the test's cost per result is at or under 1.25 × T after 30 results.
- **Kill** when it has spent 3 × T × 10 with fewer than 10 results, or is over 2 × T after 30 results.

Every channel suggestion here is labelled untested until it has data.

## Mode: marketing budget plan (how much to spend, the lines and the months)

Use it when the question is how much to spend on marketing in total, or for a marketing budget plan or template for the year. It sets the total, splits it into lines, phases each line by month and sets the rules for moving money during the year. Only paid media is allocated from ad data. Every other line uses the figures the user gives; a line nobody priced shows as **not priced**, never as a guess. It works from a paste or an upload alone; connected sources replace the typing.

**Two ways in.** When the user asks how much to spend, work through A and B to set the total. When the user already has the total (for example "$200,000 for next year, $60,000 of it committed to content and events; plan the paid part"), don't ask for the goal, revenue, customer value or close rates, and skip B:
- Contingency is 5% of the given total, unless the user says it is already inside another line or wants none.
- What paid media can use = the total − the lines the user priced (commitments and plans) − contingency. Paid media is that amount ÷ 1.1; the remainder is the test reserve (10% of paid media).
- Split paid media with Steps 3 to 5, taking that figure as the total and no further reserve inside Step 5. Below today's paid level, Step 5 cuts in the "Cutting the total" order; above it, its funding steps and "not allocated" rule apply.
- Lines the user didn't price stay **not priced** and take nothing from the total; say that anything they turn out to cost comes out of contingency or paid media. Then continue with C to F. Affordability in B runs only when the user also gives a revenue target and margin.

### A. What to ask

- **The period and its first month.** Default: the next 12 full months.
- **The goal:** a revenue target for the period, or a lead or customer target.
- **Revenue that needs no new marketing:** repeat customers, renewals, service plans. Without it, the whole target counts as new and the report says the total is an upper bound.
- **Average first-year value of a new customer** (order value × orders in the first year, or the first-year contract) and the **gross margin**.
- **Close rates:** won ÷ leads over the last 12 months, by source (paid and unpaid) when the export has a source column. A pasted or uploaded CRM or finance export is enough; a rate needs 30 or more wins behind it, otherwise ask the user for the figure and mark it given, not measured.
- **What marketing cost in the last 12 months, by line:** people (salaries and benefits, or the share of time spent on marketing), agencies and freelancers, tools and software, content and creative, events and sponsorships, paid media.
- **Commitments for the period:** approved hires and raises, retainers, tool contracts, booked events, and any line the user plans to grow or cut.
- **New-customer leads that come without paid media** (organic, referral, direct; repeat customers already sit in the revenue that needs no new marketing): from the CRM export by source. If GA4 is connected, key events by channel group give a cross-check:
```json
{"platform": "google-analytics", "action": "get_report", "property_id": "properties/<GA4_PROPERTY_ID>",
 "dimensions": ["sessionDefaultChannelGroup"], "metrics": ["sessions", "keyEvents"],
 "start_date": "L12_START", "end_date": "L12_END"}
```
  `L12_START` to `L12_END` is the last 12 complete months. Channel groups whose name starts with "Paid" are paid; the rest are unpaid.

### B. Set the total three ways

1. **From the goal.** If `paid-media-math` is installed, use its reverse funnel for the lead and customer counts and carry its figures here. Otherwise:
   - New revenue = target − revenue that needs no new marketing.
   - Customers needed = new revenue ÷ first-year value.
   - Customers from unpaid leads = the last 12 months' unpaid leads × the unpaid close rate, held flat (growth there needs its own funded plan).
   - Paid leads needed = (customers needed − customers from unpaid leads) ÷ the paid close rate, and 0 when that is negative.
   - **Paid media cost.** Start from the paid plan: the recommended split (Step 5) or today's monthly level, × 12, and its results × 12. Fewer leads needed than that: scale the cost down in proportion and say it slightly overstates the saving. More: walk the "if the total can grow" steps (next-quarter mode, item 5), each at its own marginal cost, taking part of a step when that is enough. Leads still missing after the last step that qualifies are **out of reach at an acceptable cost**: show them as a gap with the revenue they stand for, and price nothing for them. Without connected ad accounts, use the user's cost per lead for today's volume and 1.25 × it for any growth, labelled an estimate.
   - Goal total = paid media + the other lines at their planned level (the commitments and plans for the period; last year's figure for a line with neither) + the test reserve (10% of paid media) + contingency (5% of the total, so the total is the rest ÷ 0.95).
2. **A benchmark share of revenue:** the revenue target × a published share, quoted with its source, its year and who was surveyed. Use the user's industry figure when they have one; otherwise the latest edition you can cite of a recurring survey such as the annual Gartner CMO Spend Survey, which mostly surveys companies with more than $1 billion in revenue, so for a smaller business it is a sanity check, not a target. A figure without a source and year is never used; if none can be cited, leave this angle out and say why.
3. **The last 12 months:** the sum of last year's cost lines. Paid media comes from the ad accounts when they are connected (the Google Ads monthly query in next-quarter mode over the 12 months, and each other platform's Step 1 call over the same dates), otherwise from the finance export. Pinterest keeps only 90 days and one X call covers at most 90 days, so take those two from the export.

**When they disagree** (the highest is more than 1.25 × the lowest), say why from the numbers: how many more leads the goal needs than last year, how fast paid cost per lead rises at the margin, who the benchmark describes, and which of last year's costs were one-offs.

**Recommend** the goal total when its close rates and its paid cost rest on 30 or more wins and 30 or more results. Otherwise recommend the last 12 months plus the part of the gap the evidence supports, and mark the plan low confidence.

**Affordability:** gross profit on the new revenue = new revenue × gross margin. When the recommended total is above it, the plan loses money in the period unless customers are worth more over time: say so, show the payback in months if the user gave a repeat or renewal figure, and give the total that breaks even. Also show the total as a share of the revenue target, next to the benchmark.

### C. The lines

| Line | Figure comes from | Fixed or flexible |
|---|---|---|
| People | the user's payroll figure plus approved raises and hires | fixed |
| Agencies and freelancers | contracts and retainers | fixed while the contract runs |
| Tools and software | contracts and subscriptions | fixed |
| Content and creative | the user's plan; last year's figure when there is none | flexible |
| Events and sponsorships | booked and planned events | fixed once booked |
| Paid media | step B, or the amount left of a total the user gave; split across platforms and campaigns with Steps 3 to 5 on that figure, never a second method | flexible |
| Test reserve | 10% of paid media, spent under the test rules in "Mode: channel mix" | flexible |
| Contingency | 5% of the total, held by the budget owner, not assigned to any line | released by rule (section E) |

Show each line's annual amount, share of the total, where the figure came from, and fixed or flexible. Within paid media plus the test reserve, show three parts with their shares: **proven** (every paid line at its level after cuts, before any funding step), **scaling** (the new money in funding steps, from the split and from the growth steps) and **tests** (the reserve).

### D. Phase the months

**Seasonality index,** from the business's own demand, first source that exists:
1. **Sales, orders or jobs by month,** up to the last 24 complete months: a pasted or uploaded export, or Shopify or WooCommerce (blocks below).
2. **Search Console clicks by month** (`search_analytics` with `"dimensions": ["date"]`, summed by month). Search Console keeps about 16 months, so it gives one full year plus a few months to compare. `GSC_START` is the first day of the oldest month it still holds in full (about 490 daily rows, under the 1,000-row limit).
```json
{"platform": "google-search-console", "action": "search_analytics", "site_url": "<SITE_URL>",
 "dimensions": ["date"], "start_date": "GSC_START", "end_date": "L12_END", "row_limit": 1000}
```
3. **DataForSEO monthly search volumes** for the business's 5 to 10 main product or service terms, one paid call (`monthly_searches` covers the last 12 months). Untested: the connector returned an error on both test logins when this mode was built, so if it fails, say so and use the other sources:
```json
{"platform": "dataforseo", "action": "kw_google_ads_search_volume", "keywords": ["<TERM_1>", "<TERM_2>"],
 "location_code": 2840, "language_code": "en"}
```
   Use the market's own `location_code` outside the US.

Shopify orders (untested until a store is connected), summed by month of `created_at`, leaving out `cancelled_at` orders. A walk stops after 40 pages; when `meta.paging.has_more` is true, resume with `page_info` set to `next_page_info`:
```json
{"platform": "shopify", "action": "get_orders", "shop_name": "<SHOP_NAME>", "status": "any",
 "created_at_min": "L24_STARTT00:00:00Z", "created_at_max": "L12_ENDT23:59:59Z",
 "fields": "id,created_at,cancelled_at,total_price", "limit": 250, "auto_paginate": true}
```
`L24_START` is the first day of the 24th complete month back.
WooCommerce sales, one call per month (untested until a store is connected):
```json
{"platform": "woocommerce", "action": "get_sales_report", "filters": {"date_min": "MONTH_START", "date_max": "MONTH_END"}}
```

Index for a calendar month = the average across the years of (that month's value ÷ that year's monthly average). Use the source with the most complete months and show the others beside it as a check. When two years give one month indexes more than 0.30 apart, show both and ask what happened (a promotion, a stock-out, a site change, a heat wave); until the user answers, use the lower one, then rescale all 12 so they average 1.00 (the held month's shown index changes with the rescale). With under 12 months from every source, use flat months and say so.

**Phasing rules:**
- People, tools, agencies and contingency: flat by month (contingency is shown, not spent).
- Events: in the months they happen.
- Content and creative: flat, unless the user ties it to campaigns.
- Paid media: the annual amount × the month's index ÷ 12. No month goes above 1.5 × the average month, because a peak month's last leads cost the most; spread anything above the cap over the other months in proportion to their index.
- Test reserve: evenly over months 2 to 12, so the first month carries the rollout.
- Round each annual amount to the nearest $10, then each month to the nearest $10, and add the rounding difference to the line's largest month (the first of equal months), so every line adds up to its annual amount.

When month 1's paid amount differs from today's run rate by more than 25%, it moves there in rollout steps, as in the report's rollout section.

### E. Rules for moving money during the year

1. **Review monthly,** plan against actual by line. Money moves only at a review, never ad hoc.
2. **Underspend:** a flexible line that spends under 85% of its month two months running gives the unspent part to contingency.
3. **Contingency is released only for:** a paid line that passed its gate (cost per result within 1.25 × the marginal cost used) and still has headroom above low; a month whose demand runs 20% or more above its index; or an approved overrun on a fixed line. Each release names its trigger and who approved it.
4. **Inside paid media,** money moves by this skill's rebalancing triggers and rollout steps.
5. **Limits:** no flexible line moves more than 20% of its annual amount in one quarter without a rerun of section B; fixed lines don't move mid-year.
6. **Quarterly rerun:** recompute section B with actual close rates and costs. When the goal total moves by more than 10%, re-phase the remaining months.
7. **Last quarter:** contingency still unspent goes to the paid line with the lowest marginal cost that has headroom, or back to the business, as the budget owner chooses.

To track plan against actual through the year, use `budget-vs-actual-tracker` (if installed).

### F. The budget sheet

Offer to write the plan to Google Sheets: one row per line with its 12 months, the annual total and fixed or flexible, then the totals row. Writing needs the user's yes and a connected spr

…(truncated)
