Google Ads Scripts: What They Automate, Limits and Safe First Scripts

Google Ads Scripts: What They Automate, Limits and Safe First Scripts

Google AdsNovember 6, 2026
By Antonio Fernandez

TL;DR

  • Google Ads scripts are JavaScript programs added under Tools, Bulk actions, Scripts, and can run once, daily, weekly or monthly at a chosen hour.
  • Google's limits page caps a single-account script at 30 minutes and some manager scripts at 60 minutes; changes made before the cut-off still apply.
  • Preview mode makes no AdsApp changes, but MailApp emails are still sent and Google Sheets are still updated.
  • A manager account script can process up to 50 client accounts in parallel with executeInParallel, each with its own quota.
  • Google warns that changes made by scripts cannot be undone, so labelling every changed item is the practical safety net.

Google Ads scripts are short JavaScript programs that run inside your Google Ads account and read or change campaigns, ad groups, keywords, ads and budgets on a schedule you set. They let you automate checks and edits that would otherwise take a person hours of clicking, such as pausing ads that point to broken pages, emailing an alert when spend jumps, or writing a daily performance summary to a spreadsheet.

This guide covers what scripts can do, how to add and schedule one, the limits Google documents, which scripts are worth running first, how scripts compare with automated rules and the Google Ads API, and the risks of letting code change a live account.

What are Google Ads scripts and what can they automate?

A script is a block of JavaScript with a main() function. When it runs, it uses Google's AdsApp service to select entities in the account (for example "all enabled keywords in campaigns whose name contains Brand"), read their settings and statistics, and optionally change them. Manager account scripts use AdsManagerApp to step through the client accounts under a manager account and apply the same logic to each one.

Because scripts run on Google's servers with access to other Google services, they can also:

  • Read from and write to Google Sheets, which makes a spreadsheet a simple control panel or report output.
  • Send email through MailApp, which is how most alert scripts notify a team.
  • Fetch a web page or call an outside service with UrlFetchApp, which is the basis of landing page checks.
  • Run reports with Google Ads Query Language through AdsApp.search, so a script can work with the same metrics you see in the interface.

In practice, scripts fall into three groups. Reporting scripts only read data and write it somewhere useful. Monitoring scripts read data, compare it with a threshold and send an alert. Change scripts act on the account, for example by pausing, enabling, relabelling or adjusting bids and budgets. The first two groups are low risk. The third needs the most care, and the risk section below explains why.

How do you add, preview and schedule a script?

Google's help page on scripts describes the path as the Tools icon, then the Bulk actions dropdown, then Scripts. Google moves menu items from time to time, so the label in your account may differ slightly, but scripts have stayed under bulk actions.

Adding a script in a single account

  1. Open Tools, then Bulk actions, then Scripts.
  2. Click the plus button to create a new script and give it a clear name in the "Script name" field. A name that says what it does and how often ("Daily broken URL check, pause and email") saves confusion later.
  3. Paste or write the code in the editor. The built-in editor offers auto-complete, syntax hints and indentation, which helps catch typos before the first run.
  4. Click Authorize now above the editor and grant access. Google asks for this once per script, and the script runs with the permissions of the person who authorized it.
  5. Click Preview before you click Run script now.

What preview does, and what it does not do

Google's developer documentation states that a script running in preview mode makes no changes to the actual campaign data and instead shows the changes it would have made. That protection covers only calls that go through AdsApp. Emails sent through MailApp are still sent in preview, and spreadsheets are still updated. If a script emails a client list or overwrites a shared sheet, preview will do that for real. Scripts can check whether they are in preview through the ExecutionInfo object's isPreview() method, which is a good guard to wrap around any outside action.

Preview also has a logic trap. If a script creates a keyword and then tries to select it a few lines later, preview will find nothing, because the keyword was never saved. Code that depends on its own earlier changes can behave differently in preview than in a real run.

Scheduling

Google's help page lists schedule options of once, daily, weekly or monthly at a chosen hour. On the Scripts page, hover over the Frequency value for the script, click the pencil icon, set the date, day or time, and save. A monitoring script usually runs daily, a monthly summary runs monthly, and a one-off clean-up runs once.

Scripts in a manager account

A manager account can hold scripts that work across many client accounts at once. You need a manager account to run them, and the code uses AdsManagerApp to select accounts, often filtered by a label, before it switches into each one. Google notes that in a structure with a top-level manager and sub-managers, bulk actions owned by the top-level manager are visible only to that account, not to the sub-managers or the clients beneath it. That is useful for keeping control in one place, and it also means the people working in client accounts will not see those scripts.

What are the runtime and quota limits?

Google publishes its limits on the Google Ads scripts developer site and warns that they can change without notice. The figures below were checked against that page for this article.

  • Execution time: a script in a Google Ads account stops after 30 minutes. Manager account scripts that use executeInParallel with a callback can run for up to 60 minutes. Changes made before the cut-off still apply, so a script that times out halfway can leave an account half-edited.
  • Authorized scripts: an account can have 250 authorized scripts. Going over that limit deauthorizes an older script, which can be reauthorized when someone opens it again.
  • Iterators: selectors return at most 50,000 results by default, adjustable with withLimit().
  • IDs in a selector: withIds() must receive fewer than 10,000 IDs. Passing 10,000 or more throws a runtime error.
  • Logging: log output is cut off at 100Kb.
  • Manager scripts: executeInParallel processes up to 50 accounts, and each processAccount call can return up to 10MB of data. Each account processed gets its own quota.
  • Bulk uploads: files are limited to 50MB and one million rows, and upload jobs time out after two hours.

Reports run through AdsApp.search are not subject to the entity limits above, which is one reason well-written scripts pull data through queries rather than looping over thousands of objects one at a time. Apps Script service quotas (for email and URL fetches, for example) apply on top of the Google Ads limits.

The practical effect of the 30-minute limit is that a script handling a large account should do the expensive work in as few calls as possible: one query to fetch every keyword's statistics, then changes in batches, rather than a separate request per keyword.

Which scripts are worth running first?

Start with scripts that read and alert, then add scripts that change things once the alerts have proven reliable. Three types cover most of the early value.

Budget pacing

A pacing script compares spend so far this month with a monthly target and the number of days left. As a hypothetical example, an account with a monthly budget of 300,000 baht that has spent 180,000 baht by the 15th of a 30-day month is running ahead of an even pace (150,000 baht would be even). The script can email the team, write the projection to a sheet, or, in a stricter version, lower daily budgets in proportion. Start with the email version. Budgets interact with bidding strategies, and an automatic cut can starve a campaign that a person would have chosen to protect.

Broken URL checks

A link-checking script collects the final URLs of enabled ads, keywords and sitelinks, requests each one with UrlFetchApp, and records any that return an error status such as 404 or 500. The safe version emails a list. The stronger version applies a label and pauses ads whose landing page is down, then re-enables them when the page returns. This is one of the few change scripts that is easy to justify, because paying for clicks to a dead page has no upside. Watch for sites that block automated requests or need a login: these may report as errors even when real visitors see the page.

Anomaly alerts

An anomaly script compares today's or yesterday's clicks, cost, conversions or impressions with the same weekday in previous weeks and sends an email when a metric moves past a set percentage. It catches tracking that stops firing, a campaign paused by mistake, a sudden cost spike, or invalid-click patterns worth a closer look. The threshold matters: too tight and the team learns to ignore the emails, too loose and the alert fires only after the damage is done. Start wide and tighten after a few weeks of seeing which alerts were real.

Google also publishes ready-made solution scripts on its developer site, such as an Account Summary Report that gives an at-a-glance view of an entire account. Using a published script as a starting point is safer than copying code from an unknown source, because you can read the documented behaviour before running it.

Scripts vs automated rules vs the Google Ads API: which to use when?

All three automate work in Google Ads, but they suit different jobs.

Automated rules are built in the interface with no code. Google's help describes them as a way to change ad status, budgets, bids and more based on conditions you choose, and to send automated emails. They are the right choice for simple, single-condition actions such as "pause this campaign on a set date" or "raise this keyword's bid if it drops below the first page." They become hard to manage when the logic needs several conditions, data from outside the account, or a combined view across accounts.

Scripts sit in the middle. They need JavaScript, but no servers, hosting or separate credentials, since they run inside Google Ads under the authorizing user. They handle multi-step logic, spreadsheets, email and URL checks, and they can run across up to 50 accounts in parallel from a manager account.

The Google Ads API is for software that runs outside Google Ads: internal dashboards, bidding tools, CRM integrations or products that manage many accounts. Google's documentation now ties API access to a Google Cloud project, with access levels that start at a test level which cannot touch production accounts and higher levels that require review. The API has no 30-minute runtime cap of the kind scripts have, but you host, maintain and secure the code yourself.

Scripts vs automated rules vs the Google Ads API: which to use when?
OptionBest forMain constraint
Automated rulesSimple condition-and-action changes, scheduled pauses, basic email alertsLimited logic, no outside data sources
Google Ads scriptsMulti-step checks, spreadsheet reports, URL checks, alerts across client accounts30-minute runtime (60 for some manager scripts), JavaScript skills needed
Google Ads APIExternal tools, large integrations, products managing many accountsGoogle Cloud project setup, access review, your own hosting and upkeep

A simple rule of thumb: if a rule can do it, use a rule. If the logic needs data from a sheet, a website or several accounts, use a script. If it needs to live in your own software, use the API.

What are the risks of running a script that makes changes?

Google's own help page warns that changes made by scripts cannot be undone. There is no single "revert" button for a script run, so a bug that pauses the wrong 2,000 keywords has to be fixed by finding and reversing each change. The main risks, and how to contain them:

  • Logic errors at scale. A condition written as "greater than" instead of "less than" acts on the wrong set of entities in every campaign at once. Preview every change script and read the change list line by line before the first real run.
  • Partial runs. Because changes made before a timeout still apply, a script cut off at 30 minutes can leave an account in a mixed state. Process work in a predictable order and log what was done, so a re-run can pick up where it stopped.
  • Side effects in preview. Emails and sheet writes happen even in preview. Guard them with isPreview() or point them at a test address and test sheet first.
  • Conflicts with smart bidding. A script that keeps changing bids or budgets can fight an automated bidding strategy that is also adjusting. Decide which system owns each lever.
  • Ownership and access. A script runs with the access of the person who authorized it. If that person leaves and loses access, the script can stop. Authorize shared scripts under an account the business controls, and keep the code in a place the team can see.
  • Unknown code. A script copied from a forum can send account data to an outside address through UrlFetchApp. Read every line of code before you authorize it, especially any URL it contacts.

A safe working pattern is to apply a label to everything a script changes (for example "script-paused-2026-11"), so you can filter for those items and reverse them in bulk if needed. Pair that with an email summary after every run listing what changed.

Thai accounts raise a few specific points. Many Thai advertisers run campaigns in Thai and English side by side, so scripts that match campaign or ad group names should use labels rather than text matching, since Thai and English names rarely follow one pattern. Thai text in emails and sheets works without special handling, but check that any CSV export opens with UTF-8 encoding, or Thai characters can display as garbled symbols.

Anomaly baselines need care around Thai holidays. Songkran in April and long weekends shift search volume in many categories, and an alert comparing a holiday Monday with an ordinary Monday will fire for no useful reason. Excluding known holiday dates from the comparison, or widening the threshold for those weeks, keeps the alerts meaningful.

Agencies and in-house teams in Thailand that manage several brands or markets from one manager account get the most from manager scripts: a single budget pacing or broken URL script can cover every client account, as long as each account carries the right label and the work fits within the documented runtime limits.

Do I need to know JavaScript to use Google Ads scripts?

You need enough JavaScript to read and adjust a script, even if you start from a published example. Changing thresholds, email addresses and labels is approachable for most marketers, while writing new change logic safely needs someone comfortable with code and testing.

Are Google Ads scripts free?

Yes, scripts are part of Google Ads and Google does not charge to run them. The costs are the time to write, test and maintain them, and the risk of an error that changes a live account.

How long can a Google Ads script run?

A script in a single Google Ads account is stopped after 30 minutes, according to Google's limits page. Manager account scripts that use executeInParallel with a callback can run for up to 60 minutes, and changes made before a script is stopped still apply.

Does preview mode make any changes?

Preview mode makes no changes to campaign data handled through AdsApp, but it does send emails and update spreadsheets. Treat any action outside Google Ads as real during preview.

Can one script run across several client accounts?

Yes, a script created in a manager account can select client accounts with AdsManagerApp and process up to 50 of them in parallel with executeInParallel. Each account gets its own quota, and labels are the usual way to choose which accounts the script touches.

Scripts work best on an account that already has clean structure, reliable conversion tracking and a clear budget plan. If you want help setting up monitoring, pacing or click fraud protection around your campaigns, see Relevant Audience's Google Ads management service, or look at how the Relevant Search Google Ads programme approaches account structure and ongoing optimisation.

Antonio Fernandez

Antonio Fernandez

Founder and CEO of Relevant Audience. With over 15 years of experience in digital marketing strategy, he leads teams across southeast Asia in delivering exceptional results for clients through performance-focused digital solutions.

Share to:
Copy link:

Read us often? Add Relevant Audience as a preferred source so our articles surface more in your Google results.