Monday morning in PPC often starts with the same round: open the account and check that no campaign stopped serving over the weekend. A script does that round for you, inside the account, at the hour you choose, and writes to you only when a campaign needs a look.

A Google Ads script is a short JavaScript program that runs inside your Google Ads account: it reads your data, sends you an alert when a condition is met, and can change bids, budgets or statuses, on the schedule you choose. Google runs it on its own servers, in an editor that opens in your browser, as its official developer overview describes.

This guide covers what a script can do, where it lives in the interface, how to install one in five steps, the official limits, and the first script worth running. The benefits for your paid search management already have their own article: 7 reasons to use Google Ads scripts.

What A Google Ads Script Can Do: Read, Alert, Modify

Google lists what scripts handle in its overview: campaigns, ad groups, keywords and ads, bids, budgets and statuses, plus GAQL queries for custom reports. In practice, every script falls into one of these families:

  • Read. The script pulls figures and writes them where you look: the log, a Google Sheet, or BigQuery.
  • Alert. The script checks a condition and emails you when it is met, through the MailApp service.
  • Modify. The script changes the account itself: it pauses a campaign or raises a bid.

The risk grows down that list: a script that reads can at worst produce a wrong figure, a script that modifies can pause the wrong campaign while you sleep.

Where To Find Scripts In Google Ads

Google's getting started guide gives the path: in the left-hand menu, open Tools, then Bulk actions, then Scripts. I recommend the shortcut the same guide mentions: type "Scripts" in the Google Ads search bar and the page opens directly.

How To Install A Google Ads Script In 5 Steps

Everything happens on the Scripts page of the account where the script will run.

  1. Step 1: Create. Click the + button and choose New script. The same drop-down lists script templates when you want a starting point. Name it after what it checks, such as "Alert: campaigns not serving".
  2. Step 2: Paste. Paste your code in the editor, in place of the main function that is already there.
  3. Step 3: Authorize. Click Authorize when Google asks: you grant the script access to the account data, once per script, as the authorization guide explains. If the script's author later loses access to the account, the script stops until someone with access authorizes it again.
  4. Step 4: Preview. Click Preview before anything else. The script runs without touching campaign data and lists its planned changes in the Changes / Logs panel. Two exceptions, stated in the preview documentation: emails sent with MailApp still go out, and spreadsheets still get updated.
  5. Step 5: Schedule. Back on the Scripts page, the Frequency column sets the rhythm: click the pencil, pick once, daily, weekly or monthly, choose the hour, then save, as the Google Ads Help Center describes. The developer overview also lists hourly runs.

After each run, the Script history page shows the status and the results, with the logs one click away.

The Official Limits Before You Start

Google publishes its ceilings on the scripts limits page. These five shape how you write a script:

  • A script on a single account runs for 30 minutes at most, then Google cancels it.
  • A manager account script also gets 30 minutes, extended up to 60 when it uses executeInParallel with a callback, on up to 50 accounts at once.
  • Authorized scripts are capped at 250 per user, according to Google's technical specifications table: past that number, one of the scripts already authorized loses its authorization until it is next opened, when you can authorize it again.
  • An iterator returns up to 50,000 entities by default.
  • Logs are cut at 100 KB.

The first limit hides a trap. When Google stops a script at 30 minutes, every change made before the cut stays applied: a half-finished run leaves the account half-modified. I don't recommend running a script that modifies the account before its preview log matches what you expect, line by line.

Account Script Or Manager Account Script

An account script lives in one Google Ads account and only sees that account. A manager account script, often called an MCC script, lives in your manager account and reaches the accounts under it: the AdsManagerApp object lets one script handle every managed account instead of one copy per account, according to the manager scripts guide. By default, its account list leaves out closed, canceled and suspended accounts.

The installation steps stay the same; you only need a manager account first. My recommendation is to test a script on one account, then move it to the manager account once it runs clean. The details are in What are MCC scripts in Google Ads?

Your First Script: An Alert When A Campaign Stops Serving

The best first script changes nothing! It reads, then writes to you. This one lists the enabled campaigns that got zero impressions yesterday and emails you their names. It only uses methods from the official AdsApp reference.

// Alert: enabled campaigns with zero impressions yesterday.
// Reads only. Changes nothing in the account.
const RECIPIENT = 'you@example.com';

function main() {
  const silent = [];
  const campaigns = AdsApp.campaigns()
      .withCondition('campaign.status = ENABLED')
      .get();

  while (campaigns.hasNext()) {
    const campaign = campaigns.next();
    const stats = campaign.getStatsFor('YESTERDAY');
    if (stats.getImpressions() === 0) {
      silent.push(campaign.getName());
    }
  }

  if (silent.length === 0) {
    console.log('All enabled campaigns served yesterday.');
    return;
  }

  const account = AdsApp.currentAccount().getCustomerId();
  const body = 'No impressions yesterday:\n- ' + silent.join('\n- ');
  console.log(body);

  // Preview still sends emails: send only on a real run.
  if (!AdsApp.getExecutionInfo().isPreview()) {
    MailApp.sendEmail(RECIPIENT, account + ': campaigns not serving', body);
  }
}

The same logic applies to spend: the budget alert script walks through it step by step.

Where To Find More Scripts

Google publishes ready-made scripts in its Solutions gallery, and the + button of the Scripts page offers templates. For a selection sorted by use, see the best Google Ads scripts ready to use.

Read the code before you authorize it: the script gets access to your account data. I prefer a short script I understand over a long one I cannot read. Every article on the subject sits in the Google Ads scripts category.

When An Automated Rule Is Enough

Google Ads also offers automated rules: you set conditions and an action, such as pausing an ad or changing a budget, the rule runs at the frequency you pick and can email you the results, as the Help Center page on automated rules explains. No code involved. Google's own developer overview points to automated rules, bulk uploads and Google Ads Editor for bulk changes without code.

Use a script if:

  • The check spans several campaigns or several accounts from a manager account.
  • You want the result written to a Google Sheet or in an email you design.
  • The logic needs your own calculation, written in JavaScript.

Use a rule if:

  • One condition triggers one action on one account.
  • Nobody on the team can read the code when it breaks.

I think a rule covers most single pauses and budget changes on one account. The full comparison lives in Google Ads scripts vs automated rules.

Frequently Asked Questions

How Do You Learn Google Ads Scripts?

Start with Google's official developer guide: the first script and the limits are both there. Google states that entry-level JavaScript is enough, since the editor highlights syntax, completes your code and previews results. Then read short scripts line by line, change one condition, and preview again until the log matches your expectation.

Is There A Google Ads Script Library?

Yes, Google maintains two official sources. The Solutions gallery on its developer site holds complete scripts, and the + button of the Scripts page lists templates inside the account. Before scheduling any of them, read the settings at the top of the code and check the preview log.

Can You Build Custom Google Ads Scripts?

Yes. A script is plain JavaScript, so it can read your own thresholds from a Google Sheet and email the people you choose. Custom code also means custom maintenance. I suggest you write down what each script checks and who receives its alerts, so the next person can maintain it.

Your next step: paste the alert above into one account and run the preview. Once the log reads right, schedule it daily. For an outside view on your account and its automations, discover the Google Ads management service.