{
 "schema": "aiblocks-page/1",
 "id": "google-search-term-code-prompt",
 "type": "prompt",
 "name": "Google search term code planner",
 "summary": "Get a coding brief that sorts Google Ads search terms into four groups and drafts negative keywords for wasted spend. Read-only, with tests.",
 "headline": "Google search term code planner",
 "subhead": "Give your coding assistant your project and your Google Ads API access. It plans code that sorts each search term into profitable, wasteful, unsure or a new theme, and drafts a paste-ready negative keyword list. Brand terms are protected. Nothing is written to your account.",
 "job": {
  "id": "build-software",
  "name": "Build and ship software"
 },
 "level": "intermediate",
 "thinking": "medium",
 "tested": true,
 "updated": "2026-11-03",
 "first_published": "2026-10-25",
 "inputs": [
  {
   "type": "codebase",
   "required": true,
   "label": "Codebase",
   "what": "a project's code, in a folder or repo the AI can open"
  }
 ],
 "outputs": [
  {
   "type": "code_change",
   "required": true,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "you_give": [
  "Your code project, or its package file and main folders",
  "Google Ads API access by name only. Customer ID, and whether you use a manager account (never tokens)",
  "Your target cost per sale or target return on ad spend",
  "Your brand terms, so they are never marked as waste",
  "The spend cut-offs you want for wasted spend, in your account currency (optional)",
  "Your audit engine's finding types and data fetcher, if you have them (optional)"
 ],
 "you_get": [
  "A list of setup gaps before any file is written",
  "A plan for a search term classifier with four groups and a rule for each",
  "A plan for a negative keyword analyzer that removes duplicates and checks for conflicts",
  "Negative keyword rows in a paste-ready layout for Google Ads Editor",
  "Tests with made-up search terms, and a schedule proposal you approve or decline"
 ],
 "use_when": [
  "Your Google Ads search term report is too long to read by hand every week.",
  "You want a list of negative keywords you can review and paste into Google Ads Editor.",
  "A lot of your spend goes to searches that never sell and you want them found by rule.",
  "You already have a Google Ads audit engine in your code and want to add search terms to it."
 ],
 "skip_when": [
  "You don't have Google Ads API access. Use the Google Ads developer access checker first.",
  "You have one export and no code. Use the Search query analyst, or the Google Ads report auditor.",
  "You want to sort keywords by results, not search terms. Use the Keyword grouping coding brief writer.",
  "You want it to add the negative keywords to your account. It only drafts rows for you to review and paste."
 ],
 "output_sample": {
  "input": [
   "Your code project, or its package file and main folders",
   "Your Google Ads customer ID and target cost per sale or return on ad spend",
   "Your brand terms, and your spend cut-offs for wasted spend (optional)"
  ],
  "prerequisites": [
   "A coding assistant that can open your project, such as Claude Code or Codex",
   "Google Ads API access, with a developer token and a login that can read the account",
   "A data fetcher and finding types in your project (or a small version the brief plans)"
  ],
  "output": [
   {
    "name": "Setup gaps",
    "contains": "What is missing before any file is written, such as API access or a data fetcher."
   },
   {
    "name": "Bucket rules",
    "contains": "The cut-offs for profitable, wasteful, unsure and new-theme terms, each one yours to set."
   },
   {
    "name": "File plan",
    "contains": "The classifier, the negative keyword analyzer, the data fetch and the job that runs them."
   },
   {
    "name": "Findings",
    "contains": "Each check, when it fires, how serious it is and what it recommends."
   },
   {
    "name": "Negative rows",
    "contains": "Draft negative keywords with campaign, ad group, keyword and match type, ready to review."
   },
   {
    "name": "Tests",
    "contains": "Made-up search terms covering brand protection, all four groups and negatives that conflict."
   },
   {
    "name": "Schedule proposal",
    "contains": "A weekly run you approve or decline, and what must be set up first."
   },
   {
    "name": "Checks missed",
    "contains": "One line for each check that failed or could not run, or none."
   }
  ]
 },
 "output_shape": "BASIS\n<what was read, what is missing, nothing was run>\n\nSETUP GAPS\n<gap> | <why it matters> | <fix>\n\nBUCKET RULES\n<setting> | <starting value> | <you set it>\n\nFILE PLAN\n<file> | <what it does> | <inputs and outputs>\n\nFINDINGS\n<check ID> | <fires when> | <severity rule> | <recommendation>\n\nNEGATIVE ROWS (draft)\n<campaign> , <ad group> , <keyword> , <match type>\n\nTESTS\n<name> | <made-up terms> | <expected result>\n\nSCHEDULE PROPOSAL\n<when it runs> | <what it needs from you first>\n\nNEXT STEP\n<the smallest useful step>\n\nCHECKS MISSED\n<one line per check that failed or could not run, or none>",
 "how_to_use": [
  "Open your coding assistant, such as Claude Code or Codex, in your project folder. A plain chat AI can only write the plan.",
  "Paste the skill. Then add your project details, your target, your brand terms and your cut-offs. Never paste a token.",
  "Read SETUP GAPS first. If your project has no audit engine yet, choose between a small version or building the audit engine first.",
  "Read BUCKET RULES and change any cut-off that is not right for your account.",
  "Check the draft negative rows against your current negatives before you paste anything into Google Ads Editor.",
  "Run the tests in your own project. Approve a weekly schedule only when you are happy with the output."
 ],
 "checks": [],
 "next": [
  {
   "name": "Simple code coach",
   "url": "https://useaiblocks.com/skills/simple-code-coach",
   "why": "Build it"
  }
 ],
 "source": null,
 "credits": [],
 "files": [
  "references/worked-example.md"
 ],
 "links": {
  "page": "https://useaiblocks.com/prompts/google-search-term-code-prompt",
  "markdown": "https://useaiblocks.com/prompts/google-search-term-code-prompt.md",
  "json": "https://useaiblocks.com/prompts/google-search-term-code-prompt.json",
  "instructions": "https://useaiblocks.com/skills/google-search-term-code-prompt/SKILL.md",
  "download": "https://useaiblocks.com/skills/google-search-term-code-prompt.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/google-search-term-code-prompt",
  "api_document": "https://useaiblocks.com/api/v1/documents/prompt/google-search-term-code-prompt",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
