Skip to main content
Get Started
Open Source

Google Ads Scripts

Free, production-tested Google Ads scripts for automation, monitoring and reporting — ready to copy-paste into your account.

37
Scripts
Apache 2.0
License
100%
Open Source
Showing 37 scripts
Reports

Account Spend Anomaly Detector

The single-account edition of the [MCC Spend Anomaly Detector](../mcc-spend-anomaly-detector/) — for when you don't manage the account through an MCC, or a client runs the script in their own account. Same statistical engine, plus one thing the MCC edition doesn't do: **per-campaign monitoring**, which catches the incident the account total hides — one campaign dies, the others keep spending, and the total still looks normal.

Learn More
Reports

Auto-Applied Recommendations Digest

Google can change your accounts without asking: with auto-apply recommendations enabled — sometimes without anyone remembering having enabled them — keywords appear, budgets shift, targeting expands. The change history records it all, attributed to **Recommendations Auto-Apply**, but nobody reads change history daily across an MCC. This script does, and emails one morning digest — so nothing changes in your accounts without a human knowing.

Learn More
Reports

Competitor Query Fencing

Unless you deliberately bid on competitor names, searches like "competitor-brand + your product" are expensive clicks with terrible intent — the searcher wants them, not you. Those queries slip in through phrase and broad matching, one impression at a time, across every ad group, and negating them by hand never keeps up. This script keeps up: every search term containing a competitor brand becomes a negative exact keyword in the ad group that matched it.

Learn More
Reports

DSA Allowlist Fencing

A branded campaign's DSA ad group has one job: catch brand-related queries the keywords missed. But DSA doesn't know your brand list — it matches on pages, so generic queries leak in and spend the branded budget on traffic that belongs elsewhere. This script fences the DSA ad groups of your targeted campaigns to an allowlist: search terms that do **not** contain any allowed term become negative exact keywords in the ad group that matched them.

Learn More
Reports

Exact-to-Phrase Negative Sync

In a mirrored Exact/Phrase (alpha/beta) structure the Phrase campaign's job is discovery — finding new queries. But without fencing, phrase keywords also match the exact terms your Exact campaign already owns, splitting traffic between the two and blurring your per-term data. This script builds the fence: every serving keyword in an Exact campaign becomes a negative exact keyword in its mirrored Phrase ad group, so exact traffic flows only through the Exact side.

Learn More
Reports

Inner DSA Target Sync

Part of the [DSA Layering playbook](../../docs/DSA-LAYERING.md): every keyword campaign carries one **inner DSA ad group** targeting exactly the landing pages the campaign's keywords advertise — catching the campaign's long-tail queries with the campaign's own budget, geo targeting and bid strategy. That only works while the DSA ad group's webpage targets mirror the campaign's real landing pages, and keywords change weekly. This script keeps the mirror, automatically.

Learn More
Reports

Keyword Template Expander

Accounts with a catalog dimension — brands, cities, models, materials — need the same keyword pattern repeated dozens or hundreds of times: `buy {brand} shoes` for every brand you carry, each pointing at the brand's landing page. Building that by hand is slow; keeping it in sync as the catalog changes is worse. This script does the expansion: mark template keywords with a label, declare your value list once, and every template × value combination becomes a real keyword with the placeholder substituted in both the text and the final URL.

Learn More
Reports

MCC Budget Pacing Guard

A monthly budget dies in one of two ways: it runs out on the 20th, or a third of it is still unspent on the 28th. Both are pacing failures, and both are visible weeks earlier — if someone projects the month-end spend every day. This MCC-level script is that someone: for every account with a declared monthly budget it computes month-to-date spend, projects the month-end total from the recent run-rate, and emails one digest flagging every account pacing outside tolerance.

Learn More
Reports

PMax Non-Converting Search Terms

Performance Max is a black box exactly where it hurts: which searches eat the budget without converting. The data exists — Google exposes PMax search terms through **search term insights** — but the UI buries it per campaign, per category, unrankable. This script digs it all out: every PMax search term with real clicks and no conversions, ranked worst-first, in a spreadsheet, with an email alert — ready to become negative keywords.

Learn More
Reports

Search Term Auto Expander

Google Ads matches your exact and phrase keywords to "close variants" — plurals, typos, reorderings, near-synonyms. Some of those variants quietly become your best performers, but as long as they are only search terms you can't bid on them, set their URL, or negative them apart. This script finds the close variants that have earned their place and promotes them to real keywords, automatically and with full audit labels.

Learn More
Reports

Search Term N-Gram Analyzer

Your search term report shows queries one by one — thousands of rows, each too small to judge. The patterns live one level up: the word "cheap" appearing in 400 different queries with terrible conversion rates, or "buy" quietly carrying half your revenue. This script breaks every search term into n-grams (single words, pairs, triples), sums the performance of every query containing each n-gram, and writes the ranked analysis to a spreadsheet — the fastest route to negative keyword ideas and bid insights you can't see query-by-query.

Learn More
Reports

Shopping Allowlist Fencing

A themed shopping campaign — brand terms, a product line, a category — only stays themed if you keep fencing it. Product ads match whatever Google decides is relevant, so off-theme queries leak in daily and drag the campaign's ROAS with them. This script automates the fence: every search term that doesn't match your allowlist becomes a negative exact keyword. And because fences like this grow into the thousands, it handles capacity too — when the campaign's negative keyword limit fills up, the overflow goes into auto-created shared negative keyword lists attached to the same campaigns.

Learn More
Reports

URL-Matched Price Extensions

Price extensions lift CTR — Google shows them under your ad with real prices, making the ad bigger and more concrete. But maintaining them by hand across dozens of ad groups is the chore that quietly stops happening, and stale prices are worse than none. This script maintains them automatically: declare your price sets once, keyed by landing page, and every ad group advertising that page keeps an up-to-date price extension.

Learn More

Want automation built for your account?

The scripts are the starting point. We design custom automation and reporting on top of your own setup.

Start a project