A twenty-line script that buys back an hour every week
Search-term reports are where negative keywords go to be ignored. Here's the little Google Ads script I use to surface the ones actually worth acting on.
The search-terms report is the most valuable screen in Google Ads and the one I open least, because scrolling it by hand is soul-destroying. So I stopped scrolling. This is the script that now emails me a shortlist every Monday: terms that spent real money, converted nothing, and don’t already have a negative covering them.
It’s not clever. That’s the point — the best automation is the boring kind you forget is running.
The whole thing
function main() {
const MIN_COST = 15; // only terms that spent something real
const LOOKBACK = 'LAST_30_DAYS';
const rows = AdsApp.report(`
SELECT search_term_view.search_term, metrics.cost_micros,
metrics.conversions, metrics.clicks
FROM search_term_view
WHERE segments.date DURING ${LOOKBACK}
AND metrics.conversions = 0
`).rows();
const wasted = [];
while (rows.hasNext()) {
const r = rows.next();
const cost = r['metrics.cost_micros'] / 1e6;
if (cost >= MIN_COST) {
wasted.push({ term: r['search_term_view.search_term'], cost });
}
}
wasted.sort((a, b) => b.cost - a.cost);
const body = wasted.slice(0, 25)
.map(w => `${w.cost.toFixed(0)} kr — ${w.term}`).join('\n');
MailApp.sendEmail('you@example.com', 'Wasted spend this month', body);
}
Why it earns its keep
The value isn’t the code. It’s that the decision — which terms deserve my attention — now happens without me. I open one email, add four or five negatives, close it. Ten minutes, once a week, instead of a half-hour I kept putting off until the spend had already leaked.
A few things I learned the hard way:
- Threshold on cost, not clicks. A term with 40 clicks and no conversions at 2 kr CPC matters less than one that ate 90 kr in six clicks.
- Exclude terms you’ve already negated, or you’ll re-read the same list every week and stop trusting the email.
- Cap the output. Twenty-five lines is a to-do list. Two hundred is wallpaper.
If a report is important and you’re not reading it, the fix usually isn’t discipline. It’s a script that reads it for you and only speaks up when there’s something to do.