Most B2B Google Ads accounts bleed budget through three predictable channels: keywords that never convert, campaigns that overpace early in the month and then starve, and search terms that creep in because match types have widened. Scripts fix all three, silently, on a schedule, without requiring a manual audit every Monday morning. This article covers the specific scripts worth deploying, what thresholds to set, and what to watch for once they are running.
Why Scripts Beat Manual Optimisation for Wasted Spend
Manual account reviews happen weekly at best. A keyword that burns $400 on zero-intent traffic between Monday and Friday is already gone by the time you open the interface. Scripts run on a schedule you define, often hourly or daily, and they can pause, label, or alert before the damage compounds. For B2B accounts where average CPCs sit between $8 and $35, catching even two irrelevant clicks per hour across a campaign cluster adds up to several thousand dollars a month in avoidable spend.
Scripts also remove the cognitive load of checking the same things repeatedly. Once a zero-conversion keyword pause script is live and tested, you reclaim the time that was going into routine hygiene and can focus on structural decisions: match type strategy, landing page alignment, and bid logic. The goal is not full automation but freeing up human attention for higher-leverage work.
Script 1: Pause Keywords With Spend and Zero Conversions
This is the single highest-return script for most B2B accounts. It scans all enabled keywords over a rolling 30-day window, finds any keyword that has spent above a cost threshold (typically 2-3 times your target CPL) and recorded zero conversions, and pauses it automatically. You set the threshold yourself: for an account targeting a $150 CPL, pausing at $300 spend with no conversion is a reasonable starting point. The script logs every action to a Google Sheet so you can review and re-enable anything that was paused incorrectly.
One important nuance: set the lookback window to match your sales cycle. If your average B2B lead takes 14 days to convert after the first click, a 7-day window will pause legitimate keywords before they have had a fair chance. For most B2B service accounts, 21 to 30 days is the right window. You can find the base version of this script in Google's official Ads Scripts solution library, which includes logging and sheet integration out of the box.
Script 2: Budget Pacing Alerts and Auto-Adjustments
Over-delivery early in the month is a consistent problem in accounts using standard delivery. A $5,000 monthly budget can be 60% spent by day 10 if daily caps are not set correctly or if a spike in search volume goes unnoticed. A budget pacing script checks actual spend against the expected daily spend rate (total budget divided by days in the month, multiplied by days elapsed) and sends an email alert when the account is pacing more than 20% over or under target. Some versions can also lower campaign daily budgets automatically when the overpace threshold is crossed.
For B2B accounts running in multiple geographies, such as simultaneous campaigns in the US, EU, and UAE, pacing divergence is common because time zones mean campaigns are technically running at different points in the day when a single budget check fires. Set pacing scripts to run at the same local time in each market, or use separate budget cap logic per region. This is one of the structural issues we address as part of our paid search management work, where budget discipline across regions is often the first thing we fix.
Script 3: Search Term Mining and Negative Keyword Automation
Phrase and broad match keywords pull in search terms you never approved. A search term pruning script pulls the last 7 to 14 days of search term data, flags any term that has generated spend above a minimum threshold (say $20) with a conversion rate below a set floor (say 0.5%), and either adds it to a negative keyword list automatically or flags it for manual review in a sheet. The difference matters: automated negatives are faster but carry more risk of blocking legitimate variants, so most B2B accounts should use the flagging approach first, review for two to three weeks, then switch to auto-add once you trust the logic.
This script is directly complementary to the broader negative keyword strategy covered in cutting wasted ad spend with negative keywords, which explains how to structure your negative lists by match type and campaign hierarchy. Scripts handle the ongoing refresh; the list architecture is still a human decision. Running both together compounds the impact: you are not just blocking bad terms reactively, you are building a self-cleaning account structure.
Script 4: Quality Score Monitoring at Scale
Quality Score affects CPCs directly. A keyword sitting at QS 3 pays roughly 67% more per click than the same keyword at QS 7, based on Google's own documented auction adjustments. Manually checking Quality Score across hundreds of keywords is impractical. A QS monitoring script exports every keyword's current score, expected click-through rate, ad relevance, and landing page experience to a Google Sheet daily, and highlights any keyword that has dropped more than two points in the past week. That flag is your signal to investigate: it usually points to a landing page change, an ad rotation issue, or a match type that has drifted into irrelevant territory.
Quality Score problems in B2B accounts often trace back to generic ad copy that doesn't match tightly-scoped commercial intent queries. If a CFO searches for 'accounts payable automation for mid-market manufacturers' and your ad headline reads 'Automate Your Finance Workflows', the relevance gap is visible in your QS data before it is visible in your CPL. For a deeper treatment of how QS directly inflates cost per lead, see how Google Ads Quality Score hurts B2B CPL.
Setting Up Scripts Without Breaking Live Campaigns
The most common mistake when deploying scripts for the first time is running them in write mode on a live account without a testing period. Always set any script that modifies bids, pauses keywords, or adds negatives to 'preview' or 'dry run' mode first. Most well-written scripts include a SEND_EMAILS = false and MAKE_CHANGES = false flag at the top of the configuration block. Run the script in read-only mode for one full week, review the Google Sheet output, and confirm the logic is catching the right things before flipping to live execution.
Frequency matters too. A keyword pause script that runs hourly is overkill for most B2B accounts with modest daily budgets, and it creates noise in your change history that makes performance diagnosis harder. Daily scripts at a fixed time (typically early morning before peak traffic) are the right default for most accounts. Budget pacing scripts can run every four to six hours without issue. Search term scripts work best on a weekly run tied to your regular account review rhythm, so that the output feeds directly into your weekly optimisation session rather than creating a separate workflow.