API Reference โบ Google Ads โบ analyze_wasted_spend
analyze_wasted_spend
Google Ads
Read
๐จ **IF THIS TOOL RETURNS A QUOTA ERROR:**
- The error message will include a clickable upgrade link
- Show the FULL error message to the user (it contains the upgrade link)
- DO NOT attempt to work ar
Endpoint
POST https://api.adspirer.ai/api/v1/tools/analyze_wasted_spend/execute
Headers
Authorization: Bearer sk_live_... โ your Adspirer API key (required)
Content-Type: application/json (required)
Idempotency-Key: <uuid> โ recommended for write operations to make retries safe
Description
๐จ **IF THIS TOOL RETURNS A QUOTA ERROR:**
- The error message will include a clickable upgrade link
- Show the FULL error message to the user (it contains the upgrade link)
- DO NOT attempt to work around the error or use alternative data
- DO NOT create campaigns or perform actions without valid tool data
- STOP and direct the user to upgrade via the provided link
Analyze wasted ad spend and identify campaigns losing money or underperforming.
โ ๏ธ IMPORTANT: This tool retrieves READ-ONLY data. Safe to call multiple times.
๐ฏ **What This Tool Does (Performance Agent - Phase 1):**
- Identifies campaigns LOSING money (ROAS < 1.0x)
- Identifies campaigns UNDERPERFORMING (1.0x โค ROAS < target)
- Separates true waste from opportunity cost
- Provides severity-based classification (CRITICAL/HIGH/MEDIUM)
- Generates actionable recommendations with expected impact
- Shows top performing campaigns for budget reallocation
**Returns detailed analysis:**
- Total wasted spend (campaigns with ROAS < 1.0)
- Total underperforming spend (profitable but below target)
- Campaign-by-campaign breakdown with severity levels
- Specific recommendations (PAUSE/REDUCE/OPTIMIZE)
- Quick actions for immediate implementation
- Budget reallocation suggestions
**Target ROAS Resolution (3-tier priority):**
1. Account goals table (user-set or API-pulled)
2. 90-day historical average ROAS
3. Default to 2.0x if no data available
**Severity Levels:**
- ๐จ CRITICAL: ROAS < 0.5x (losing money severely)
- ๐ด HIGH: ROAS < 1.0x (unprofitable/breakeven)
- ๐ก MEDIUM: 1.0x โค ROAS < target (profitable but underperforming)
**Parameters:**
- lookback_days: 7, 30, 60, 90, or 120 days (default: 30)
- start_date: Optional start date (YYYY-MM-DD). Overrides lookback_days when used with end_date.
- end_date: Optional end date (YYYY-MM-DD). Overrides lookback_days when used with start_date.
โ ๏ธ DATE CLARIFICATION: If the user's date request is vague or ambiguous (e.g., "March to June" without a year, "last quarter", "recently", "a few months ago"), ask the user to specify exact dates before calling this tool. Do not assume or guess dates.
- target_roas: Optional override (e.g., 3.0 for 3.0x ROAS)
- customer_id: Optional (uses connected account if omitted)
**Execution time:** 1-3 seconds (cached database query)
**Data source:** campaign_daily_metrics table (updated nightly)
**Use this tool when:**
- User asks "where is my money going?"
- User wants to identify wasted spend
- User wants to optimize campaign budgets
- User asks which campaigns to pause/reduce
- User wants to know which campaigns are losing money
๐ **AFTER calling this tool, help the user understand:**
**Wasted vs. Underperforming:**
- **Wasted Spend** = Actual losses (ROAS < 1.0, you're losing money)
- **Underperforming Spend** = Opportunity cost (profitable but below target)
**Example:**
- Campaign A: Spent $1000, got $600 back (ROAS 0.6x) โ $400 WASTED
- Campaign B: Spent $1000, got $1500 back (ROAS 1.5x, target 3.0x) โ $0 wasted, but $500 opportunity cost
**Quick Actions (IMPORTANT โ read severity context first):**
- โณ LEARNING campaigns โ Do NOT pause. Monitor for 14+ days before judging.
- โ INSUFFICIENT_DATA campaigns โ Need more spend before analysis is meaningful.
- ๐จ CRITICAL campaigns (established, 14+ days, ZERO conversions) โ Consider pausing
- ๐จ CRITICAL campaigns (established, 14+ days, HAS conversions) โ Review performance, verify revenue in ad platform before reducing budget
- ๐ด HIGH severity (established, 14+ days) โ Consider reducing budget by 50-70%
- ๐ก MEDIUM โ Optimize targeting, ad copy, landing pages
- Top performers โ Consider increasing budget
โ ๏ธ **NEVER say "pause" for a campaign that has conversions.** Say "review" or "reduce budget" instead.
โ ๏ธ **NEVER recommend pausing a campaign in LEARNING phase.**
โ ๏ธ **If ALL campaigns are LEARNING or INSUFFICIENT_DATA, tell the user their account is too new for waste analysis and recommend checking back in 2 weeks.**
โ ๏ธ **Consider campaign objective: brand awareness campaigns will not have ROAS data. This is normal.**
โ ๏ธ **When data confidence is MEDIUM or LOW, soften all recommendations and add verification prompts.**
**Visualization Tip:**
For 10+ campaigns, suggest creating a treemap visualization to show wasted spend by campaign size.
๐ฌ **Community**: For optimization discussions, visit our Discord: https://discord.gg/dH3Qt4YS
Request body
All tool arguments are wrapped in an arguments object.
| Field | Type | Description |
start_date | string optional | Start date (YYYY-MM-DD). If provided with end_date, overrides lookback_days for custom date range queries. |
end_date | string optional | End date (YYYY-MM-DD). If provided with start_date, overrides lookback_days for custom date range queries. |
date_range | string optional | Date range preset: 'last_7_days', 'last_14_days', 'last_30_days', 'last_60_days', 'last_90_days'. Overrides lookback_days. Ignored if start_date/end_date are provided. |
raw_data | boolean optional | If true, return ONLY raw metrics as a JSON code block (spend, clicks, impressions, conversions, CPA, CPC, CTR, CVR, ROAS by campaign/ad/date). Strips severity labels, suggested bids/budgets, industry benchmarks, and optimization recommendations. Use when you run your own attribution model or want to minimize token usage. default: false |
lookback_days | integer optional | Number of days to analyze (7, 30, 60, 90, or 120 days). Default is 30 days. default: 30 |
target_roas | number optional | Optional target ROAS override (e.g., 3.0 for 3.0x ROAS). If not provided, will use account goals or historical average. |
customer_id | string optional | Google Ads customer ID. Required for multi-account users. Get from list_connected_accounts. |
Example request
{
"arguments": {
"start_date": "string",
"end_date": "string",
"date_range": "string",
"raw_data": false,
"lookback_days": 30,
"target_roas": 1.0
}
}
Example responses
200 โ Success
{
"success": true,
"data": {
"text": "(tool-specific textual output for analyze_wasted_spend)",
"quota": {
"used": 42,
"limit": 150,
"tier": "plus",
"period_end": "2026-05-01"
}
},
"tool": "analyze_wasted_spend"
}
400 โ Tool-level error (bad arguments / multi-account selection)
{
"success": false,
"error": "You have 25 meta_ads accounts connected. Please specify which account to use by passing the ad_account_id parameter:\n - Acme Holdings (ad_account_id=\"act_123456789\")\n - Acme EU (ad_account_id=\"act_987654321\")",
"is_error": true,
"tool": "analyze_wasted_spend"
}
402 โ Quota exhausted
{
"success": false,
"error": "\ud83d\udea8 Monthly limit reached (150/150 tool calls on Plus tier).\nUpgrade to Pro at https://adspirer.ai to keep building.",
"is_error": true,
"tool": "analyze_wasted_spend",
"quota": {
"used": 150,
"limit": 150,
"tier": "plus",
"period_end": "2026-05-01",
"upgrade_url": "https://adspirer.ai"
}
}
Try it live
Adspirer REST API โ get an API key at adspirer.ai/keys ยท
adspirer.ai