/google-ads-scripts:google-ads-scriptsfrom google-ads-scripts
Develops Google Ads Scripts (JavaScript) that run inside the Google Ads UI against the AdsApp API and GAQL. Covers pausing/enabling keywords, adjusting bids/budgets, pulling GAQL reports into Sheets, monitoring quality scores, and alerting on spend.
Ships in google-ads-scripts. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
JavaScript that runs in Google Ads (Tools > Bulk actions > Scripts) on the Google Ads API. Selector conditions and reports use GAQL field names (campaign.status, ad_group_criterion.quality_info.quality_score, metrics.cost_micros); Google picks the API version, so scripts do not pin one.
Read with the cheapest tool. Use selectors (AdsApp.keywords().withCondition(...)) when you will modify the entities you read. Use AdsApp.search or AdsApp.report with a GAQL query when you need metrics the Stats object lacks (conversion value, ROAS, impression share, quality-score components) or rows across many entities. Done when every metric the script uses comes from a source that actually returns it.
Filter on the server. Put every filter in .withCondition() or the GAQL WHERE, add .forDateRange('LAST_30_DAYS') (or another relative range) whenever a condition touches metrics.*, and cap with .withLimit(). Done when no JavaScript if re-filters what a condition could have filtered, and no date is hard-coded.
Get the units right. Entity methods are in account currency (Stats.getCost(), Budget.setAmount(50), keyword.bidding().setCpc(1.25)); GAQL is in micros (metrics.cost_micros > 100000000 means 100). Done when every / 1000000 divides a GAQL *_micros value and nothing else.
Gate every mutation. Ship with DRY_RUN = true, clamp each change (minimum and maximum bid, maximum percentage change per run), skip shared budgets unless intended (budget.isExplicitlyShared()), and record what changed to a Sheet or email. Done when a dry run logs exactly the changes a live run would make.
Fit the 30-minute limit. Collect the IDs to change first, then mutate; fetch entities in bulk with .withIds([...]) (10,000 per selector). For manager accounts use AdsManagerApp.accounts().executeInParallel(...) (50 accounts per call). Done when the run time is bounded by .withLimit() or batch size, not account size.
Pause keywords with a low quality score and real spend:
const DRY_RUN = true;
function main() {
const keywords = AdsApp.keywords()
.withCondition('ad_group_criterion.status = ENABLED')
.withCondition('ad_group_criterion.quality_info.quality_score < 4')
.withCondition('metrics.cost_micros > 100000000') // 100 in account currency
.forDateRange('LAST_30_DAYS')
.get();
let count = 0;
while (keywords.hasNext()) {
const keyword = keywords.next();
Logger.log(`${DRY_RUN ? '[dry run] ' : ''}Pause ${keyword.getText()} (QS ${keyword.getQualityScore()})`);
if (!DRY_RUN) keyword.pause();
count++;
}
Logger.log(`${count} keywords matched`);
}
AdsApp.AdCustomizerSource, newAdCustomizerSourceBuilder() and withOnlyLegacy() on extension selectors throw sunset errors - replacements are under "Removed features" in references/ads-api-reference.md.getMaxCpc / setMaxCpc / getReturnOnAdSpend. Bids go through entity.bidding().getCpc() / setCpc(), and ROAS is metrics.conversions_value / (metrics.cost_micros / 1e6) from GAQL. Keyword CPC bids only bite under manual CPC.AdsApp.search rows are lowerCamelCase (row.metrics.costMicros) even though the query is snake_case; int64 values may be strings, so wrap in Number().scripts/validators.py checks campaign names, keyword text (80 characters, 10 words), match types, campaign types, bids, budgets and currency/micros conversion before you hard-code them. Run python3 "${CLAUDE_SKILL_DIR}/scripts/validators.py" for a self-test, or import its functions.
assets/bid-manager-template.js and assets/campaign-optimizer-template.js - copy as the starting point for a keyword bid manager or campaign budget optimiser; both default to dry run.assets/bid-manager-template.js (opens in a new tab)assets/campaign-optimizer-template.js (opens in a new tab)references/ads-api-reference.md (opens in a new tab)references/best-practices.md (opens in a new tab)references/examples.md (opens in a new tab)references/patterns.md (opens in a new tab)scripts/validators.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub henkisdabro/wookstar-claude-plugins --plugin google-ads-scriptsOther plugins' skills for the same job