The AdWords Script To Create Ads In Bulk
February 17, 2016
This month I’d like to share a script I originally built 3 years ago to help with ad text optimization in AdWords. It’s intended to make sure all ad groups have enough experiments running, and can also be used to create new ads across many ad groups in bulk. It could also be used to clean up the worst performing ad in each ad group.
AdWords Script For Bulk Ad Creation
The main purpose of the script is to generate a bulk sheet for use with AdWords Bulk Uploads to implement new ads in the account. It can be used to make sure every ad group has, at least, a minimum number of ad tests running, or it can be used to simply add a specific number of new ads to all ad groups.
The power of the script is in that it knows how many ads exist in each ad group so it can automatically create the right number of lines for each ad group in the spreadsheet to help you get to the number of ad experiments you want. For example, if you want to always have at least 3 ad tests per ad group, the script will add 1 line for an ad group that already has 2 active ads and 2 lines for an ad group with only 1 active ad.
The script is also helpful because it populates the default ad text using your preferred criteria for determining the best ad. More on those criteria later.
While the intended functionality of the script is to help you create new ads in bulk, the beauty of scripts is that it’s not particularly difficult to tweak the functionality so that it could be used to help identify the worst ad in each ad group and remove that through a bulk upload.
How Ad Optimization Is Usually Done
This script helps with running ad text experiments so I thought it’d be useful to briefly cover the 3 main ways I see most advertisers go about optimizing their ad text:
- Let Google handle it with optimized ad rotation
- Use a tool to help eliminate losing ad texts based on statistical analysis
- Do it manually
Here are my thoughts on each of these 3 techniques.
Google Optimized Ad Serving
Google makes money when users click on ads, so for as long as I can remember, they automatically gave preference to the ad with the highest CTR. When I was with Google working on the team that handled ad text optimization, a frequent request from advertisers was for a way to automatically give more exposure to the ad with the better conversion rate.
While that sounds good in theory, it’s trickier than it looks because the ad with the best conversion rate might not have a very good CTR so it might drive very few conversions because it gets few clicks, even though those clicks then convert at a great rate. It took Google a while, but now they allow advertisers to automatically show more of the ad that will drive more conversions.
There are some downsides to Google’s automated approach:
- It may seem like new ad tests end too early
- There is a false perception that ad testing is happening
Let me explain in more detail.
Tests Are Ended Too Early
When adding a new ad to the rotation, it may quickly see its “% Served” metric fall very low, even before it has just 100 impressions. To a marketer that may seem like an unreasonably quick judgment of the new ad. After all, maybe the ad would have done better on a different day of the week, at a different time of the day, in a certain region, or in another segment of all available queries.
While at Google, I often had to try and explain why this happened so I asked one of the product managers whether this could possibly be a bug and I was repeatedly assured that the system was working as intended and that it quickly had enough data to make a statistically valid decision. Google looks at far more than just the impressions the new ad gets and can compare the new ad to other ads and is able to draw conclusions very quickly. Again, Google makes money when people click on ads so they have a strong incentive to get this right and not waste too many impressions on underperforming ads.
While intuitively this seems wrong, the data behind it says it’s right. It’s simply a situation where we as advertisers have to trust that Google’s massive computing power is getting this one right.
False Perception That Tests Are Happening
The other problem with letting Google handle ad optimization is that it may give advertisers a false perception that they are doing a better job than they actually are. When auditing an account, I usually look at whether there are multiple ads running in each ad group. I even like to check that there are at least 2 mobile preferred ads and 2 regular ads. When using Google optimized ad serving, there may be at least 2 ads per ad group, but it might be that one ad gets 99% of all the impressions, which effectively means there is no ad testing happening.
Checking for this condition is a bit more involved so many advertisers may miss it, and almost certainly a client who has trusted their account to an agency may overlook this detail.
Ideally, any ad that has been deemed a loser should be removed. It declutters the account and makes it clear it’s time for new ads to be created.
Ad Optimization Using Statistical Methods For A/B Tests
Some advertisers prefer more control over which ads get served more and will run their own experiments. Determining a statistically significant winner and loser is pretty straightforward using one of the many statistical significance calculators. The challenge is in doing this methodology across hundreds or thousands of ad groups.
It’s also important to consider which ratio to use to determine winners and losers. You could use CTR, like Google does by default, or you could use conversion rate or conversions per impression which combines the 2 previous metrics together. Personally, I think ads should be optimized for CTR, because the goal of the ad is to get a user to click and visit my site. Then it’s up to the landing page to convince that user to sign up and convert. If you find you don’t have enough control over landing pages, then you might want to optimize ads for a metric that includes conversions.
There’s a great script written by Russ Savage that can automate this process. I haven’t tested it recently so I’m not sure it still works given recent changes to AdWords Scripts, but the code is a good baseline for anyone who wants to automate ad testing in this manner.
My company Optmyzr includes a popular tool for A/B ad testing that works for text ads, image ads, and even dynamic search ads and is a great alternative for those who prefer not to mess with scripts.
Manual Ad Optimization
Finally, there are advertisers who neither want Google to optimize ad serving, and who don’t consider the best ad based on one of the ratios that can be used by statistical significance calculators. It could be that they prefer to keep ads based on lowest CPA, best ROI, or some other metric. These are the advertisers who may find my script useful to help make new ads based on what they consider the current best ad.
The script can identify the best or worst performing ad based on an AdWords metric or a calculated metric. For example, a calculated metric could be some combination of AdWords metrics, or it could be a metric that is calculated for each ad based on the aggregate data from its ad group, like the ‘percentage of total clicks’ the ad has received in its ad group.
The original purpose of the script was to help create new ads by writing the BEST performing ad from each ad group to a spreadsheet but you could just as easily reverse the logic and make it write the WORST ad to the spreadsheet. Then you could do a simple find-and-replace on the sheet to turn “add” into “remove” so that rather than making new ads, you’d remove the worst ad.
The Script To Bulk Create New Ads
Here is the script. Simply copy-and-paste it to your account and try it as-is or modify some of the settings first. Remember all this script does is generate a spreadsheet for use with bulk uploads so there’s very little risk in running this in your account but as always, run it in preview mode first just to be on the safe side.
To change the settings, change the values between lines 5 and 22. I’ve added some of the possible values you can use after the ‘//’ on each line. For the allowed date range settings, refer to the allowed values from the reporting specifications.
Here is a full rundown of what each of the settings does:
- currentSetting.enabledCampaignsOnly: set to 1 to include only enabled campaigns
- currentSetting.enabledAdGroupsOnly: set to 1 to include only enabled ad groups
- var adLabel: the name of the ad label for ads to consider. For example, if you want to make sure you have three weekend ads running and those are all labeled, ‘weekend’, then include this label here so that the script won’t do anything with your weekday ads
- currentSetting.calculation1: use this to pick the best ad using a custom formula, for example “?Ctr * ?ConversionRate”. Note that each metric should be preceded with a question mark so that the script will know to replace this with the actual value of that metric.
- currentSetting.keepHighestOrLowest: whether the ad with the highest or lowest value is considered the best one.
- currentSetting.sortBy: the metric by which to sort ads from best to worst. This could be any of the standard AdWords metrics like “Ctr”, the custom calculation “calculation1”, or one of the calculated ratios like “clickShare”, “impressionShare”, “conversionShare”, “convertedClicksShare” which count the percentage of that metric of the total for the ad group.
- currentSetting.showAllAds: set to 1 if you want all ads from an ad group to be rendered in the spreadsheet.
- currentSetting.devicePreference: to pick the device type preference. Allowed values are “notMobilePreferred”, “all”, “mobilePreferred”
- currentSetting.optimizationMethod: whether you’d like to “add n” new ads to all ad groups or ensure every ad group has “at least n” ad tests running (for the selected device preference and with the specified ad label).
- currentSetting.numAdsToKeep: the number of ads you’d like to be testing in every ad group, or the number of new ads you’re trying to add.
- currentSetting.time: the date range used to calculate the best performing ad, e.g. “LAST_30_DAYS”.
- currentSetting.email: who should get an email every time the script completes running.
- accountManagers: who should have access to the generated Google Spreadsheet. Comma separate for multiple email addresses, e.g. “firstname.lastname@example.org, email@example.com”.
- var campaignNameContains: if you only want to include campaigns whose name includes this text, e.g. “search”.
- var campaignLabel: if you only want to include campaigns that have a certain label.
- currentSetting.adImpressionThreshold: the minimum number of impressions before an ad may be considered to be the best.
- currentSetting.showAdLabels: set to 1 to include the ad’s labels in the spreadsheet.
- currentSetting.showAdGroupLabels: set to 1 to include the ad group’s labels in the spreadsheet.
I hope you find this script useful to help with creating bulk ads in AdWords. As always, I hope you will consider editing this script to make it do exactly what you need, for example, to help remove the worst ads from your account. If you want to use this script but don’t want to deal with the complexity of editing the settings in the code, consider trying the Enhanced Script™ version which is part of the Optmyzr PPC tool suite (my company). It makes it easier to change the settings, works in MCC accounts, is maintained and updated to work even if Google makes changes to the APIs and has a few other small enhancements to improve the usability.
[New Webinar!] 11 Red Flags To Watch Out For When Working With An Agency
Leveraging Analytics For Remarketing: Picking The Ripest Fruit
Remarketing prevalence is well founded based on competitive returns in both volume and efficiency. With that said, this "low hanging fruit" world isn't always easy to pick.
How To Analyze Time-Of-Day Performance For Luxury Products
The importance of ad schedules varies across industries, services, and products. For e-commerce companies that sell luxury goods, ad schedules are more crucial.
A bi-weekly newsletter packed full of resources and strategies that will help make you a better PPC expert.
Hanapin Marketing | The PPC Agency of Experts Behind PPC Hero
One Week Left to Save 25% at Hero Conf London!
You still have time to join us for Hero Conf London, 24-26 October at etc.venues St Paul's at 25% off the conference price. But time is running out.
4 Common Questions Prospects Ask Me During The Sales Process
There’s always new, hot topics and questions we get asked by prospects to see what our company’s take is, and how we go about implementing from a services perspective. Read what our most common questions are.
Mobile Price Extensions Rolling Out In AdWords
It looks like "Christmas in July" has come to Google. Recently announced price extensions are designed to help mobile marketers qualify clicks and inform prospective consumers.
[New Whitepaper!] 4 Ways To Survive PPC Campaigns for the Healthcare Market...
This whitepaper will highlight four examples of how thinking at the corners can help boost your PPC performance in the healthcare industry.
Create Visually Appealing Reports With Google Data Studio
When we talk about what tasks tend to eat up a significant chunk of time, reporting is surely mentioned. You may want to explore another option - Google Data Studio.
Liveblogging 2016 DoubleClick Announcements
Today is the day we learn more about the latest DoubleClick updates. Follow along live as we share DoubleClick's announcements as well as our opinions.
The 2016 Top 25 Most Influential PPC Experts
After a month of voting, rigorous research and data analysis, we are excited to announce the wildly anticipated list of the Top 25 Most Influential PPC Experts for 2016.
[New Webinar with AdEspresso!] 4 Effective Strategies for Facebook Lead Gen...
In this new webinar, AdEspresso and Hanapin experts discuss four effective strategies to use Facebook Lead Gen Ads for your business.
PPC Hero Launches New Site!
We're excited to announce the launch of a brand new PPC Hero! We've redesigned the site to be more search friendly with a better navigation system and more opportunity to find the right resources quicker.
How To Get More Out Of Excel Solver
Excel Solver is a fantastic tool, but most examples only cover simple marketing use cases. We’ll cover the next steps of enhancing your models and how to automate the process.