It is noon. One of your campaigns has already spent half its daily budget, and you are in a meeting. Google Ads gives you two ways to hear about it in time: an automated rule, which you set up in a form, or a script, which you write in JavaScript. The two do not carry the same risk and do not cover the same needs.

An automated rule is a setting inside Google Ads: you pick an action, the items it applies to, a few conditions and a schedule. A Google Ads script is a JavaScript program written in the account's editor: it reads the account, applies your own logic, then alerts you or makes changes.

The short answer: a rule for one simple decision that repeats, with no code and an Undo button for its latest changes. A script as soon as you need your own logic, outside data, a report in a Sheet or several accounts at once, knowing that nothing undoes its changes. Either way, I recommend starting with an automation that alerts you rather than one that changes your bids.

What An Automated Rule Does

You create a rule from Tools, then Bulk actions, then Rules, or straight from a campaign, ad group or keyword table. Google's help center lists the fields you fill in:

  • Action: enable or pause campaigns or ads, pause keywords, change budgets or bids, change keyword final URLs, add labels, or only send an email.
  • Apply to: all campaigns, or the items you select.
  • Conditions: the thresholds that trigger the action, read on the data range you choose, such as the same day, the previous day or the previous 30 days.
  • Frequency: once, daily, weekly or monthly, at the hour you set.
  • Email results: after each run, or only when the rule made changes or hit errors.

Two details change how far you can trust a rule. It runs within 2 hours of its scheduled time: a rule set for 9 a.m. can run at any point until 11. And the Undo button, on the Version history page, only reverses the latest changes made by campaign, ad group, ad and keyword rules. It leaves alone the edits you made by hand after the run, and an email rule cannot be undone.

Google's own example of an alert rule fits the opening scene: a daily rule, running at noon on same-day data, that emails you if a campaign's cost has already gone past half its daily budget (common ways to use automated rules). One condition, one fixed amount, one email.

What A Script Adds

A script also runs on a schedule, and the logic is yours. Google's page on scripts gives the example of one script that pauses a keyword and raises a budget at the same time. In practice, it adds:

  • Your own logic in one decision: compare yesterday with the campaign's own history, combine cost, clicks and conversions, then act or alert.
  • Outside data: the Google Ads scripts documentation lists Google Sheets, Drive, BigQuery and third-party APIs.
  • Reports you design: an email or a Sheet with exactly the lines you want.
  • Several accounts: from a manager account, one script can work on up to 50 accounts in parallel (limits page). The details are in my article on MCC scripts.

The trade-off is maintenance. Google writes that scripts could be a good choice if you know or work with someone who can use JavaScript, and have a large account you want to change in an automated way. A script stops after 30 minutes (60 for some manager account scripts), and the changes it made before the stop stay applied. Google's page on scripts also says that changes made by your scripts can't be undone.

Automated Rules Vs Scripts: The Comparison

CriterionAutomated ruleScript
SetupA form, no codeJavaScript in the account's editor
LogicOne or more actions, conditions on thresholdsSeveral conditions and actions, comparison with history
ScheduleOnce, daily, weekly or monthly; runs within 2 hours of the set timeOnce, hourly, daily, weekly or monthly, or run on demand
AlertsEmail with the results after the runEmail, Sheet or report written your way
DataAccount metrics over a chosen rangeAccount metrics, plus Sheets, Drive, BigQuery and outside APIs
UndoUndo button for the latest changes of campaign, ad group, ad and keyword rulesNone: changes stay
TestPreview before savingPreview button; emails and Sheets still go out
Who maintains itAnyone who knows the interfaceSomeone who reads JavaScript
Best forOne simple decision that repeatsLogic, outside data, several accounts

The table comes down to two rows: Undo and maintenance. A rule wins whenever the decision fits in one sentence, because you can reverse it and anyone on the account can read it. On any PPC account, I prefer a rule over a script for that kind of decision. Google says the same: if you don't have scripting skills, or prefer a more structured way of making and scheduling changes, it suggests considering automated rules.

Where A Script Beats A Rule

Now take the noon alert on twenty campaigns with different budgets. In Google's example, the condition is one fixed amount: that means one threshold per campaign to set and keep up to date. A script compares each campaign with its own figures. The budget alert script is built on this idea.

This short example only reads and alerts: it emails you the campaigns that spent more yesterday than twice their daily average over the last 30 days. Run it with the Preview button first: in preview, the script writes the result to the logs instead of sending the email, because preview mode blocks changes to the account and still sends emails.

// Alert: campaigns that spent far more yesterday than their own daily average.
// Reads and emails only: it changes nothing in the account.
const EMAIL = 'you@example.com';
const RATIO = 2;      // yesterday above 2x the 30-day daily average
const MIN_COST = 20;  // ignore small amounts, in the account currency

function main() {
  const account = AdsApp.currentAccount();
  const lines = [];
  const campaigns = AdsApp.campaigns()
    .withCondition('campaign.status = ENABLED')
    .get();
  while (campaigns.hasNext()) {
    const campaign = campaigns.next();
    const yesterday = campaign.getStatsFor('YESTERDAY').getCost();
    const average = campaign.getStatsFor('LAST_30_DAYS').getCost() / 30;
    if (yesterday >= MIN_COST && yesterday > RATIO * average) {
      lines.push(campaign.getName() + ': ' + yesterday.toFixed(2) +
        ' yesterday vs ' + average.toFixed(2) + ' per day on average');
    }
  }
  if (lines.length === 0) return;
  const subject = 'Spend spike, account ' + account.getCustomerId() +
    ' (' + account.getCurrencyCode() + ')';
  if (AdsApp.getExecutionInfo().isPreview()) {
    console.log(subject + '\n' + lines.join('\n'));
    return;
  }
  MailApp.sendEmail(EMAIL, subject, lines.join('\n'));
}

AdsApp.campaigns() covers Search and Display campaigns only: Performance Max, Shopping and video campaigns each have their own selector in the AdsApp reference.

To install it, follow the steps in what a Google Ads script is and how to install one: paste the code, replace the email address, authorize, preview, then schedule it daily. To go further: the best Google Ads scripts ready to use.

Before A Rule Or Script Touches Your Bids

Changing bids or budgets on autopilot is where an automation costs money. Google's tips for automated rules name the traps: rules have no priority, so two rules on the same items both run; a bid that keeps rising can lead to unnecessarily high CPCs; and a conversion can come many days after the click, so Google advises a longer data range for any rule based on conversions.

My recommendation is to move in this order:

  1. Alert first: an email rule or a read-only script for a few weeks, before anything changes on its own.
  2. Preview: on a rule, preview before saving; on a script, remember that preview still sends emails and writes to Sheets.
  3. Limits: every bid or budget change gets a minimum and a maximum. A bid rule without a ceiling is an open tap!
  4. Once, then recurring: run the rule one time, check the result in the change history, then schedule it.
  5. Staggered times: two automations on the same campaigns never run at the same hour.

I do not recommend letting a rule and a script manage the bids of the same campaigns: each can reverse what the other did, and the change history no longer tells you which one decided.

Where To Start

I suggest you open the Rules and Scripts pages of your account today and list what already runs: the action, the owner, the last run. Since July 2021, a rule keeps running even when the person who created it no longer has access to the account (Google Ads Help), so a rule set up by a former colleague or provider can still be changing your account. Keep what alerts, and put a limit on everything that touches bids or budgets.

The Google Ads audit checklist helps you go through the rest of the account. If you want a second pair of eyes on your automations, here is how I work as a freelance Google Ads consultant. Other articles on the topic are in the Google Ads scripts category.