AI Search Term Analyzer
Uses Claude AI to analyze your search terms and recommend negative keywords with clear reasoning. Each term is evaluated for business relevance, intent, and conversion potential — then exported to a Google Sheet with actionable suggestions.
by Dmytro Tonkikh·chiliad.io
Overview
AI Search Term Analyzer fetches your search query data, batches it, and sends it to Claude for intelligent analysis. Unlike rule-based scripts, Claude understands context — it can tell the difference between a relevant long-tail query and a misleading match. Results are written to a Google Sheet with per-term recommendations (keep, exclude as exact, exclude as phrase) and plain-language reasoning. You can enable AUTO_EXCLUDE to apply the suggestions automatically.
Setup
- 1Get a Claude API key from https://console.anthropic.com (requires an Anthropic account).
- 2Open your Google Ads account and go to Tools → Bulk Actions → Scripts.
- 3Create a new script and paste the code.
- 4Set ANTHROPIC_API_KEY to your API key.
- 5Update BUSINESS_DESCRIPTION with a clear summary of what you sell or offer — this is critical for Claude's accuracy.
- 6Run the script once in preview mode to review the Google Sheet output.
- 7Adjust MIN_COST and MIN_IMPRESSIONS thresholds if needed.
- 8When confident in the results, optionally set AUTO_EXCLUDE = true.
- 9
Configuration Variables
| Variable | Default |
|---|---|
ANTHROPIC_API_KEY | (required) |
BUSINESS_DESCRIPTION | Describe your business here |
AUTO_EXCLUDE | false |
MIN_COST | 1.0 |
LOOKBACK_DAYS |
Expected Output
=== AI Search Term Analyzer === Account: My Store (123-456-7890) Found 142 search terms to analyze. Processing 4 batch(es)... Summary: 98 terms to keep, 44 terms to exclude. Results written to: https://docs.google.com/spreadsheets/d/abc123 Sample Sheet Output: | Search Term | Action | Reason | |---------------------|---------------|-------------------------------------------| | buy running shoes | keep | Direct purchase intent, matches business | | free shoe templates | exclude_exact | Informational, no purchase intent | | nike outlet store | exclude_phrase| Competitor brand, unlikely to convert |
Notes
Claude API costs ~$0.01–0.03 per run with Haiku (500 terms). Sonnet costs ~5x more but provides deeper analysis. The script never sends personal data to Claude — only aggregated search terms and metrics.