Ad spend and ROAS (all networks)
get_ad_spendAd spend, impressions and clicks per campaign, ad group or ad for every connected ad network (Meta Ads, Google Ads), next to the ad visitors, customers, first-touch revenue and assisted revenue each brought, with ROAS and cost per customer. provider=all (default) adds combined totals across networks; accounts[] has each network's totals; several ad accounts per network are combined (adAccounts[] lists them, account= reports one alone). Meta and Google rows and per-network totals (accounts[].totals) also carry reportedValue/reportedPurchases/reportedRoas: what that network itself reports (Meta: purchase value and purchases; Google: metrics.conversions_value and conversions), converted into the report currency, for comparison only (never in revenue or ROAS); combined totals carry them only when one such network is in the report. Visits with only a click ID (fbclid, gclid) are reported in unattributed and never counted in totals or ROAS. Spend is converted into the report currency.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_ad_spend"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last day, YYYY-MM-DD (inclusive). | |
| from | No | First day, YYYY-MM-DD (inclusive). Use with to. | |
| level | No | Row level (default campaign). adgroup is Meta's ad set. | |
| fields | No | Optional: only these parts of the answer, as comma-separated dot paths (e.g. overview.current,series.date,series.visitors). Through a list a path applies to every item; period is always kept. An unknown top-level name fails with the list of valid ones. Leave out for the full answer. | |
| period | No | Preset period, default 30d. today/yesterday/wtd/mtd follow the timezone. Ignored when from and to are set. | |
| account | No | One ad account ID (from adAccounts[]): that account alone instead of every chosen account combined. | |
| compare | No | What change figures compare against: previous (default, the equal-length window right before), weekdays (the same length, starting whole weeks earlier on the same weekday, so Mondays compare with Mondays), year (same period last year), or a YYYY-MM-DD start (window keeps the period's length). Ignored for period all. | |
| campaign | No | A campaign ID: adds that campaign day by day with its customers. | |
| provider | No | Ad network (default all connected, combined). | |
| timezone | No | IANA time zone for day boundaries and grouping, e.g. Europe/Madrid. Default UTC. | |
| website_id | No | Website ID from list_websites (the data-site-id value in the tracking script). |