How to Automate AdWords Ad Creation & Landing Page Checks

Automating AdWords as much as possible is every advertiser’s dream, especially when dealing with the massive accounts we see in enterprise-level SEM. This article provides a few examples of how we at Top Tier Marketing have automated some of the more laborious tasks of running AdWords. Hopefully, these examples will give you some ideas for […]

Chat with SearchBot

Automating AdWords as much as possible is every advertiser’s dream, especially when dealing with the massive accounts we see in enterprise-level SEM. This article provides a few examples of how we at Top Tier Marketing have automated some of the more laborious tasks of running AdWords.

Hopefully, these examples will give you some ideas for your own accounts. There’s even a full script that should work by simply copying it into your own account toward the end of this post. 

Automate AdWords Ad Creation From Your Catalog

Create AdWords Ads From Product Catalog

Flow for using your product database to create AdWords ads.

When the list of things you want to advertise is constantly changing, automating the creation of new ads and keywords can save you a lot of time, which you can then use to focus on higher value tasks.

Automatically created ads and keywords can run the spectrum from using one super simple template to hundreds of very sophisticated templates. The beauty of creating ads with AdWords Scripts is that you can start simple and get more advanced over time as you learn what works well and what doesn’t.

The problem with using a Script to create ads from a feed is that AdWords Scripts don’t yet support some of the JavaScript methods to connect to a database where you most likely have your catalog of everything you sell along with all the attributes you’d want to use in the ad template like price, size, reviews, etc. Without access to this data, you can’t build a script to take over the ad creation process.

There is a workaround, however: an AdWords Script can connect to a Google Spreadsheet; so, if you have the items for which you want to create ads in there, automation is within reach. And, it turns out that Google Spreadsheets have scripting functionality that supports functions to connect to databases like MySQL.

Grab the code from Google to import your database into a Google Spreadsheet.

To implement this workaround, create a Google Spreadsheet that will be the source of all the data that needs to go into your new ads; then, program this spreadsheet to connect to your database and import all the items you need.

Because a Google Spreadsheet has a limited amount of data it can contain, you’ll most likely have to filter the data you import. For example, you could fetch only those items that were updated in the past 24 hours or only items that have an ID number that’s greater than the last ID your script processed (you could store this either in the spreadsheet or in your DB where the script can request it before fetching new data).

Use Triggers in the script and program one to run automatically once per day so that all the data you need to make new ads will be up to date.

Once you’ve got your Google Spreadsheet script up and running, schedule your AdWords Script to run automatically on the hour and look for any items in the spreadsheet that haven’t been processed, turning these into new ads and keywords. (I recommend running the AdWords script more frequently because it may not be able to process all of the data if it runs only once per day.) Exactly how you templatize this is up to you, but you can do some really neat things.

For example, using a “discount”-themed template when an item is inexpensive and a “premium”-themed template for items that are pricier, allowing you to make sure your ad text really speaks to your potential buyer. We’ve done this for several of our clients, and they love the results and the time it saves them.

While Bing adCenter doesn’t have any scripting capabilities, they do have bulk uploads — so you can actually have the script you write for AdWords generate a Bing bulk file for manual upload later.

Reduce Wasted Ad Spend On Bad Landing Pages

It’s a no-brainer that your ads should include landing pages that actually load. Any time a user clicks your ad and gets a server error, it is like flushing money down the toilet. I’ve seen cases where users still convert after getting a 404 error, but they are the exception and had to work hard to find the right page on the site where they wanted to buy. Luckily, finding broken links in your AdWords ads is easy with an AdWords Script.

Here’s the code that checks for a server error and also for the presence of the words “out of stock” on the landing page. If it sees these words or the server is not responding with a code ‘200’ (which means that everything is okay), the ad is paused.

function main() {

 var options =
 {
   "muteHttpExceptions" : true
 };

 var campaignNameContains = "Campaign #1";
 var ifThisTextIsOnPageThenPauseAd = "out of stock";

 var adSelector = AdWordsApp.ads()
   .withCondition("Status = ENABLED")
   .withCondition("CampaignName CONTAINS_IGNORE_CASE '" + 
    campaignNameContains.replace(/[\[\]\"]/g, "") + "'");

 var adIterator = adSelector.get();

 while(adIterator.hasNext()) {
   var ad = adIterator.next();
   var adId = ad.getId();
   var urlToTest = ad.getDestinationUrl();
   var response = UrlFetchApp.fetch(encodeURI(urlToTest), options);
   if(response != undefined) {
     var responseCode = response.getResponseCode();
     if(responseCode == 200){
       var responseText = response.getContentText();
       if(responseText != "") {
         if(responseText.indexOf(ifThisTextIsOnPageThenPauseAd) != -1) {
           Logger.log("Pause the Ad:" + adId);
           ad.pause();
         } else {
           // Logger.log("Activate the Ad:" + adId);
           // ad.enable();
         }
       }
     } else if (responseCode == 404){
       Logger.log("Pause the Ad:" + adId + " (404 error)");
       ad.pause();
     }
   }
 }
}

 

Detect Multiple Errors & Save Time

As you can see, this code doesn’t simply stop at checking for server errors. There are other reasons why a landing page could be bad and no longer worth advertising spend. Maybe the product has gone out of stock, is discontinued, or has received so many terrible reviews that virtually nobody wants to buy it anymore. Scripts can be told to look for specific text on landing pages that corresponds to each of these situations and then take the appropriate action, such as pausing the ad.

This automated process of going through thousands of destination URLs is really the only sensible way to prevent wasting money on ads that won’t convert. There are other tools that check for broken links, but they only provide you with a list of broken items and expect you to manually act on them.

Account managers’ time is much better spent on other tasks, and if you’re relying on a process that includes even a single manual step, you’re probably not doing as good a job as possible. When we recently ran this in the account of one of our clients, we instantly identified $4,000 worth of spend that would never lead to a sale. And, for a tool that’s free, saving $4,000 was quite the ROI!

Hopefully, this script for identifying and pausing bad landing pages and the ideas for how to tie your product database to an automated ad creation process has gotten your creative juices flowing, and you’ll create some great automation for your own accounts.


Opinions expressed in this article are those of the guest author and not necessarily Search Engine Land. Staff authors are listed here.


About the author

Frederick Vallaeys
Contributor
Frederick (“Fred”) Vallaeys was one of the first 500 employees at Google where he spent 10 years building Google Ads and teaching advertisers how to get the most out of it as the first Google AdWords Evangelist. Today he is the Cofounder and CEO of Optmyzr, a PPC management SaaS company focused on making search, shopping, and display ads easier to manage with rules, scripts, reports, audits, and more. He is a frequent guest speaker at events where he inspires organizations to be more innovative and use AI and Automation Layering to become better marketers. His latest book, Unlevel the Playing Field, follows his best-seller, Digital Marketing in an AI World.

Get the must-read newsletter for search marketers.