Google Ads Automation Scripts Guide: Save Hours With These Proven Scripts
Learn how to use Google Ads scripts to automate repetitive tasks. Covers bid management, budget alerts, reporting, Quality Score monitoring, and more with ready-to-use examples.
March 19, 202614 min read
Google Ads Scripts are custom JavaScript programs that run inside your Google Ads account, automating tasks that would take hours to do manually. They can read and modify campaigns, keywords, ads, and bids โ and they can send emails, create spreadsheets, and call external APIs. For advertisers managing accounts with any significant complexity, scripts are the difference between reactive management and proactive optimization.
You do not need to be a developer to use scripts. Most useful scripts are 20-50 lines of code, and the Google Ads scripting documentation is excellent. This guide covers the most valuable automation scripts, explains how they work, and gives you the knowledge to implement them in your accounts.
Getting Started With Google Ads Scripts
Access Scripts from Tools > Bulk Actions > Scripts in your Google Ads account. You can create, test, and schedule scripts directly in the browser-based editor. Scripts run on Google's servers, so they do not require any local installation.
Key concepts
Scripts use JavaScript syntax with Google Ads-specific APIs (AdsApp namespace)
Every script has a main() function that serves as the entry point
Scripts can be scheduled to run hourly, daily, weekly, or monthly
There is a 30-minute execution limit for regular scripts (manager account scripts get 60 minutes)
Scripts can read data from and write data to Google Sheets, making them useful for reporting
Preview mode lets you test a script without making actual changes to your account
Script 1: Budget Pacing Alert
One of the most common account management failures is running out of budget mid-month or significantly underspending. A budget pacing script checks your actual spend against your monthly budget target and sends an email alert if you are over-pacing (will overspend) or under-pacing (will underspend) by more than 10%.
How it works
Calculate the expected spend for this point in the month (monthly budget / days in month * current day)
Compare actual spend to date against expected spend
If actual is more than 10% above expected, send an 'over-pacing' alert
If actual is more than 10% below expected, send an 'under-pacing' alert
Schedule to run daily at noon for timely intervention
Connect Google Ads and detect wasted spend with real data
AdPredictor analyzes your campaigns with AI: zero-conversion keywords, budget alerts, and actionable recommendations. Read-only. No credit card required.
This simple script prevents two expensive mistakes: running out of budget before month-end (missing high-converting days) and not spending enough (leaving potential conversions on the table). It takes 10 minutes to set up and saves hours of manual checking.
Script 2: Quality Score Monitor
Quality Score changes are invisible unless you actively check them. A QS monitoring script logs Quality Score values to a Google Sheet daily, allowing you to spot trends and react to drops before they cost you money.
How it works
Select all keywords with impressions in the last 30 days
Log keyword, campaign, ad group, current QS, and QS components to a Google Sheet
Compare today's values against the previous log to identify drops of 2+ points
Send an email alert listing all keywords with significant QS drops
Schedule to run weekly โ QS changes gradually, daily is overkill for most accounts
Over time, the spreadsheet log becomes a valuable historical record that shows which optimization actions improved or hurt Quality Score. This data is impossible to get any other way since Google only shows current QS in the interface.
The most time-consuming Google Ads task is reviewing search terms and adding negative keywords. While full automation is risky (you might block good queries), a semi-automated approach saves enormous time.
How it works
Pull search terms from the last 7 days with spend above a threshold (e.g., 5 euros)
Flag terms with zero conversions and CTR below account average
Log flagged terms to a Google Sheet for human review
Optionally: auto-add as negatives any terms matching a predefined blocklist (contains 'free', 'jobs', 'salary', etc.)
Send a weekly summary email: 'X new negative keyword candidates found, Y auto-blocked'
The key is the predefined blocklist for fully automated blocking, plus the review sheet for borderline cases. This combination catches 80% of waste automatically while leaving judgment calls to humans.
Script 4: Broken URL Checker
Ads pointing to broken URLs waste every click's cost. A broken URL checker script tests all active ad and sitelink URLs and alerts you immediately if any return errors.
Iterate through all active ads and sitelink extensions
Make HTTP HEAD requests to each final URL
Flag any URL returning 404, 500, or other error codes
Send an immediate email alert with the broken URLs and the affected campaigns
Schedule to run daily โ URLs can break anytime due to site deployments or page deletions
Script 5: Automated Bid Adjustments by Time of Day
If you use Manual CPC or Enhanced CPC, you can automate time-based bid adjustments using conversion data. A dayparting script analyzes historical conversion rates by hour and automatically sets bid adjustments to increase bids during high-converting hours and decrease them during low-converting hours.
How it works
Pull conversion data by hour of day for the last 30 days
Calculate the conversion rate index for each hour (hour conversion rate / average conversion rate)
Convert the index into a bid adjustment: index of 1.5 = +50% bid, index of 0.5 = -50% bid
Apply bid adjustments to the campaign's ad schedule
Re-run monthly to adjust for changing patterns
Script 6: Weekly Performance Report
Instead of manually pulling reports every Monday, automate them. A reporting script compiles key metrics into a formatted Google Sheet or sends a summary email with week-over-week comparisons.
Pull campaign-level metrics: spend, clicks, conversions, CPA, ROAS for the past 7 days
Compare against the previous 7-day period and calculate percentage changes
Highlight campaigns with CPA increases above 20% or spend anomalies
Format results in a clean Google Sheet with conditional formatting (red for deterioration, green for improvement)
Send an email with the sheet link and a top-line summary every Monday at 8 AM
Script 7: Ad Copy Rotation Monitor
Google's ad rotation settings often result in one RSA dominating all impressions while others get no testing volume. An ad rotation script monitors impression distribution and alerts you when one ad variant receives less than 10% of impressions in its ad group.
For each ad group, calculate the impression share of each active ad
Flag ad groups where any ad gets less than 10% of total impressions
Log results to a Google Sheet with recommendations: pause the low-performing ad or adjust rotation settings
Run monthly โ ad rotation data needs volume to be meaningful
Best Practices for Script Management
Scripts are powerful, but poorly managed scripts can cause problems. Follow these practices to keep your automation reliable and safe.
Always test in Preview mode first โ never run a new script in live mode without previewing
Add logging (Logger.log) throughout your scripts so you can debug issues from the execution log
Set up email notifications for script failures โ scripts can break when Google updates their API
Version control: Keep script code in a Google Sheet or external repo so you can roll back changes
Document what each script does, when it runs, and who owns it โ scripts become mystery black boxes quickly
Review script performance quarterly โ a script that was helpful 6 months ago may be outdated or counterproductive now
Limit automated changes: Scripts that pause campaigns or change bids should have safety limits (e.g., never increase bids by more than 30%)
When Scripts Are Not Enough: The Case for Dedicated Tools
Scripts are great for specific, well-defined automations. But they have limitations: they run on a schedule (not real-time), they require maintenance as Google's API evolves, and complex analysis (like AI-powered insights or multi-account benchmarking) is beyond what scripts can practically do.
For comprehensive account monitoring, AI-driven recommendations, and automated analysis that goes beyond what scripts offer, purpose-built tools provide a more robust and maintainable solution.
AdPredictor automates the analysis that scripts cannot โ AI-powered insights, automated alerts, and continuous optimization monitoring across your entire account. Start your free trial.