# Marketing Performance Report

> Writes marketing reports across ad platforms, GA4, Search Console and Klaviyo, from weekly updates and monthly client reports to QBR or board decks, campaign wrap-ups and batch agency reports. Use when asked for a marketing report, a monthly client report, a QBR deck, or a campaign recap.

- Skill: `insightful-pipe/marketing-performance-report` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx get-skill add insightful-pipe/marketing-performance-report`
- Raw SKILL.md: https://api.skillmd.com/api/skills/insightful-pipe/marketing-performance-report/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/marketing-performance-report

---


# Marketing Performance Report

One report across all connected sources, built from live data. The skill finds the accounts, pulls the numbers, checks they agree with each other, and only then writes. Every number in the report comes from a call in this run, or from a file the user pasted.

Besides the regular reports it has three bigger jobs, each in its own section below: a **business review deck** (quarterly, annual or board), a **campaign wrap-up**, and **batch client reports** for an agency.

## Before you start

With the InsightfulPipe MCP connected, the skill pulls everything itself. Without it, see "Without a connection" below.

1. Call `query_contexts` with `request="accounts"` and **no platform**. That lists every connected source. Note `workspace_id`, `brand_id` and each source's id (`account_id`, `ad_account_id`, `property_id`, `site_url`).
2. **Pick one business.** A brand can hold accounts for several businesses (an agency's clients, test accounts). Group the sources by business using the account names. Ask the user which business the report is for, and never put two businesses in one report. If an account's owner is unclear, ask before using it.
3. Call `query_contexts` with `request="actions_details"` for each action below on each platform you will use, and follow the body shapes it returns.
4. Ask three things, and use the defaults if the user doesn't say:
   - **Shape:** weekly report, monthly client report, executive one-pager, stand-up brief, business review deck (QBR, annual or board), campaign wrap-up, or batch client reports. Default: weekly report.
   - **Period.** Default for weekly: the last complete Monday-Sunday week, against the week before. Default for monthly: the last complete calendar month, against the month before. The deck and the wrap-up set their own windows in their sections.
   - **The one result that matters** (leads, sign-ups, purchases, revenue) and a target cost per result if there is one. Default: the GA4 key events, and no target.

GA4 keeps processing for about two days, so the period must end at least two days before today. If it doesn't, say so and mark the last days provisional.

## Without a connection

Every shape works from what the user pastes or uploads: platform CSV exports, a past report, a campaign brief, a client list. Then:
- Read the dates, currency and time zone from each file's headers, and ask when one is missing.
- Run the trust checks the files allow (T1 needs GA4 organic sessions and Search Console clicks, T3 a daily sessions column) and mark the others **skip, no data pasted**.
- Keep every other rule: the floors, rates from totals, platform results never added together. Each number names the file it came from.
- Exports from platforms InsightfulPipe doesn't connect (a CRM, Amazon Ads, Reddit Ads) are fine as files. Never write that they were pulled live.

When a source is connected and the user also pastes its export, use the live data and list where the two differ.

## How to run the queries

Every read goes through `query_data` with the platform named in the body. Run each one twice: once for the current period (`CUR_START` to `CUR_END`) and once for the prior period (`PRI_START` to `PRI_END`). When the business has more than one account or site on a platform, run the calls on each one. Skip a platform that isn't connected.

- **Money:** Google Ads `_micros` fields and Snapchat `spend` divide by 1,000,000. LinkedIn `costInUsd` and Meta `spend` arrive as strings. Put everything in one currency, and state it at the top.
- **Rates come from totals.** Compute CTR, conversion rate and cost per result from summed numerator and denominator, never by averaging daily or per-campaign rates.
- **An empty result is a zero, not an error.** Meta, LinkedIn, TikTok, Pinterest, X and OpenAI Ads return an empty list when nothing ran, and a Microsoft Ads report comes back with no CSV. Record the source as idle.
- **Rate limits.** When a call is refused with `rate_limit_exceeded`, wait the `retry_after` seconds and try again. Don't skip the source.
- **A source that needs reconnecting** (the call answers with a reconnect, expired-token or permission error) goes in the source list as broken. Report without it and tell the user to reconnect it.

If a call fails for any other reason, keep going, mark that source **unknown**, and say which call failed and why. Never fill a gap with a guess.

## Step 1: the source inventory

List every connected source of the kinds this report reads, with one status each: ad accounts, GA4 properties, Search Console and Bing sites, and Klaviyo. Go through the whole `accounts` list platform by platform, and query every account of the business, not only the first one on each platform. Accounts of other businesses on the same brand are listed too, as left out, without their names.

| Status | Meaning |
|---|---|
| active | returned data in the current or prior period |
| idle | the calls worked but show nothing in either period: no spend on an ad account, no clicks on a search site, no sessions on a GA4 property, nothing sent from Klaviyo |
| broken | the call failed because the connection needs attention |
| unknown | the call failed for another reason, or no account-level call worked for that platform |
| left out | belongs to another business, or its owner is unclear |

The regular reports and the deck don't read organic social pages and profiles, video channels or business listings. Name any that are connected in one line under the inventory as not covered, so nobody reads them as checked. The campaign wrap-up is the one exception: it reads the campaign's posts from Facebook Pages, Instagram and LinkedIn Pages, and its sources line says which of them were searched. Tools that hold no performance data (Tag Manager, Sheets, Slack and the like) are not sources; leave them out.

The inventory goes in every report shape, even the stand-up brief (as one line). A report that silently drops a source reads as if it was checked. Never write that no ads ran unless every ad account of the business was queried for both periods.

## Step 2: pull the data

### Paid media

**Google Ads** (account totals, then campaigns):
```json
{"platform": "google-ads", "action": "gaql", "account_id": "<GOOGLE_ADS_ID>",
 "query": "SELECT customer.descriptive_name, customer.currency_code, metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.conversions, metrics.conversions_value FROM customer WHERE segments.date BETWEEN 'CUR_START' AND 'CUR_END'"}
```
```json
{"platform": "google-ads", "action": "campaign_performance_report", "account_id": "<GOOGLE_ADS_ID>",
 "start_date": "CUR_START", "end_date": "CUR_END", "limit": 50}
```
Never report a manager account; use the client accounts under it. `campaign_performance_report` also returns removed and paused campaigns with zero rows, so keep only rows with impressions above 0.

**Meta** (account totals, then campaigns):
```json
{"platform": "facebook-ads", "action": "get_insights_adaccount", "ad_account_id": "<META_AD_ACCOUNT_ID>",
 "level": "account", "time_range": {"since": "CUR_START", "until": "CUR_END"},
 "fields": ["account_name", "account_currency", "spend", "impressions", "clicks", "inline_link_clicks", "actions", "action_values"]}
```
```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": ["campaign_name", "objective", "spend", "impressions", "inline_link_clicks", "actions", "action_values"]}
```
Meta's `actions` is a list of `{action_type, value}`. Count only the action types that match the result the user named (for example `lead`, `complete_registration`, `purchase`). Never add up every action type.

**LinkedIn Ads:**
```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", "externalWebsiteConversions", "oneClickLeads"]}
```
A result is `externalWebsiteConversions` plus `oneClickLeads` (lead-form leads).

**TikTok Ads** (the `integrated_report_basic` action; copy the `action` value the helper gives). Rows sit in `data.data.list`; an empty list means no delivery:
```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_ADVERTISER",
 "start_date": "CUR_START", "end_date": "CUR_END",
 "dimensions": ["advertiser_id"], "metrics": ["spend", "impressions", "clicks", "conversion"]}
```

**Microsoft Ads, Pinterest, Snapchat, X and OpenAI Ads** get account-level reads only, enough to show spend and whether anything ran.

**Microsoft Ads** submits a report, then polls it with the `ReportRequestId` the first call returns:
```json
{"platform": "microsoft-ads", "action": "submit_account_performance_report", "account_id": "<MICROSOFT_ADS_ID>",
 "columns": ["AccountName", "CurrencyCode", "Impressions", "Clicks", "Spend", "Conversions"], "aggregation": "Summary",
 "time": {"CustomDateRangeStart": {"Year": 2026, "Month": 9, "Day": 1}, "CustomDateRangeEnd": {"Year": 2026, "Month": 9, "Day": 30},
          "ReportTimeZone": "PacificTimeUSCanadaTijuana"}}
```
```json
{"platform": "microsoft-ads", "action": "poll_report_status", "account_id": "<MICROSOFT_ADS_ID>", "report_request_id": "<REPORT_REQUEST_ID>"}
```
`Year`, `Month` and `Day` are numbers: set them from `CUR_START` and `CUR_END` (the block shows September 2026). `Summary` aggregation refuses a `TimePeriod` column. When `report_status` is `Success`, the rows are CSV in `data_csv`, and `data_csv` null means the account had no rows in the period, so nothing ran. If the status isn't `Success` yet, wait a few seconds and poll again.

**Pinterest Ads** (analytics go back 90 days only; if the prior period is older, say it can't be pulled):
```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"]}
```

**Snapchat Ads** (the account level takes only `spend`; when it is above 0, get clicks and results from `get_campaign_stats`, with the body `actions_details` gives):
```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"}
```

**X Ads** (which campaigns delivered in the period; an empty list means none did):
```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 clicks from `get_stats` with `entity` `CAMPAIGN` and the body `actions_details` gives: at most 20 ids and 7 days a call, so add the weeks up. At the account level `get_stats` returns engagement counts only, no spend.

**OpenAI Ads** (spend, impressions and clicks; no results at the account level):
```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 as a row only if the call succeeds. Otherwise list it as unknown. Don't guess its numbers from another platform.

### Website (GA4)

```json
{"platform": "google-analytics", "action": "get_report", "property_id": "<GA4_PROPERTY>",
 "metrics": ["sessions", "totalUsers", "engagedSessions", "keyEvents", "totalRevenue"],
 "start_date": "CUR_START", "end_date": "CUR_END"}
```
```json
{"platform": "google-analytics", "action": "get_report", "property_id": "<GA4_PROPERTY>",
 "dimensions": ["sessionDefaultChannelGroup"],
 "metrics": ["sessions", "engagedSessions", "keyEvents", "totalRevenue"],
 "start_date": "CUR_START", "end_date": "CUR_END"}
```
```json
{"platform": "google-analytics", "action": "get_report", "property_id": "<GA4_PROPERTY>",
 "dimensions": ["eventName"], "metrics": ["keyEvents"],
 "start_date": "CUR_START", "end_date": "CUR_END"}
```
```json
{"platform": "google-analytics", "action": "get_report", "property_id": "<GA4_PROPERTY>",
 "dimensions": ["date"], "metrics": ["sessions"],
 "start_date": "PRI_START", "end_date": "CUR_END"}
```
The last one is a daily line across both periods. Sort it by date and fill missing days with 0. A run of zero or near-zero days after normal days means tracking broke, not that traffic stopped.

The `eventName` call returns only events with key events in the period; an empty result means 0 key events, not a failed call. Test events (names with `test` or `qa` in them) are not results: list them separately and leave them out of the count.

### Organic search

```json
{"platform": "google-search-console", "action": "search_analytics", "site_url": "<GSC_SITE>",
 "dimensions": ["date"], "start_date": "CUR_START", "end_date": "CUR_END", "row_limit": 500}
```
```json
{"platform": "google-search-console", "action": "search_analytics", "site_url": "<GSC_SITE>",
 "dimensions": ["query"], "start_date": "CUR_START", "end_date": "CUR_END", "row_limit": 1000}
```
Sum clicks and impressions from the date rows. **Search Console lags two to three days**, so count the dates that came back. When the two periods have a different number of days (on one site, a month came back with 29 of its 30 days), compare daily averages and say so. Average position is impressions-weighted: sum of (position x impressions) over sum of impressions. The `ctr` field comes back as a percentage (2.88 means 2.88%).

**More than one site.** Run both calls on every Search Console site of the business (and the Bing call on every Bing site) and add the sites together for the KPI rows, unless one property contains another (a domain property `sc-domain:example.com` already includes `https://example.com/`); then count only the domain property. Say which sites the totals cover. If the sites returned different numbers of days, compare each site on its own daily average instead of adding them.

**Brand vs non-brand.** Split the query rows into brand (the business name and its misspellings) and non-brand. Search Console leaves rare queries out of query rows for privacy, and the call stops at `row_limit`, so the rows never add up to the date total: state what share of total clicks they cover (on one site, 1,000 rows covered only about 60%). The Step 4 floor applies here too: when brand or non-brand clicks are under 100 in either period, show both numbers and call it too small, not a rise or a fall. Above the floor, compare brand, non-brand and single queries on daily averages, dividing by the days the date call returned for each period, as for the totals. Brand clicks show demand you already have; non-brand clicks show reach you are earning.

```json
{"platform": "bing-webmaster", "action": "get_rank_and_traffic_stats", "site_url": "<BING_SITE>"}
```
Bing returns about six months of daily rows in one call, with dates as `/Date(<epoch ms>)/` at UTC midnight. Convert them, keep only the rows inside each period, and sum `Clicks` and `Impressions`.

### Email (Klaviyo)

```json
{"platform": "klaviyo", "action": "get_campaign_report",
 "body": {"data": {"type": "campaign-values-report", "attributes": {
   "timeframe": {"start": "CUR_STARTT00:00:00Z", "end": "CUR_END_PLUS_1T00:00:00Z"},
   "statistics": ["recipients", "delivered", "opens_unique", "clicks_unique", "conversions", "conversion_value", "unsubscribes"]}}}}
```
```json
{"platform": "klaviyo", "action": "get_flow_report",
 "body": {"data": {"type": "flow-values-report", "attributes": {
   "timeframe": {"start": "CUR_STARTT00:00:00Z", "end": "CUR_END_PLUS_1T00:00:00Z"},
   "statistics": ["recipients", "delivered", "opens_unique", "clicks_unique", "conversions", "conversion_value", "unsubscribes"]}}}}
```
The timeframe end is exclusive, so use the day after `CUR_END`. Empty `results` means nothing was sent. Conversions use the account's "Placed Order" metric unless you pass `conversion_metric_id`; say which metric counted.

## Step 3: the trust checks (before any writing)

Run these on the data you pulled. Each is **pass**, **warn**, **fail**, or **skip** where its row gives a skip rule. The report lists every warn and fail with what it means, then one line naming the checks that passed or were skipped. A fail changes what the report may claim.

| Check | How | Warn / fail |
|---|---|---|
| T1. GA4 sees organic search | GA4 "Organic Search" sessions ÷ (Search Console clicks + Bing clicks) | warn below 0.6, fail below 0.3. On a fail, GA4 is undercounting: take organic reach from Search Console and say GA4 site totals are not reliable. |
| T2. GA4 sees paid clicks | GA4 "Paid Search" + "Paid Social" sessions ÷ ad clicks (link clicks for Meta) | warn below 0.5. Check auto-tagging, UTM tags and the consent banner. Skip when ad clicks are under 100. |
| T3. Tracking didn't break mid-period | the daily GA4 sessions line | fail when 3+ days in a row drop below 20% of the prior period's daily median. This only catches a break inside the window; a tag that broke before both periods shows up in T1 instead. |
| T4. Platform results vs GA4 | sum of platform-claimed results ÷ GA4 key events from paid channels | note above 1.5: the platforms each claim credit for the same people. Never add platform results together as one total. Skip when no ad platform reports results. |
| T5. Complete days only | period end vs today, and the days each daily source returned | warn when the period ends less than 2 days ago, or when a source returned fewer days than the period has (Search Console lags two to three days). Compare that source on daily averages and name its last day. |
| T6. One currency | currency of every money source | fail on a mix you can't convert from data in the run |

**What the checks allow:**
- **Totals of results** come from GA4 key events when T1 and T3 pass. Otherwise show each platform's own results side by side, labelled "as each platform counts them", and no grand total.
- **Blended cost per result** (total ad spend ÷ GA4 key events from paid channels) only when T2 and T3 pass and paid channels have 10 or more key events.
- **Organic search** always comes from Search Console and Bing, not GA4, in the headline.

## Step 4: decide what moved

- **Change is shown when it means something.** Show a % change only when both periods clear the floor: 100 sessions or clicks, $100 spend, 10 results. Below the floor, show both numbers and write "too small to call". When the two periods have a different number of days, check the floor on the period totals and compute the change on daily averages (total ÷ days the source returned), and say so.
- **A headline** is a change of 20% or more on a number above the floor, or any failed trust check. Rank headlines by money first (spend and results), then by reach.
- **Explain every headline with a number from the run**, for example "clicks fell 18% while impressions held, because average position slipped from 9 to 13". If the run has no number that explains it, write "cause not visible in this data" and say what would show it.
- **Idle sources** are one line, not a section: "Meta: connected, no spend in either period".
- **Never call a change good or bad on volume alone.** More spend at the same cost per result is growth. More spend at a worse one is not.

## Step 5: write it in the shape asked for

All shapes share these rules: the date range and currency at the top, numbers rounded for reading (whole dollars, one decimal for %), and the source inventory.

### Weekly report
1. **Three-line headline**: the biggest moves, each with its number.
2. **KPI table**: spend, results, cost per result, sessions, organic clicks, email revenue, each with this week, last week and change. Keep all six rows even when a source is idle or a value can't be computed: show 0 or "not computable" and say why in the change column. The results row follows "What the checks allow": GA4 key events only when T1 and T3 pass, otherwise each platform's own results labelled "as each platform counts them", with the failed check named in the change column. Extra rows go after these six.
3. **By channel**: one row per active source.
4. **Trust checks**: the warns and fails, each with what it means, then one line naming the checks that passed or were skipped.
5. **Next week**: up to three actions, each tied to a finding above.

### Monthly client report
Everything in the weekly report, plus:
- a **summary paragraph** a client can read without the tables
- **one section per active channel**: what it spent, what it returned, what changed and why
- **wins and issues**, kept separate
- **plan for next month**, each item with the number it should move

Write for the client: no internal jargon, no blame, and a fix next to every issue.

### Executive one-pager
- **Five KPIs at most**, each with this period, change and a status word (on track, watch, off track). Use "off track" only against a target the user gave.
- **Three sentences**: what happened, why, what's next.
- **One decision or ask**, if there is one.
Nothing else. Leave the channel detail out.

### Board slides and review decks
See "Business review deck" below: it covers the six-slide board outline and the full quarterly or annual deck.

### Stand-up brief
150 words or fewer, in this order: the one number to know, what moved (two lines), what's broken (one line), and today's focus. The source inventory is one line at the end.

### Writing modes (any shape)
- **Plain English:** define every term the first time it appears, in the sentence itself ("cost per lead, what you paid for each form filled"). No acronyms without the words. Say what each number means for the business, not just what it is.
- **Narrative:** write the report as connected paragraphs (context, what happened, why, what next) instead of bullets. Keep every number. A narrative is not a place to soften a failed check.

When the user pastes a report and asks what it means, apply the plain-English mode to their report. Check its numbers against live data when the source is connected, and say where they differ.

## Reading the change history

The deck and the batch reports both say what was changed in the accounts. Read it from the logs, never from memory:

```json
{"platform": "google-ads", "action": "gaql", "account_id": "<GOOGLE_ADS_ID>",
 "query": "SELECT change_event.change_date_time, change_event.change_resource_type, change_event.resource_change_operation, change_event.changed_fields, change_event.client_type, change_event.campaign FROM change_event WHERE change_event.change_date_time BETWEEN 'START' AND 'END' LIMIT 500"}
```
To size a change (how far a budget moved, which bid strategy replaced which), run it again on just those rows with the before and after values added. `old_resource` and `new_resource` hold the object as it was and as it became; a budget's amount sits in `campaign_budget.amount_micros` inside each. (This form was checked against the Google Ads API reference, not in a live run.)
```json
{"platform": "google-ads", "action": "gaql", "account_id": "<GOOGLE_ADS_ID>",
 "query": "SELECT change_event.change_date_time, change_event.change_resource_type, change_event.campaign, change_event.changed_fields, change_event.old_resource, change_event.new_resource FROM change_event WHERE change_event.change_date_time BETWEEN 'START' AND 'END' AND change_event.change_resource_type IN ('CAMPAIGN_BUDGET', 'CAMPAIGN') LIMIT 500"}
```
```json
{"platform": "google-ads", "action": "gaql", "account_id": "<GOOGLE_ADS_ID>",
 "query": "SELECT change_status.resource_name, change_status.resource_type, change_status.resource_status, change_status.last_change_date_time, change_status.campaign FROM change_status WHERE change_status.last_change_date_time BETWEEN 'START' AND 'END' LIMIT 1000"}
```
```json
{"platform": "facebook-ads", "action": "get_activities_adaccount", "ad_account_id": "<META_AD_ACCOUNT_ID>",
 "fields": ["event_time", "event_type", "extra_data", "object_id", "object_name"], "since": "START", "until": "END"}
```

- **How far back.** Both logs count back **from today**, not from the period end. `change_event` reaches the last 30 days and is the only log with values: which fields changed (`amountMicros` is a budget, `status` a pause or enable) and, with the second query, the before and after. `change_status` reaches 90 days and returns no values at all: only which campaign, budget or ad changed, whether it was added, changed or removed, and when. An older start date is refused with `START_DATE_TOO_OLD`; then say which weeks the log doesn't cover.
- **Cut lists.** When the rows returned equal the `LIMIT`, the list was cut, and not in date order (in one test run, 1,000 rows stopped two weeks short of the window's end). Split the window in two and run each half until every part comes back under the limit.
- **Group before you count.** Group the rows by day, type of thing and operation. A bulk upload is one item with a count ("added 300 negative keywords in one upload"), not 300 items.
- **Leave out what nobody did.** Meta logs its own review steps (status moving through Pending Process or Pending Review): drop them. A run of status changes to Deleted on one day is one cleanup, one line.
- **No names.** Never print who made a change; the logs can hold people's emails.
- **Other platforms** have no change log here. Take their changes from the user's notes and label them "from the team's notes".

## Business review deck (QBR, annual review or board)

For a client QBR, a leadership or annual review, or a board update: the period on slides, one chart per slide, with speaker notes, as a text outline or a file.

**Window.** The last complete quarter (or year), against the quarter before and the same quarter last year. Run every Step 2 call for all three windows, and compare on daily averages, since quarters differ in length.

Two sources keep less history than a deck needs, and both count back from today:
- **Pinterest Ads**, 90 days. On a Q3 deck built on October 30 that reaches only to about August 1, so July is missing from the reported quarter, and the prior quarter and last year can't be pulled at all.
- **Bing Webmaster**, about six months of daily rows. The same run covers Q3 and Q2 from about the end of April, and nothing from last year.
For each, write the first day the data covers under the column. Compare a cut window on the daily average of the days it has, and name the days. A window with no days reads "not available", and that source drops out of that comparison; never fill it from another source. For an annual deck, both reach only part of the year.

**Ask for, or read:**
- **The period's goals** (results, cost per result, revenue, spend). If they sit in a Google Sheet, read the column names first, then the rows:
```json
{"platform": "google-sheets", "action": "get_sheet_peak", "spreadsheet_id": "<SPREADSHEET_ID>", "sheet_id": "<SHEET_ID>"}
```
```json
{"platform": "google-sheets", "action": "query_sheet_data", "spreadsheet_id": "<SPREADSHEET_ID>", "sheet_id": "<SHEET_ID>", "select": "<COLUMNS_FROM_PEAK>"}
```
  (`get_sheet_peak` was tested on an empty sheet; `query_sheet_data` is untested because the API rate-limited the test.) Without goals, compare with the quarter before and last year only, and never write "missed" or "off track".
- **The tests run:** what was tested, where, the dates and the metric. From the user, or from the change history.
- **The reader** (client, leadership, board), the logo file, the brand colours as hex codes, and the output: a text outline in the chat, pptx, PDF or a Google Sheet. Default: a text outline. Ask for the logo and colours only when a file is wanted.

**What changed and what it did.** Read the change history (section above). How much of the period it can size depends on the run date. A quarter reported a month after it ended sits almost wholly outside `change_event`'s 30 days, and only its last two months fall inside `change_status`'s 90, so most of its changes can be dated but not sized. Say so on the slide.
- **Inside the last 30 days:** `change_event` with the before and after values finds the big changes: a budget that moved 20% or more, a bid strategy switch, a campaign launched or paused.
- **Older, inside 90 days:** `change_status` shows that a campaign or budget changed and on which day, never by how much. Write "budget changed on Aug 12, size not in the log", and take the size from the team's notes when they have it. A campaign added or removed counts as big without a size.
- **Older than 90 days:** only the team's notes, labelled "from the team's notes".
For each big change, pull that campaign's daily rows for the 14 days before and the 14 days after (the Google Ads query in "Campaign wrap-up", with `campaign.id = <CAMPAIGN_ID>` in place of the name filter), and compare daily averages with the Step 4 floors. Label it "before and after, not proof": seasonality and other changes move numbers too.

**Tests.** One row per test: what changed, the two sides (or before and after), the metric on each, and the call. Call a winner only when both sides clear the floors; otherwise "too small to call".

**Slides.** Every title is the takeaway as a sentence with its number ("Leads beat the goal by 12% while cost per lead held at $41"), and a subtitle names the source and window.
1. Cover: business, period, currency, logo.
2. The period in one line, and up to five KPIs, each with goal, actual, against last quarter and against last year.
3. Results against goals.
4. The trend: the main result by month or week across the period, next to the same weeks last year.
5. Channel mix: each channel's share of spend next to its share of results.
6. What worked: the one or two biggest wins.
7. What missed, and why: every missed goal and every fall of 20% or more above the floor, each with its cause from the run, or "cause not visible in this data" and what would show it. A miss never moves to the appendix.
8. Tests run.
9. Changes and their effect.
10. Account health: the source inventory and the trust checks.
11. Next quarter: up to five priorities, each tied to a finding and the number it should move.
12. Budget ask: the amount, where it goes, and what it should buy, worked out from this period's cost per result on that channel and labelled an estimate with its assumption. Ask for more only where cost per result held as spend grew.
Then an appendix with the full KPI and channel tables.

**Board version.** Six slides: the headline, the numbers (up to five KPIs against the prior period and target), where results came from, what worked, risks (failed trust checks and off-track numbers), and plan and asks. Each gets 2 to 4 bullets and a line of speaker notes. As a text outline (the default), name the chart each slide should carry and the data behind it, and never describe a chart the run can't fill. As a file, it follows the deck rules below.

**The chart on each slide.** Let the slide's job and the run's numbers set the chart. In a text outline, write the chart's name and its data instead of drawing it.
- **Trend (slide 4):** plot the main result per week for a quarter, per month for a year. A line once there are six points or more, columns below that. This year in the brand colour, last year as a grey line on the same axis.
- **Goals (slides 2 and 3):** one column per KPI for the actual, with the goal as a short horizontal tick across it. A KPI without a goal gets no tick, so it can't be read as on or off track.
- **Mix (slide 5):** two 100% bars side by side, spend split by channel and results split by channel, in the same channel order and colours, so a channel that takes more spend than results stands out.
- **Wins and misses (slides 6 and 7):** channels or campaigns as sorted horizontal bars of the change. Show each one that holds at least 5% of spend; fold the rest into one "smaller channels" bar.
- **Tests and changes (slides 8 and 9):** each test's two sides, or a change's 14 days before and after, as a pair of columns, with the Step 4 floor written beneath.
- **A slide whose point is one number:** that number in large type with its comparison in a line under it, and no chart.
- **Never** two value axes on one chart, 3D, or a pie with more than four slices.
- **Colour:** the brand colour marks this period, grey marks every comparison, and red and green appear only where a goal was hit or missed.

**Speaker notes.** Two or three sentences a slide: what to say, the one number to stress, and the question the reader is likely to ask, with its answer from the data.

**Making the file.** When a file is wanted, build the pptx with whatever file tool the environment has (python-pptx works), 16:9, native charts so the numbers stay editable, the logo top right and the user's colours. Export the same slides as PDF when asked. For a Google Sheet, see "Writes this skill can offer". Then read every number on every slide back against the run's data and fix any mismatch before handing it over.

**Restyling an existing report.** When the user uploads or pastes a report and wants it as slides or a PDF in their logo and colours: keep every number exactly as given, put it in the slide order above, and apply the chart rules. If the sources are connected, check the period and the main totals against live data and list any difference in a separate note; never change the report's numbers silently.

## Campaign wrap-up

For one campaign, finished or still running, across every channel it used.

**Ask for:** the term that marks the campaign (its name or ID in campaign names and in `utm_campaign`), the flight dates, the targets from the brief (results, cost per result, reach, revenue, budget), and the output: a client email, an internal read-out or slides (deck rules above). When the brief is pasted, take the targets from it.

**Find the pieces.** Search each connected source for the term, show the list of matches, and ask the user to confirm it before pulling numbers.

- **Google Ads:** daily rows for every matching campaign, with its start and end. An empty `end_date_time` means no end date was set.
```json
{"platform": "google-ads", "action": "gaql", "account_id": "<GOOGLE_ADS_ID>",
 "query": "SELECT campaign.id, campaign.name, campaign.status, campaign.start_date_time, campaign.end_date_time, segments.date, metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.conversions FROM campaign WHERE campaign.name LIKE '%<TERM>%' AND segments.date BETWEEN 'FLIGHT_START' AND 'FLIGHT_END' AND metrics.impressions > 0"}
```
  Ads, to find the best and worst (checked with the helper; the live test was rate-limited, so this call is untested):
```json
{"platform": "google-ads", "action": "ad_performance_report", "account_id": "<GOOGLE_ADS_ID>", "campaign_id": "<CAMPAIGN_ID>",
 "start_date": "FLIGHT_START", "end_date": "FLIGHT_END"}
```
- **Meta:** ad-level rows for the flight; keep those whose `campaign_name` contains the term.
```json
{"platform": "facebook-ads", "action": "get_insights_adaccount", "ad_account_id": "<META_AD_ACCOUNT_ID>",
 "level": "ad", "time_range": {"since": "FLIGHT_START", "until": "FLIGHT_END"},
 "fields": ["campaign_id", "campaign_name", "ad_id", "ad_name", "spend", "impressions", "inline_link_clicks", "actions"]}
```
- **LinkedIn:** `get_campaigns` gives each campaign's name and `runSchedule` (start and end in epoch milliseconds); then the matched ids:
```json
{"platform": "linkedin-ads", "action": "get_campaigns", "ad_account_id": "<LINKEDIN_AD_ACCOUNT_ID>"}
```
```json
{"platform": "linkedin-ads", "action": "get_campaign_analytics", "ad_account_id": "<LINKEDIN_AD_ACCOUNT_ID>",
 "start_date": "FLIGHT_START", "end_date": "FLIGHT_END", "campaigns": ["<CAMPAIGN_ID>"],
 "fields": ["impressions", "clicks", "landingPageClicks", "costInUsd", "externalWebsiteConversions", "oneClickLeads"]}
```
  It returns one row per day with delivery; days without delivery are missing. Sum the rows.
- **TikTok:** campaign level, with the name as a metric; keep rows with impressions 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": "FLIGHT_START", "end_date": "FLIGHT_END",
 "dimensions": ["campaign_id"], "metrics": ["campaign_name", "spend", "impressions", "clicks", "conversion"]}
```
- **Microsoft Ads:** `submit_campaign_performance_report` with `CampaignName`, `Spend`, `Impressions`, `Clicks` and `Conversions` columns over the flight, then `poll_report_status` as in Step 2 (checked with the helper; untested on a live campaign). Other ad platforms: their campaign-level stats action from `actions_details`, or the user's export.
- **Website (GA4), by UTM campaign:** keep rows whose campaign name contains the term, in any case, and leave out the bracketed placeholders such as `(direct)`, `(organic)`, `(referral)` and `(not set)`.
```json
{"platform": "google-analytics", "action": "get_report", "property_id": "<GA4_PROPERTY>",
 "dimensions": ["sessionCampaignName", "sessionSourceMedium"], "metrics": ["sessions", "engagedSessions", "keyEvents"],
 "start_date": "FLIGHT_START", "end_date": "FLIGHT_END"}
```
- **Klaviyo:** list email campaigns (the channel filter is required), match names to the term, then report on the matched ids over the flight:
```json
{"platform": "klaviyo", "action": "get_campaigns", "filter": "equals(messages.channel,'email')", "sort": "-created_at", "auto_paginate": true}
```
```json
{"platform": "klaviyo", "action": "get_campaign_report",
 "body": {"data": {"type": "campaign-values-report", "attributes": {
   "timeframe": {"start": "FLIGHT_STARTT00:00:00Z", "end": "FLIGHT_END_PLUS_1T00:00:00Z"},
   "filter": "contains-any(campaign_id,[\"<KLAVIYO_CAMPAIGN_ID>\"])",
   "statistics": ["recipients", "delivered", "opens_unique", "clicks_unique", "conversions", "conversion_value"]}}}}
```
- **Mailchimp** (untested until connected): `list_reports` with `since_send_time` and `before_send_time` around the flight; match `campaign_title`.
- **Organic posts:** Facebook Pages `get_posts` with `since` and `until`; Instagram `get_media` with `since` and `until` (untested until connected); LinkedIn Pages `fetch_organization_posts`, then `fetch_share_statistics_per_post` for the matched posts (untested). A post belongs to the campaign when its link carries the `utm_campaign`, it uses the campaign hashtag, or the user lists it.
```json
{"platform": "facebook-pages", "action": "get_posts", "page_id": "<PAGE_ID>",
 "fields": ["id", "message", "created_time", "permalink_url", "reactions.summary(true)", "comments.summary(true)", "shares"],
 "limit": 100, "since": "FLIGHT_START", "until": "FLIGHT_END"}
```
  (The live test asked for `likes.summary(true)` with a limit of 25; `reactions.summary(true)` and `shares` are in the helper's field list but weren't in that run.) When the reply carries a next page, fetch it too, so no post in the flight is dropped. A post with no shares returns no `shares` field: count it as 0.

**Same dates, same clock.** Each source counts days in its own time zone: Google Ads in 

…(truncated)
