Friday, November 23, 2012

Automatically Pause Ads with Low CTR

Recently, Brad over at CertifiedKnowledge.com published some tips about testing at scale.  One of the most common testing techniques he mentions is to create a ton of ads and let Google optimize the rotation for you.  The problem with this technique is that the losers are rarely deleted.  Well, using the script below, you can find the worst performing ads in all your adgroups and pause it (if there is at least one other ad in the adgroup).

Thanks,
Russ


//-----------------------------------
// Pause Ads with Low CTR
// Created By: Russ Savage
// FreeAdWordsScripts.com
//-----------------------------------
function main() {
  // Let's start by getting all of the adGroups that are active
  var ag_iter = AdWordsApp.adGroups()
  .withCondition("Status = ENABLED")
  .get();

  // Then we will go through each one
  while (ag_iter.hasNext()) {
    var ag = ag_iter.next();
    var ad_iter = ag.ads()
      .withCondition("Status = ENABLED")
      .forDateRange("ALL_TIME")
      .orderBy("Ctr DESC")
      .get();
    var ad_array = new Array();
    while(ad_iter.hasNext()) {
      ad_array.push(ad_iter.next());
    }
    if(ad_array.length > 1) {
      for(var i = 1; i < ad_array.length; i++) {
        ad_array[i].pause(); //or .remove(); to delete them 
      }
    }
  }
}

81 comments:

  1. would this be ads with impressions?

    ReplyDelete
  2. Great help. Thank you Russell

    Could you please help me to apply this condition (pausing ads with low CTR) in certain campaigns?

    I'm following naming convention for campaigns to differentiate "Search" and "Display" network. A "Search" campaign name will contain a string "SR" and "Display campaign name will contain a string "DP".

    I would like to apply the above script condition only for "Search" (SR) campaign's Ad Groups. Thanks in Advance.

    Thanks,
    Ren

    ReplyDelete
    Replies
    1. Hi Renjith, In order to do that, all you need to do is add an additional .withCondition() to the selector on lines 8 - 10.

      var ag_iter = AdWordsApp.adGroups()
      .withCondition("Status = ENABLED")
      .withCondition("CampaignName CONTAINS 'SR'")
      .get();

      You can use CONTAINS or CONTAINS_IGNORE_CASE. More info can be found here: AdGroupSelector withCondition().

      Thanks,
      Russ

      Delete
    2. Great Article
      Cloud Computing Projects


      Networking Projects

      Final Year Projects for CSE


      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  3. Thank you very much Russel. Your guidance is a great help for many individuals like me.

    Thanks,
    Ren

    ReplyDelete
  4. Hi Russell,

    Thank you for your help, we have used several of your scripts and they have been very helpful.

    I was curious, is there a way to use this script to only pause one ad? It looks like this script pauses all of the ads in the adgroup besides the highest performing one.

    Thank you! :)

    ReplyDelete
    Replies
    1. Hi Becca, Pausing just one ad is easy enough. I am assuming you only want to pause the lowest performing ad in the adgroup.

      First, you want to make sure the ads are returned so that the first result is the worst performer. So on line 18, you want to change DESC to ASC (for ascending). You could also put a .limit(1) on there as well since you only care about 1 result.

      Next, you can replace lines 20 - 28 with this much more simple logic:

      if(ad_iter.hasNext()) {
      ad_iter.next().pause();
      }

      That should do it. Thanks for reading and please let me know if you have any other questions.

      ~Russ

      Delete
    2. Instead of .limit(1), it should be .withLimit(1).

      Delete
  5. Hi Russell,

    This is exactly what i'm looking for!

    I too just need to pause the lowest performing ad in terms of CTR for each ad group in the account.

    I've done the following:

    function main() {
    // Let's start by getting all of the adGroups that are active
    var ag_iter = AdWordsApp.adGroups()
    .withCondition("Status = ENABLED")
    .get();

    // Then we will go through each one
    while (ag_iter.hasNext()) {
    var ag = ag_iter.next();
    var ad_iter = ag.ads()
    .withCondition("Status = ENABLED")
    .forDateRange("ALL_TIME")
    .orderBy("Ctr ASC")
    .limit(1)
    .get();
    if(ad_iter.hasNext()) {
    ad_iter.next().pause();
    }
    }
    }

    However, I'm getting the following error 'TypeError: Cannot find function limit in object [AdSelector]. (line 15)'

    I'm not clued up at all on this so any help would be much appreciated.

    Thanks,

    Matt

    ReplyDelete
    Replies
    1. Hi Matt, My apologies. Instead of .limit(1), it should be .withLimit(1).

      Thanks,
      Russ

      Delete
    2. Thanks a lot Russ - that's worked a treat!

      Great blog - saved me a lot of time spent on manual tasks and problem solving.

      Cheers,

      Matt

      Delete
  6. Instead of CTR can we pause ads with lower conversions or higher cpa?

    ReplyDelete
  7. I do not know if it still work with mine. I'll check this later in my desktop and try it here occupied stagers san jose

    ReplyDelete
  8. McAfee gives McAfee activate by which you can install McAfee antivirus which protects your data if you want to visit our website McAfee activate you can visit our website McAfee account login our team will provide you complete support our team is 24*7 available.

    ReplyDelete
  9. The term "low-code app development" didn't exist until a few years ago but the concept isn't a new one. business users who see an opportunity to optimize a process and take it upon themselves to create their own apps. Rather than spend the time and manual effort to code an app from scratch that is made up of common features and components, low code development platforms let the developers work from existing templates and drag prebuilt elements, forms, and objects together to get a particular department or team the simple working app they need with a lot less hassle.

    ReplyDelete
  10. When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. การตลาดออนไลน์

    ReplyDelete
  11. When students seek our Online Nursing Case Study Writing Services from us, they are assured to receive the best Nursing Case Study Help Services that meets all their writing needs and Nursing Research Paper Services that has been written following all the instructions.

    ReplyDelete
  12. i am browsing this website dailly , and get nice facts from here all the time .

    ReplyDelete
  13. Those seeking education assignment writing services have an advantage of hiring online education assignment writers who are familiar with research papers on teaching & education for their Online Education Assignment Help.

    ReplyDelete
  14. good info www.androidcoding.in

    ReplyDelete
  15. Purchase healthcare research paper services and healthcare coursework writing services since students find help when they visit Healthcare Essay Writing Services.

    ReplyDelete
  16. Thank you sharing. keep writing and sharing.
    find here helpful info for grocery startup: Grocery App Development

    ReplyDelete
  17. Proper and Excellent content Thanks for sharing keep it. Visit Our lovely Life Time Pharmacy Secure Store
    Adderall 30mg for sale | 30mg Oxycodone near you | buy Oxycontin online 80mg in USA secure

    ReplyDelete
  18. Super Dj Remix Song New Latest Song Available On This Website,

    Good Job Sir

    Latest Official Song Download Now Click Here

    Download Now Click Here

    ReplyDelete
  19. Many people were facing problems regarding pause ads with low ctr but now they are satisfied because they have solved their issues and getting benefits from ads. Coursework writing services.

    ReplyDelete
  20. You can refresh Garmin maps utilizing the Garmin Map install programming which allows you to download and introduce the most recent Garmin maps on your gadget.

    ReplyDelete

  21. Mediator Łódź
    Adwokat Łódź




    Gilotyna
    Lutownica transformatorowa
    Gilotyna
    Taxi Zgierz
    <a href="http://przemyslawbuda.pl>Mechanik Łódź </a>

    http://zdz-lodz.pl

    http://zdz-lodz.site

    http://przemyslawbuda.pl

    http://taxi-zgierz.pl

    ReplyDelete
  22. Psychology coursework writing services are not hard to come across for those in need of Psychology Research Paper Services and psychology assignment writing services.

    ReplyDelete
  23. Nice post. Thank you to provide us this useful information. Black Widow Leather Jacket

    ReplyDelete
  24. Thanks for posting this info. I just want to let you know that I just check out your site.
    rocketeer jacket

    ReplyDelete
  25. Hi Russell,

    Is there a way to pause ads or get an alert if an ad_id reaches a certain amount spent with 0 conversions?

    ReplyDelete
  26. Hello... Thanks for the sharing your article with us... I hope your next article coming out soon.
    Best Holiday Music Album
    Christmas 2020 Songs

    ReplyDelete
  27. Finding the social psychology coursework writing services and Social Psychology Writing Services is not easy unless one is keen to establish a reputable social psychology assignment writing service provider & social psychology research writing services.

    ReplyDelete
  28. Finally found very interesting blog with valuable information wafting for next blog update.
    Data Analytics Course Online

    ReplyDelete
  29. Thank you so much for this helpful blog sharing with us. Visit Ogen Infosystem for creative website designing and SEO Services at affordable price.
    Website Designing Company

    ReplyDelete


  30. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.I want to share about tibco training .

    ReplyDelete
  31. Medical coursework writing service seekers have been on the rise lately since most learners need Medical Research Paper Services, nursing research writing services and medical essay writing services.

    ReplyDelete
  32. Awesome article I am impressed by the information that you have on this blog found very useful thank you.
    typeerror nonetype object is not subscriptable

    ReplyDelete
  33. Really nice and interesting article information shared was valuable, enjoyed reading this one. Thanks you.
    Data Science Training in Hyderabad

    ReplyDelete
  34. Our the purpose is to share the reviews about the latest Jackets,Coats and Vests also share the related Movies,Gaming, Casual,Faux Leather and Leather materials available Fire Force Jacket

    ReplyDelete
  35. I am a new user of this site, so here I saw several articles and posts published on this site, I am more interested in some of them, hope you will provide more information on these topics in your next articles. PMP Certification in Hyderabad

    ReplyDelete
  36. Finding the best powerpoint presentation online services and PowerPoint Presentation Writing Services is not easy unless one is keen to establish a reputable powerpoint presentation assignment writing service provider & powerpoint presentation coursework writing services.

    ReplyDelete
  37. Book your luxury villa with Cyprus Agency. See our selection of villas to rent in Cyprus and surrounding areas. Contact us today for availability Cyprus Villa

    ReplyDelete
  38. My site best hospitals in hyderabad has faced low CTR rate later after rectifying CTR ha improved

    ReplyDelete
  39. Nice Information Your first-class knowledge of this great job can become a suitable foundation for these people. I did some research on the subject and found that almost everyone will agree with your blog.
    Cyber Security Course in Bangalore

    ReplyDelete
  40. I am very enjoyed for this blog. Its an informative topic.
    Regards,
    ProWeb365

    ReplyDelete
  41. Writing in style and getting good compliments on the article is hard enough, to be honest, but you did it so calmly and with such a great feeling and got the job done. This item is owned with style and I give it a nice compliment. Better!
    Cyber Security Training in Bangalore

    ReplyDelete
  42. I will very much appreciate the writer's choice for choosing this excellent article suitable for my topic. Here is a detailed description of the topic of the article that helped me the most. PMP Training in Hyderabad

    ReplyDelete
  43. Water bodies are the main source of transportation for international freight forwarding. Due to this, sea freight company in Delhi,
    visit
    Freight Forwarder in Vietnam
    Shipping Company In India

    ReplyDelete
  44. Wonderful! I really like it. Thanks for sharing this. mobile app development atlanta. Really Nice.

    ReplyDelete
  45. It is late to find this act. At least one should be familiar with the fact that such events exist. I agree with your blog and will come back to inspect it further in the future, so keep your performance going.

    Business Analytics Course in Bangalore

    ReplyDelete
  46. I wanted to leave a little comment to support you and wish you the best of luck. We wish you the best of luck in all of your blogging endeavors.

    Data Analytics Course in Bangalore

    ReplyDelete
  47. I will very much appreciate the writer's choice for choosing this excellent article suitable for my topic. Here is a detailed description of the topic of the article that helped me the most.
    unindent does not match any outer indentation level

    ReplyDelete
  48. I'm glad I found this blog! Occasionally, students want to know the keys to writing productive literary essays. Your first-class knowledge of this great job can become a suitable foundation for these people. Good
    unindent does not match any outer indentation level python

    ReplyDelete
  49. All Watching high-quality dubbed and subtitled Indian Turkish Arabic and other series Download and watch directly حلم الدراما

    ReplyDelete
  50. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    blockchain online training
    best blockchain online training
    top blockchain online training

    ReplyDelete
  51. Everything is very open with a precise description of the challenges. It was truly informative. Your site is useful. Thanks for sharing! for More Information Click the Link: Download QuickBooks File Doctor

    ReplyDelete
  52. This is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you. Royalty Free Music

    ReplyDelete
  53. Casino Community-This is Casino Talk. Casino food site Casino operation information Casino food verification, etc. Baccarat site Our affiliated casinos Check our casino address. 카지노먹튀검증

    ReplyDelete
  54. This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environment react Training online. ,

    ReplyDelete
  55. This post is great. I really admire your post. Your post was awesome. data science course in Hyderabad

    ReplyDelete
  56. Thanks for sharing your thoughts. I truly appreciate your efforts and I will be waiting for your further write ups thank you once again. for more information please visit: Quickbooks Desktop Installation Errors


    ReplyDelete
  57. Thank you so much for shearing this type of post.
    This is very much helpful for me. Keep up for this type of good post.
    please visit us below
    data science training

    ReplyDelete
  58. Nice Blog !
    Here We are Specialist in Manufacturing of Movies, Gaming, Casual, Faux Leather Jackets, Coats And Vests See Big Boss Leather Jacket

    ReplyDelete
  59. Buy Adderall online at your door step from one & only trusted pharma in this ERA. Buying Adderall 30mg with Credit card.

    ReplyDelete
  60. Cash App is an electronic payment service application. Its mainly used for transferring and receiving money.

    In the US, many local shops accept payments through the app.

    It is arguably the simplest means for keeping, receiving and sending money to families and friends.
    http://cashapphelp.online/
    http://cashapphelp.support/

    ReplyDelete
  61. Excellent information, thank you for taking the time to share with us. Amazing insight you have on this, it's nice to find a website that details so much information about different artists.
    Gastroenterolog

    ReplyDelete
  62. Excellent and very exciting site. Love to watch. Keep Rocking.
    KrogerStoresFeedback

    ReplyDelete

  63. Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading.

    tellthebell.com

    ReplyDelete
  64. Best digital marketing agency in Indore offer digital marketing services like SEO, PPC, SMO, Content writing and more
    Best Digital Marketing Agency Indore

    ReplyDelete