Fill Empty Ad Groups Script

What good is an ad if it’s empty? It’s no good. And yet every PPC-er has empty ad groups on their conscience – it’s hard to avoid if you rely on mere human intelligence. That’s why we made this script: using automation we can avoid ever having an empty ad group again, and therefore capitalise on as much search traffic as possible!

What’s included?

How does the script work?

Automatically creates an ad, filling the empty ad group and making sure you don’t pass up valuable traffic.

Sure, it’s only a generic ad — and we all know it’s important to get ads as specific and relevant as possible. But the new ads are all labelled, so you can easily find them and rewrite them. And in the meantime, you’re getting clicks you’d otherwise have been missing out on.

How do I use it?

To use the script for yourself, open a new Script in Google Ads and copy in the code below. Then change the settings at the top:

  1. campaignNameContains and campaignNameDoesNotContain filter which campaigns the script will look at. For example, if campaignNameContains is [“Brand”, “Generic”], then only campaigns with names containing “brand” or “generic” are included. If campaignNameDoesNotContain is [“Display”, “Competitor”], then any campaigns with names containing “display” or “competitor” are ignored.
    • This is not case-sensitive.
    • Leave blank, [], to include all campaigns.
    • If you need to put a double quote into campaignNameContains or campaignNameDoesNotContain, put a backslash before it.
  2. ignorePausedCampaigns should be set to true if you only want to look at currently active campaigns, or false if you want to include paused campaigns as well.
  3. ignorePausedAdGroups should be true if you only want to look at currently active ad groups, or false to look at active and paused ad groups.
  4. checkedLabelName is the label to show which campaigns and ad groups the script knows aren’t empty (as either they were already full or they’ve just had a new ETA added). This means you can rerun the script as much as you need if your account is so big the script timed out — anything with this label will be ignored in future runs.
  5. You could also manually label campaigns and ad groups with this label, to prevent the script from checking them.
  6. newAdLabelName is the label given to the expanded text ads that the script creates.
  7. If onlyLookForETAs is true, then the script will create an expanded text ad in any ad group that doesn’t contain one. If it’s false, the script will check if there is already an ad of any type — like a standard text ad or a banner ad — and only create an ETA if there are no ads of any type already there.
  8. There are six variables to make the new ETA from:
    • headlinePart1 and headlinePart2 are the headlines (max of 30 characters).
    • description is the description (max of 60 characters).
    • finalUrl is the landing page. If this doesn’t start with “http://” or “https://” the script will add “http://” for you.
    • urlPath1 and urlPath2 are the paths that show in the display URL. They are optional, so leave as “” if you don’t want them (max of 15 characters).

Google Ads Scripts can only run for 30 minutes at a time, so if you’ve got a big account, you may not be able to cover all campaigns in one go. That’s why the script labels the ad groups and campaigns once they’re processed: if the script times out, then you can just run it again and again, and it will always look only at ad groups it hasn’t checked before.

The script will check the ad text you’ve given, to make sure you’re within the character limits and you don’t have too many exclamation marks, but Google Ads may still refuse to make your ad because of policy violations. This won’t be flagged in preview runs; once you’ve run the script, you need to check the logs for messages about ads not being created. Note that ad groups where ads couldn’t be created won’t be labelled, because they’re still empty — so if there are problems, you can just change the ad text and run the script again.

If you don’t want to use the same template ad everywhere, you could run the script multiple times: use the campaignNameContains to look at different campaigns each time, and change the template ETA each time to suit those campaigns.

The Fill Empty Ad Groups Script code