Google Ads Scripts for Small Accounts
Google Ads scripts let JavaScript code inside your account change bids, pause keywords, build reports and send alerts on a schedule, with nothing to host. This guide covers when they make sense for a small account, Google's ready-made scripts, and the rules on authorization, preview, scheduling and time limits.
This guide uses Google's own documentation: the Google Ads scripts overview, Getting started, Limits and the Google Ads Help article Using scripts to make automated changes, plus the pages linked in each section. Checked on 8 November 2026.
- What Google Ads scripts are
- Scripts, automated rules, Editor or the API?
- Google's ready-made scripts
- Adding your first script
- Authorization
- Preview versus run
- Scheduling
- Execution limits
- Scripts in a manager account
- Logs, history and stopping a script
- A checklist for a small account
- Frequently asked questions
What Google Ads scripts are
Google describes scripts as "a serverless automation platform that lets you programmatically manage and query your Google Ads data using modern JavaScript (ES6+) in a browser-based IDE." You write or paste the code inside your Google Ads account, and Google runs it on its own servers. There is nothing to host. Google's FAQ says scripts run "on Google's cloud infrastructure at no additional cost."
According to the overview, you can use scripts to:
- manage campaigns, ad groups, keywords and ads;
- adjust bids, budgets and status based on performance or outside data;
- run Google Ads Query Language (GAQL) queries for custom reports;
- schedule runs "hourly, daily, weekly, monthly, or on demand";
- work across many client accounts with manager scripts;
- connect to Google Sheets, Drive, BigQuery and third-party APIs.
The Help article gives plain examples: use outside inventory data "to pause/unpause keywords as inventory becomes low", or pause a keyword that is "hogging your spend for the day" and raise the budget at the same time. The external data page lists the services involved: spreadsheets, Drive, the Charts service, JDBC databases, fetching URLs and sending email.
Scripts, automated rules, Editor or the API?
Google's overview has a table for choosing. In short:
- Google Ads scripts suit a developer who does not want to run servers, and someone who is "not a developer, but am willing to invest some time learning programming." They also fit tasks that should run "without needing an active user session."
- Automated rules, bulk uploads or Google Ads Editor are Google's answer if you want bulk changes but "don't want to write any code."
- The Google Ads API is for building your own software, with your own servers, developer token and OAuth.
- The BigQuery Data Transfer Service is the pick for analysts who only want to download report data.
The Help article is frank about the fit: scripts "could be a good choice for you if you know or work with someone who can use JavaScript, and have a large account." It adds a warning worth reading twice: "Keep in mind that changes to your scripts can't be undone." If you have no one who can read the code, Google points you to automated rules, which our Google Ads automated rules guide covers.
For a small account, that means most people start with a ready-made script, change a few settings at the top, and do not write code from scratch.
Google's ready-made scripts
Help calls the pre-made library "the easiest way to get started". You can run these scripts as written or adjust them. Each solution page in the developer docs has setup steps and a recommended schedule:
- Account Summary Report: writes yesterday's stats to a spreadsheet with charts and can send a daily HTML email. Google says to schedule it "Daily, 3am or later", "since Google Ads statistics may be delayed up to 3 hours."
- Link Checker: checks the URLs in ads, keywords and sitelinks for error responses. It tracks progress over several runs, so Google says to schedule it hourly.
- Account Anomaly Detector: compares today's stats with the same weekday over past weeks and emails an alert when they differ a lot. Hourly is recommended; daily around midday is the fallback if alerts come too often.
- Common Negative List: keeps a shared negative keyword and placement list in sync with a Google Sheet. Our guide to search terms and negative keywords covers what belongs on that list.
- Flexible Budgets: changes a campaign's daily budget each day to follow a total spend plan, evenly or weighted toward the end. Read our budgets and bid strategies guide first so the script does not fight your bid strategy.
Most of these need a copy of Google's template spreadsheet and its URL pasted into the script. Inside the script editor, Help adds, you can click Documentation, then Examples, to copy sample code for common tasks.
Adding your first script
The steps from Getting started:
- In Google Ads, open the Tools menu, then Bulk actions, then Scripts. You can also search for "Scripts" in the Google Ads search bar.
- Click + and choose "New script", or pick a template from the drop-down.
- Give the script a name so you remember what it does.
- Paste the code into the editor, replacing the
mainfunction. - Click Authorize when prompted. This "has to be done once for each script."
- Click Preview and read the Changes and Logs panel.
- When the preview looks right, click Run.
Google's first example only reads data, which makes it a safe test. It logs every campaign name:
function main() {
// Get the campaign names from all the campaigns
const rows = AdsApp.search('SELECT campaign.name FROM campaign');
console.log('My campaigns:');
// Iterate through the campaigns and print the campaign names
for (const row of rows) {
console.log(row.campaign.name);
}
}
Authorization
A script acts on your behalf when you are not signed in. Google's authorization page explains why you must grant it access: scheduled scripts run "whether or not the user happens to be signed in", and a run can take up to 30 minutes. You can review the access later from your Google Account's Security page, under Manage third-party access.
Two rules catch small teams:
- If the person who wrote the script is removed from the Google Ads account, "the script will stop running but remain available." Someone who still has access must reauthorize it. Check this when a staff member or agency leaves.
- Google's limit is 250 authorized scripts. Past that, one of the previously authorized scripts is deauthorized until it is opened again.
Preview versus run
In preview mode, scripts "make no changes to the actual campaign data" and show what would have changed. There are two catches:
- Preview only covers calls through
AdsApp. Google's example: "if a script is using MailApp to send an email, it will get sent whether or not the script had been previewed or executed. Spreadsheets will get updated in both scenarios as well." - Nothing is created during preview, so code that adds a keyword and then looks for it will behave differently from a real run.
A script can check whether it is in preview with AdsApp.getExecutionInfo().isPreview(), which Google's execution info page uses to skip emailing a report during a preview.
Scheduling
Help says you can schedule a script "to run once, daily, weekly or monthly at a certain hour". On the Scripts page, hover over the Frequency column, click the pencil, pick a date, weekday or day of the month and a time, then save. The developer overview also lists hourly runs, and Google's Link Checker and Anomaly Detector pages recommend hourly.
Remember the data delay. Google says statistics may be delayed up to 3 hours, which is why its daily report runs at 3am or later. A script that acts on "today" sees incomplete numbers early in the day.
Execution limits
From Google's Limits page, which notes that limits "can change at any time without warning":
- A script in an advertiser account runs for up to 30 minutes, then is cancelled. "All of the changes made before the script was cancelled will be applied", so a timeout can leave a job half done. Google's labels docs suggest labelling what a run has processed and skipping those items next time; see our Google Ads labels guide.
- An iterator returns at most 50,000 results by default. Reports are not subject to entity limits.
- A selector handles at most 10,000 IDs in
withIds(); 10,000 or more throws an error. - Log output is cut at 100Kb.
- Bulk upload files are limited to 50MB and one million rows, and an upload job times out after two hours.
- The standard campaign selector leaves out video and Shopping campaigns; they have their own selectors.
Google's best practices help scripts stay inside these limits: filter with selectors rather than in code, use reports or GAQL search for large data pulls, and batch spreadsheet writes.
Scripts in a manager account
With a manager account, one script can work on many client accounts through AdsManagerApp instead of a copy in each account. You select a client account, and calls apply to it until you select another. By default, closed, canceled and suspended accounts are not returned.
Run accounts in parallel with executeInParallel and you can process up to 50 accounts. With a callback function, the script can run up to 60 minutes instead of 30. Each account gets its own quota, and each parallel function can return up to 10MB of data.
Help adds a visibility note: in a top-level manager with sub-managers, bulk actions owned by the top-level manager "will be visible to that account only", not to sub-manager or client accounts.
Logs, history and stopping a script
Google shows two execution logs, in preview and in real runs. The Changes log lists every change, with the value before and after and any errors, and can be filtered to errors only. The Logs output shows your console.log() lines plus any errors and warnings.
After Run, the Script history page shows recent runs and their status; the Changes link opens the detail. Help says you can stop a running script with the Stop button, disable a script from Options, and re-enable it via "Show disabled".
A checklist for a small account
The rules above are Google's; this order is our suggestion:
- Ask whether an automated rule or a one-off Editor change would do the job without code.
- Start from a Google solution script rather than code copied from an unknown source, and read what it changes.
- Authorize it with a login that will stay on the account, not a temporary freelancer's.
- Preview first, remembering that emails and spreadsheet writes still happen in preview.
- Read the Changes log before scheduling. Help warns that "changes to your scripts can't be undone."
- Schedule daily reports for 3am or later; use hourly only where Google's page recommends it.
- Where the script has an email setting, fill it in, and check Script history after the first week for errors or timeouts.
Scripts do not replace good settings. Google's recommendations and optimization score and your bid strategy still shape what the account does between runs.
Frequently asked questions
Are Google Ads scripts free?
Yes. Google's FAQ says scripts run entirely on Google's cloud infrastructure at no additional cost, and you write, preview and schedule them in the Google Ads web interface. You do not need a server.
Do I need to know JavaScript?
Google says only entry-level familiarity with JavaScript is needed, and the editor helps with syntax highlighting, autocomplete and previewing. Google Ads Help says you can use its pre-made scripts as they are written or adjust them, but someone should still read what a script changes before it runs.
How long can a Google Ads script run?
Up to 30 minutes in an advertiser account. A manager account script that uses executeInParallel with a callback can run up to 60 minutes. Changes made before a timeout are still applied.
How often can a script run?
Google Ads Help lists once, daily, weekly or monthly at a chosen hour, and Google's developer overview also lists hourly runs. Google recommends hourly for its Link Checker and Account Anomaly Detector scripts.
Why did my script stop running?
One cause Google names: if the script's author is no longer associated with the Google Ads account, the script stops running but stays available, and someone with access must reauthorize it. Authorization can also lapse past the 250 authorized scripts limit.
Automation is only as good as the account and landing pages behind it. See our Google Ads basics guide, our website development service and all our services, or email [email protected].