Keep Most Performing Ads in CTR

125 views
Skip to first unread message

Johann Lovato

unread,
Sep 12, 2012, 3:06:48 PM9/12/12
to adwords...@googlegroups.com
Hi, i try to create a script which compare in each ad group the ads between them in terms of CTR and keep only the 2 most performing.
I wish run it daily.
But who can I define the different var of the ads? Each ads have an ID but the ID change every time I create a new ad to differenciate it from the other.

How can i set a script which keep only the two ads with the highest CTR in each ad group at run the script daily based on the statistics of the 30 past days?

Adwords enables only to define optimization on clicks,conversions and the automated rules need a value of CTR, but this one change in each ad group( and if i set to pause ads under 2% and two days after all my ads are under 2%, my ad group have no more active ads).

Thanks for your help.

Kevin Winter

unread,
Sep 17, 2012, 9:39:59 AM9/17/12
to adwords...@googlegroups.com
Hi,
  I'm completely understanding your questions, so let me try to explain an approach that may help.

In AdWords Scripts, the internal ID is not exposed.  Instead, we prefer to deal with objects.  For example, you could iterate over all your ads with a selector ordering by CTR descending (you can specify the last 30 days as the time range in the selector), then skip the first two and remove the rest (run daily - and assuming you would create more ads to later remove).

- Kevin Winter
AdWords Scripts Team


Alpha

unread,
Sep 17, 2012, 11:37:19 AM9/17/12
to adwords...@googlegroups.com

Hi Kevin, can you provide an example?  I'm trying to do something similar but having trouble getting the best ad CTR at the adgroup level.

Kevin Winter

unread,
Sep 18, 2012, 12:25:36 PM9/18/12
to adwords...@googlegroups.com
This example happens for all ads, but you could simply iterate over each AdGroup and call adGroup.ads() rather than AdWordsApp.ads():

function main() {
  var ads = AdWordsApp.ads()
      .orderBy('Ctr desc')
      .forDateRange('LAST_30_DAYS')
      .get();
  var rank = 1;
  while (ads.hasNext()) {
    var ad = ads.next();
    Logger.log('Ad ranked ' + rank++ + '(' + ad.getStatsFor('LAST_30_DAYS').getCtr() + '): ' + ad.getHeadline());
  }
}

- Kevin Winter
AdWords API Team

Alpha

unread,
Sep 18, 2012, 1:56:00 PM9/18/12
to adwords...@googlegroups.com
OK great.  Thanks Kevin!

Martin Roettgerding

unread,
Sep 19, 2012, 6:20:55 PM9/19/12
to adwords...@googlegroups.com
Hey,
If I may - don't do this. This script has the potential to harm your campaigns and will probably sabotage future ad tests. The problem is that a 30 days average CTR won't always lead to the best ad. This is especially true with new ads. Here are some examples of things that can go wrong:
- An adgroup gets little traffic. A single click can tip the balance within the 30 day CTR.
- The same adgroup gets a new ad. The ad doesn't get a click in its first day. When the script runs, the ad has the lowest CTR (zero).
- If you lower your bids at some point, the ads that were active when bids were high will have better CTR's from that time. The reverse is true if you increase your bids.
- You add a new ad and it doesn't get approved right away. Before it even gets an impression, it gets paused again.
- You add a new ad and it gets the status 'Eligible', which means it can't run on search partners until it's fully approved. All the other ads run on search partners as well, which drags down their average CTR. Now one of your established ads is paused.
- A new ad might get lower initial quality scores and rank lower than your seasoned ads. There's no time to change this within a day.

I could go on... Basically, with this you can't test new ads at all because the script will force a decision every 24 hours. All those points aside - if you want to pick the best performing ad based on clicks, I'd recommend to just use the 'Optimize for Clicks' campain setting. Not only is it much more practical, but it also works better than any algorithm we could ever create from the outside.

HTH
Martin

Thomas Müller

unread,
Aug 16, 2017, 8:52:19 AM8/16/17
to AdWords Scripts Forum
Hey Martin,

good post but the "optimize for clicks" settings aren't best choice for A/B-testing of ads.

Yours
Thomas

Anthony Madrigal

unread,
Aug 16, 2017, 9:30:41 AM8/16/17
to AdWords Scripts Forum
Thanks for the observation, Thomas. If you have any AdWords Scripts related questions, feel free to create a new thread to reach out to us.

Cheers,
Anthony
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages