Google Ads scripts: automating monitoring and optimisation

What a script can do, the eight scripts an SME or an agency should install, how to install one with no technical skills, and when to prefer rules or a tool

The essentials

  • Definition: a Google Ads script is a JavaScript program run in the account (or in the manager account) at regular intervals, which reads the data, sends alerts and can change bids, budgets, keywords or ads.
  • Main use: monitoring (budget exhausted, ad disapproved, broken link, cost per conversion drifting, spend anomaly) and repetitive tasks (reports, exclusions, adjustments).
  • Without a developer: dozens of ready-to-copy scripts exist; installation takes ten minutes.
  • Limits: 30 minutes of execution maximum, maintenance when the API changes, no intelligence: a script applies a rule.

The Google Ads scripts make it possible to automate what the interface does not do, or does badly: monitoring an account every hour, spotting a landing page in error, sending a report on Monday morning, adding negative keywords from rules, adjusting bids according to the weather or stock. They are written in JavaScript, but dozens of ready-made scripts exist and are installed by copying and pasting. This article explains what they do, the eight most useful ones, installation and limits. They are part of the toolkit described in SEA tools and techniques.

What a script can do

FamilyExamplesValue
Monitor and alertBudget exhausted before midday, abnormal spend, ad disapproved, landing page returning a 404, conversion rate drop, keyword with no impressionsAvoiding silent losses; the safest value
ReportWeekly export to Google Sheets, period comparison, report by e-mailTime saved, data ready for the dashboard
Clean upAdd as negatives the search terms with no conversion beyond a given cost, pause the worst-performing adsAccount hygiene
AdjustBids or budgets according to the time of day, the weather, stock, a cost per conversion targetResponsiveness; to be kept in check
CreateGenerate ads or keywords from a feed (inventory, promotions)Accounts with large catalogues

The eight most useful scripts

  1. Abnormal spend alert: compares the day's spend with the average and sends an e-mail if the gap exceeds a threshold (for example +50%). Catches Performance Max running away and budget mistakes.
  2. Link checker: tests every final URL and flags 404s, 500s and redirects. A landing page broken over a weekend costs the weekend's budget.
  3. Disapproved ads alert: lists the ads and extensions that are disapproved or limited.
  4. Budget exhausted too early: flags the campaigns that reach their budget before a given time, so you can arbitrate.
  5. Automatic negative keywords: adds as exclusions the search terms that have spent more than €X with no conversion over 30 days, after validation in a sheet; to be used with a whitelist.
  6. Weekly report to Google Sheets: cost, clicks, conversions and cost per conversion by campaign, with the previous week; feeds the dashboard.
  7. Performance anomaly detector: conversion rate drop or cost per conversion rise beyond one standard deviation; alerts with no automatic action.
  8. Quality Score report: exports the QS and its components by keyword every week, to follow how it moves; see the Quality Score.

The first five are pure monitoring: no risk, an immediate gain. Scripts that change the account (5, bid adjustments) should first run in preview mode and write to a sheet before acting.

Installing a script in ten minutes

  1. In Google Ads: Tools, Bulk actions, Scripts (or in the manager account for several accounts).
  2. Create a script, paste the code, adapt the variables at the top (e-mail address, thresholds, Google Sheets file ID).
  3. Authorise the access requested (Google Ads, Sheets, e-mail).
  4. Click “Preview”: the script runs without changing anything and shows what it would do.
  5. Schedule it: hourly for alerts, daily for clean-up, weekly for reports.
  6. Check the execution logs during the first week.

Reliable sources of ready-made scripts: the official Google Ads Scripts documentation (solution examples), the libraries published by Optmyzr, Brainlabs and recognised consultants, and specialist forums. Check the date: the Google Ads API changes and scripts more than two years old may no longer work.

Limits and precautions

  • 30 minutes of execution per run; large accounts have to split the work.
  • Maintenance: an API update can break a script; watch the logs and the error e-mails.
  • No intelligence: a script applies a rule; it replaces neither Google's automated bidding (which uses far more signals) nor judgement.
  • Risk of automatic actions: a badly set threshold can pause profitable keywords or exclude useful queries. Start with the alert, add the action after a month of observation.
  • Security: only install scripts whose code you read, or that come from an identified source; a script has access to the whole account.

Scripts, automated rules or a tool

SolutionWhat forCostLimits
Automated rules (Google Ads interface)Simple conditions: pause, change a budget, send an e-mail based on a thresholdFree, no codeFew conditions, no link checking and no reporting
ScriptsFine-grained monitoring, reports, custom logicFree, code to copyMaintenance, execution cap
Third-party tools (Optmyzr, Adalysis)Maintained scripts, an interface, alerts, one-click optimisationsFrom $200 / monthPrice for an SME account
Multichannel steering platformAlerts on cost and conversion drift, read alongside the other channels, with no installationSubscriptionLess customisation than a script

For an SME, three monitoring scripts (spend, links, disapprovals) plus a weekly report cover the essentials; optimisation goes through well-fed automated bidding and a weekly human review. The metrics to watch are in the Google Ads KPIs, and the drifts to detect in the ten Google Ads mistakes.

Our advice: install the link checker and the abnormal spend alert today, in preview mode then scheduled hourly. That is ten minutes of work, and the two most expensive silent failures in a Google Ads account become e-mails received within the hour.

How GreenRed helps

Rather than juggling several tools, GreenRed's SEA tracking and optimisation brings these metrics together in a single dashboard, compares them over time and tells you which actions come first. You can try it free, with no card, from the Pricing.

Frequently asked questions

Do you need to know how to program to use Google Ads scripts?

Not for ready-made scripts: you just copy the code, change a few variables at the top (e-mail, thresholds, spreadsheet) and schedule it. JavaScript knowledge becomes useful for adapting a script or writing a bespoke one.

Are Google Ads scripts free?

Yes, the feature is included in Google Ads and the scripts published by Google and the community are free. The third-party tools that maintain them and wrap them in an interface (Optmyzr, Adalysis) are paid, from around $200 a month.

Can a script replace automated bidding?

No. Smart Bidding uses hundreds of real-time signals at every auction; a script applies a simple rule at fixed intervals. Scripts are there to monitor, report and clean up, and to adjust budgets or bids in specific cases (stock, weather) that Google does not know about.

What are the risks of a script that changes the account?

A badly set threshold can pause profitable keywords, exclude useful queries or change budgets at the wrong moment. Run any action script in preview mode, or writing to a sheet, for a month, review its proposals, then enable the action with safeguards (whitelist, caps).

Optimise your Google Ads campaigns

GreenRed connects your advertising spend to the revenue it generates so you can steer your ROI channel by channel.

Steer my campaigns

Related articles