Wednesday, November 21, 2012

Pause AdGroups With No Active Keywords

This is a quick script to pause all the AdGroups with no active keywords in them. Not sure if this is super useful, but for large accounts, it might help identify AdGroups you can get rid of.

Thanks,
Russ

/*********************************************
* Pause AdGroups With No Active Keywords
* Version 1.1
* Changelog v1.1
*   - Updated for speed and added comments 
* Created By: Russ Savage
* FreeAdWordsScripts.com
**********************************************/
function main() {
  // Let's start by getting all of the active AdGroups
  var agIter = AdWordsApp.adGroups()
    .withCondition('CampaignStatus = ENABLED')
    .withCondition('Status = ENABLED')
    .get();
 
  // It is faster to store them and process them all at once later
  var toPause = [];
  // Then we will go through each one
  while(agIter.hasNext()) {
    var ag = agIter.next();
    //get all the keywords that are enabled
    var kwIter = ag.keywords()
      .withCondition("Status = ENABLED")
      .get();
    
    //If .hasNext() is true, there is at least 1 kw in the AdGroup
    var hasKw = kwIter.hasNext(); 
    if(!hasKw) {
      toPause.push(ag);
    }
  }
  
  // Now we process them all at once to take advantage of batch processing
  for(var i in toPause) {
    toPause[i].pause();
  }
}

105 comments:

  1. This rule seems to time out every time? Any idea how I would manipulate this script to only search within ACTIVE campaigns? I believe it is timing out because I have a lot of deleted and paused campaigns.

    Thanks

    ReplyDelete
    Replies
    1. I'm assuming you have to add 'isEnabled()' in there somewhere.

      Delete
    2. Great Article Cyber Security Projects projects for cse Networking Security Projects 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
  2. Yeah it's easy to update. Instead of the line:

    var ag_iter = AdWordsApp.adGroups().get();

    Just use the following:

    var ag_iter = AdWordsApp.adGroups().withCondition("Status = ENABLED").get();

    Let me know if that works for you.

    Thanks,
    Russ

    ReplyDelete
  3. Hi! Is there a way to make sure that you keep DSA campaigns be excluded from this? I'm running into an issue where this script pauses all ad groups in my DSA campaign.

    ReplyDelete
  4. Thanks for sharing this post. Online assignment help from students assignment help.

    ReplyDelete
  5. Facing a deadline for finishing the essay? Well, your anxieties end here. We have with us a team of electrical assignment writing service and psychology assignment help for australia students who can solve all your writing issues so that you score high grades in your essay assignment.

    ReplyDelete
  6. All searches begin with a keyword or keyword phrase and if we want to have our blog read or our website found we must anticipate what words or phrases they will use in their search query.ppc keyword wrapper

    ReplyDelete
  7. According to reports of survey, it is confirmed now that three out of every four student seek online assignment help from professionals in Australia. It also indicate that students who avail assignment help for their assignment or homework from professionals improve their grade by 20% than those students, who do not take any help. If you are stuck with your research projects, essays, case studies, business reports or need Urgent Assignment Help, then myassignmenthelp is the place to be.

    ReplyDelete
  8. Canon Pixma MG2522 SetupDriver, Software, Download. Meet the PIXMA MG2522, a straightforward printer for your home printing needs.The PIXMA MG2522 makes it simple to.

    ReplyDelete
  9. Since modernization hit our nation hard, individuals are moving into getting things like a printer introduced at their homes. It is regular to confront little issues while working it. In this way, don't stress in the event that you are confronting inconveniences while working your Epson Printer. visit -- Printer is in an error state

    ReplyDelete
  10. I like this blog but I do not like to download this script because Maybe it is harmful to my working and I have lost the position of my keywords.
    coursework writing service

    ReplyDelete
  11. It is undisputed that Computer Science Writing Services pose challenges for students because preparation takes into consideration a lot of details needed for Computer Science Case Study Writing Services and in-depth knowledge on the topic in order to come up with award winning Computer Science Coursework Writing Services.

    ReplyDelete
  12. Social science coursework writing services are essential and it has become very popular for those seeking social science research paper writing services since most of them seek Social Science Writing Services.

    ReplyDelete
  13. Students find Human Resource Writing Services as being of great assistance since they are able to complete their human resource assignment writing services and human resource research paper writing services on time.

    ReplyDelete
  14. Very energetic blog, I liked that a lot. Will there be a part 2?

    Super Screenshot

    ReplyDelete
  15. Cool script, very useful! is there a way to add labels to the ad groups you are pausing so it's easier to go back and look at them?

    ReplyDelete
  16. Students need not to worry about their assignments, term papers and dissertations because Assignment Australia is there to help you out and get you out of distress.

    ReplyDelete
  17. The ultimate goal of criminology assignment writing services is to provide Criminology Essay Writing Services and criminology coursework writing services since criminology assignments help service seekers lack time to complete their criminology research writing services.

    ReplyDelete
  18. There is a reliable Healthcare Assignment Writing Service that is very popular for students in search of healthcare coursework writing services and nursing essay writing help services.

    ReplyDelete
  19. The ultimate goal of entrepreneurship coursework writing services is to provide Entrepreneurship Writing Services and entrepreneurship essay writing services since entrepreneurship assignments writing service seekers lack time to complete their entrepreneurship term paper writing services.

    ReplyDelete
  20. How to write a literature review? Get Literature Review Help from UK Qualified PhD Expert Writers.

    ReplyDelete
  21. Get your ideal lit review Help from UK Qualified PhD Expert Writers.

    ReplyDelete
  22. Amazing blog! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work. Thank you for this wonderful Blog! Check out the way to fix Dell Printer Error 1203. Lean how you can fix it at your own or feel free to call our experts on our toll-free numbers or visit our website to know more!

    ReplyDelete
  23. Thank you very much for giving space to us to express our feeling and thoughts about above information. I think you will keep updating and changing these information time to time if there is need to change. corporate auditing firms in India, auditing services in india , new company registration in delhi , top ca firms, gst registration for service provider in india, business advisory consulting services in india.

    ReplyDelete
  24. Hey there, I need an Statistics Homework Help expert to help me understand the topic of piecewise regression. In our lectures, the concept seemed very hard, and I could not understand it completely. I need someone who can explain to me in a simpler way that I can understand the topic. he/she should explain to me which is the best model, the best data before the model and how to fit the model using SPSS. If you can deliver quality work then you would be my official Statistics Assignment Help partner.

    ReplyDelete
  25. I don’t have time to look for another expert and therefore I am going to hire you with the hope that I will get qualityeconomics assignment help. .Being aneconomics homework help professor I expect that your solutions are first class. All I want to tell you is that if the solutions are not up to the mark I am going to cancel the project.


    ReplyDelete
  26. That is a huge number of students. Are they from the same country or different countries? I also want your math assignment help. I want to perform in my assignments and since this is what you have been doing for years, I believe you are the right person for me. Let me know how much you charge for your math homework help services.

    ReplyDelete
  27. Hello. Please check the task I have just sent and reply as soon as possible. I want an adjustment assignment done within a period of one week. I have worked with an Accounting Homework Help tutor from your team and therefore I know it’s possible to complete it within that period. Let me know the cost so that I can settle it now as your Accounting Assignment Help experts work on it.

    ReplyDelete
  28. My Assignment Help online is the hand-picked assignment help company offering most reliable Assignment Help service to students residing in Australia. Our team of writers are available 24×7 to provide professional academic writing service for assignments, essays, coursework and many more.

    ReplyDelete
  29. I am really happy to say it’s a thought-provoking post to read. I will deeply read your all info you will mention on your article it’s really helpful for me, thank you so much.
    Python assignment help

    ReplyDelete
  30. Online assignment writers are proficient scholarly writers who give assignment composing administrations to students with the goal that they can score better evaluations and gain from them the specialty of scholastic composition just as acquiring information from these specialists. Be that as it may, it is critical to know why online assignment writers are required in any case. There is a ton of tension on students to compose better assignments that can score better evaluations for them. Students don't see how to deal with the pressing factor and demonstrate their value in the academic field. myassignmenthelp

    ReplyDelete
  31. Wow, such an awesome blog you have written there and you and I get exactly what information I am looking for, in the third paragraph you put amazing effort to explain the theme of the content. As a content writer, I can understand efforts because when students ask me for programming assignment help,I do the same.

    ReplyDelete
  32. It was so hard. But I got a lot of help from your blog. 메이저놀이터 Please keep a lot of good articles in the future.

    ReplyDelete
  33. Are you feeling like your college assignment is so hard? if yes, then uaeassignmenthelp.com is one of the great places for UAE assignment writing services. we have a pretty good team who are available for 24x7 hrs and deliver top-quality assignment writing at cheesy prices.

    ReplyDelete
  34. Thanks for this Russ! It might well be 9 years old, but it is still a great script!

    Team at https://novi.digital

    ReplyDelete
  35. I appreciate your content!
    I've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article.
    By following our guidelines it will help to start by yourself and not to depend on technician.
    The adequate and sans ij start canon hands setup is there, you just need to pursue the rules as referenced on that page.

    ReplyDelete
  36. Sodium chlorite finds extensive use in the production of paper as a disinfectant. The primary application of sodium chlorite is in the creation of chlorine dioxide for bleaching or for the stripping of textiles, pulp, and paper.

    Sodium Chlorite Production Cost

    ReplyDelete
  37. Chlorine dioxide is a chemical compound. This yellowish-green gas crystallises as bright orange crystals at a temperature of -59C. As one of the mutiple oxides of chlorine, it is a potent oxidizing agent that is extensively utilised in water treatment and in bleaching.

    Chlorine Dioxide Production Cost

    ReplyDelete
  38. I accidentally searched and visited your site. I still saw several posts during my visit, but the text was neat and readable. I will quote this post and post it on my blog. Would you like to visit my blog later? 우리카지노추천

    ReplyDelete
  39. I needed several examples to write an article on this subject, and your article was of great help to me.먹튀검증커뮤니티

    ReplyDelete
  40. This is one very interesting post. I like the way you write and I will bookmark your blog to my favorites.메이저놀이터추천

    ReplyDelete
  41. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts.먹튀검증커뮤니티

    ReplyDelete
  42. Hey Friends, I want to tell you about a site that if you need any information about Canon printers, then you should check this site. ij.start.cannon

    ReplyDelete
  43. I need to to thank you for this fantastic read!! I definitely loved every little bit of it. I’ve got you saved as a favorite to look at new stuff you post… 토토

    ReplyDelete
  44. You completed a number of fine points there. I did a search on the subject and found mainly people will agree with your blog. 온라인카지노

    ReplyDelete
  45. I blog frequently and I truly thank you for your information. This article has really peaked my interest. 온라인경마

    ReplyDelete
  46. I simply could not go away your web site prior to suggesting that I extremely enjoyed the standard info a person supply for your guests?
    Is gonna be back ceaselessly in order to check out new posts 토토사이트

    ReplyDelete
  47. Thanks for sharing. By requesting for our Online DNP capstone editors, you can boost your chance of submitting a quality DNP capstone project.

    ReplyDelete
  48. Thanks for sharing such a wonderful blog with us. Keep sharing
    For best Car Transportation Services you can visit on our website.

    ReplyDelete
  49. Thanks , I’ve just been looking for info about this subject for a long time and yours is the best I have found out till now. But, what in regards to the bottom line? Are you certain in regards to the source? 안전놀이터모음

    ReplyDelete
  50. if you are looking packers and movers service for shifting your household goods pan india get a free moving quote from Agarwal Shifting Experts Packers Movers Pvt Ltd Get Extra Information to Visit http://agarwalpackersgroups.com/

    ReplyDelete
  51. First of all, thank you for your post. Your posts are neatly organized with the information I want, so there are plenty of resources to reference. I bookmark this site and will find your posts frequently in the future. Thanks again ^^ 바둑이사이트

    ReplyDelete
  52. This is very interesting, You are a very professional blogger. I’ve joined your feed and look ahead to seeking more of your excellent post. Additionally, I’ve shared your web site in my social networks. 토토검증

    ReplyDelete
  53. It's too bad to check your article late. I wonder what it would be if we met a little faster. I want to exchange a little more, but please visit my site 메이저토토사이트 and leave a message!!

    ReplyDelete
  54. Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a little bit, but instead of that, this is fantastic blog. A fantastic read. I will certainly be back. ufabet1688

    ReplyDelete
  55. Someone necessarily help to make severely articles I might state. That is the first time I frequented your web page and up to now? I surprised with the analysis you made to create this actual publish extraordinary. Fantastic process 안전놀이터

    ReplyDelete
  56. Greetings! Very helpful advice in this particular article! It’s the little changes which will make the largest changes. Thanks for sharing 안전놀이터

    ReplyDelete
  57. 789bet
    Thanks for sharing very good information. I've read it and it's been very helpful. https://www.789bet.biz/

    ReplyDelete
  58. The Electric Motor Market is expected to grow from an estimated USD 113.3 billion in 2020 to USD 169.1 billion by 2026, at a CAGR of 6.9% during the forecast period. The increase in global electricity consumption and the use of electrical equipment and machines in different industries and the renewables sector are major factors driving growth in the electric motor market during the forecast period. The most significant near-term impact on electric motors that are already contracted or in the manufacturing process will be felt through supply chains.

    ReplyDelete
  59. Been looking for this article for long time ago and finally found here. Thanks for the tips and sharing this post. appreciate!Please check out my website too and let me know what you think.
    카지노

    ReplyDelete
  60. Great post! Our writers are well equipped to handle different types of academic papers and it therefore goes without saying that once you order for our Capstone Writing Services your entire academic writing challenges shall be no more.

    ReplyDelete
  61. I’m not sure exactly why but this weblog is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later on and see if the problem still exists. 안전놀이터순위

    ReplyDelete
  62. I finally found great post here. Thanks for the information. 카지노사이트Please keep sharing more articles.

    ReplyDelete
  63. I do agree with all of the ideas you’ve presented in 온라인카지노your post.

    ReplyDelete
  64. Its an amazing website, I really enjoy reading your articles. 토토

    ReplyDelete
  65. This is really helpful post and very informative there is no doubt about it. 바카라사이트

    ReplyDelete
  66. Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job! 메이저토토사이트 Thank you very much. Can I refer to your post on my website? Your post touched me a lot and helped me a lot. If you have any questions, please visit my site and read what kind of posts I am posting. I am sure it will be interesting.

    ReplyDelete
  67. Thanks for your marvelous posting! I actually enjoyed reading it, you could be
    a great author.I will remember to bookmark your blog and will
    eventually come back from now on. I want to encourage you to continue your great
    writing, have a nice weekend!

    Website:카지노사이트


    ReplyDelete
  68. It is very well written, and your points are well-expressed. 온라인카지노I request you warmly, please, don’t ever stop writing.

    ReplyDelete
  69. I will recommend your website바카라사이트 to everyone. You have a very good gloss. Write more high-quality articles. I support you.

    ReplyDelete
  70. Great blog article. Really looking forward to read more.스포츠토토

    ReplyDelete
  71. This is one of the best website I have seen in a long time thank you so much.온라인카지노

    ReplyDelete
  72. Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon 먹튀검증업체 I would like to write an article based on your article. When can I ask for a review?!

    ReplyDelete
  73. Very nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed surfing around your blog posts. After all I’ll be subscribing for your feed and I am hoping you write again soon! ยูฟ่า168

    ReplyDelete
  74. Awesome issues here. I am very satisfied to look your article.
    Thanks a lot and I’m taking a look forward to contact you.

    Will you please drop me a e-mail?부산오피

    ReplyDelete
  75. I don't know how many hours I've been searching for a simple article like this. Thanks to your writing, I am very happy to complete the process now. 안전놀이터

    ReplyDelete
  76. I’m very pleased to discover this site. I want to to thank you for ones time for this particularly wonderful read!! I definitely savored every part of it and i also have you saved as a favorite to see new information on your blog. 메이저토토사이트

    ReplyDelete
  77. Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. 안전놀이터

    ReplyDelete
  78. I've been looking for photos and articles on this topic over the past few days due to a school assignment, Bóngđộ and I'm really happy to find a post with the material I was looking for! I bookmark and will come often! Thanks :D

    ReplyDelete
  79. Greetings! Very helpful advice in this particular article! It’s the little changes which will make the largest changes. Thanks for sharing 안전놀이터

    ReplyDelete
  80. For the reason that the admin of this website is working,
    no uncertainty very quickly it will be well-known, due to its quality contents.
    대구오피

    ReplyDelete
  81. Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. 메이저놀이터모음

    ReplyDelete