What is a Google Ads script?
What Google Ads scripts are, what they can automate, and where their limits are.
A Google Ads script is a piece of JavaScript that runs inside your Google Ads account. It can read almost anything you can see in the interface β campaigns, keywords, search terms, budgets, conversion data β and change most of it: pause ads, adjust bids, add negative keywords, apply labels. It can also reach outside the account to write a Google Sheet, send an email or call another service.
What scripts are used for
- Monitoring β check budgets, broken landing pages, disapproved ads or sudden drops in performance, and tell you when something is wrong.
- Reporting β pull data into a spreadsheet on a schedule instead of exporting it by hand.
- Optimization β adjust bids, pause poor performers or mine search terms by a rule you define.
- Bulk changes β build or update many campaigns, ad groups or assets at once.
How a script runs
Every script has a main() function. Google Ads runs it on the schedule you choose β hourly at most β or when you click Run.
function main() {
var campaigns = AdsApp.campaigns()
.withCondition("campaign.status = 'ENABLED'")
.get();
Logger.log("Enabled campaigns: " + campaigns.totalNumEntities());
}Scripts live in Tools β Bulk actions β Scripts. They can run in a single account or, from a manager (MCC) account, across many client accounts.
The limits
- A run may take at most 30 minutes.
- Google Ads tells you nothing when a script fails or stops running; you have to open the logs.
- A script pasted into ten accounts is ten separate copies. Fixing a bug means editing each one.
Those last two are what chiliad is for: scripts are stored once, delivered to every account through a small loader, and every run is recorded. See Getting started for the full path.