Since 1999: 27 years in IT & online

The easy way into Google Ads scripts

Automation saves time and nerves. Here are three easy ways to use Google Ads scripts even if you don't code, and how to write your first own script afterwards.

Richard Stinauer presenting on Google Ads scripts at OMT 2025

Automation is everywhere: the coffee machine, the dishwasher, the sat nav. It saves time and nerves and opens up new possibilities. Google Ads scripts bring the same to your ad account. Routine work runs automatically, mistakes surface earlier and you have more time for what really makes a difference.

At OMT 2025 in Germany, I gave a short talk for beginners on this topic: for everyone who hasn't worked with scripts yet or has only taken first steps. This article sums up the content. The slides are available as a handout (PDF, German).

What are Google Ads scripts?

Google Ads scripts are small JavaScript-based code snippets that run directly inside your Google Ads account. They handle anything from simple checks to complex workflows: creating reports, monitoring budgets, checking keywords, making changes and notifying you by email.

What's in it for you:

You don't need to know how to code to get started. There are three levels that build on each other.

Path 1: Built-in solutions in Google Ads

Google offers ready-made solutions right in your account that run as scripts in the background. You'll find them under Tools › Bulk actions › Solutions. Instead of code, you see a form.

A good example is the link checker. It regularly checks whether the final URLs of your ads and keywords are reachable. All you need to set up:

Done. No code, no room for errors. For many standard tasks, this is the fastest route to your first automation.

Path 2: Script templates from Google

One step further are the templates in the scripts section (Tools › Bulk actions › Scripts). When you create a new script, you can pick from a list of ready-made templates. This is where you see real code for the first time, but you don't need to understand it to use it.

Many templates work with a configuration sheet: you copy a Google Sheet, enter your settings there and add the sheet URL to the script. Then you authorize the script so it can access your account, the sheet and email. Before the first real run, start it via Preview: the code runs in full, but changes are only simulated.

The Google Ads Scripts developer site also has many examples for individual tasks: common methods for campaigns, ad groups and keywords, bulk uploads and reports, special methods for manager accounts (MCC) as well as for extensions and targeting.

Path 3: Scripts from third parties and communities

If neither solutions nor templates fit, chances are someone has already written a script for your problem. Good places to look:

A word of caution: a script you paste in can make changes to your account. Only use sources you trust, and always test third-party scripts in preview first. Older scripts sometimes use syntax that no longer works in the current scripts environment.

Your first own script

Some requirements can't be covered by any template. That's when your own script pays off. It gives you full control: you can build custom alerts and workflows, calculate individual metrics and reflect your own business logic.

What you should bring

Reliable sources

Ideas to start with

Mini example: pausing keywords without conversions

The last idea shows the basic logic of almost every script in just a few lines:

function main() {
  const keywords = AdsApp.keywords()
    .withCondition('ad_group_criterion.status = ENABLED')
    .withCondition('metrics.clicks > 100')
    .withCondition('metrics.conversions = 0')
    .forDateRange('LAST_30_DAYS')
    .get();

  while (keywords.hasNext()) {
    const keyword = keywords.next();
    if (keyword.getText().includes('brandname')) {
      continue; // never pause brand keywords
    }
    keyword.pause();
    Logger.log('Paused: ' + keyword.getText());
  }
}

It contains three building blocks:

  1. Selection: AdsApp.keywords() with withCondition() and forDateRange() fetches exactly the elements you care about, here enabled keywords with more than 100 clicks and no conversions in the last 30 days.
  2. Loop: while (keywords.hasNext()) goes through the results one by one.
  3. Condition: if lets you add simple logic, such as exceptions for brand keywords.

Adjust the threshold of 100 clicks to your account. Be sure to run the script in preview before the first real run and check the log to see which keywords it would pause.

How you work with scripts

Scripts run only inside Google Ads. There's no local development environment, you can't run them on your computer and you can't debug them in a terminal. You write and test in the online editor in Google Ads. Longer code can be prepared in an editor with syntax highlighting and then copied over.

The article Your first Google Ads script shows step by step how a complete script comes together, using automatic placement exclusions as an example.

AI as co-pilot, not autopilot

AI assistants are a real help when you're getting started. They can generate, explain and optimize code. Typical uses:

But: AI also hallucinates. It invents methods or objects, makes wrong assumptions about your account and mixes up the scripts environment with the Google Ads API, which works differently. So here are a few rules for using it safely:

My takeaway: AI is a real productivity booster and speeds up the learning phase considerably. But it doesn't replace understanding, and it occasionally gives wrong answers. Use it as a co-pilot, not as an autopilot.

Conclusion

Getting started with Google Ads scripts is easier than many people think. Start with the built-in solutions, then try templates and community scripts, and then take on your first own script. With the official documentation, a small concrete problem and AI as a sparring partner, you'll be up and running sooner than you think.

This article was first published in German by adtraffic in 2025 as a summary of the talk at OMT and has been substantially revised and expanded for rsc24.

First published at www.adtraffic.de

Back to overview