Monday, November 26, 2012

Update Ads for the New Year

This is a companion to one of my earlier posts about updating your keywords for the new year.  You can easily run through each ad you have and update them all for the new year using the script below.  It will also pause the old ad as well, making sure your staying relevant to your customers.  You should schedule this to run every year on January 1st if your advertising relies heavily on dated traffic.

Thanks,
Russ

//-----------------------------------
// Update Ads for 2012
// Created By: Russ Savage
// FreeAdWordsScripts.com
//-----------------------------------
function main() {
  var OLD_YEAR = "2011";
  var NEW_YEAR = "2012";
  //You probably shouldn't update destination urls unless you know what you are doing.
  var FIELDS_CONTAINING_YEAR = ["Headline","Description1",
                                "Description2","DisplayUrl"
                                /*,"DestinationUrl"*/
                               ];
  
  for(i in FIELDS_CONTAINING_YEAR) {
    var field_iter = AdWordsApp.ads()
        .withCondition(FIELDS_CONTAINING_YEAR[i] + " CONTAINS " + OLD_YEAR)
        .withCondition("Status = ENABLED")
        .get();
    
    _iterateThroughAds(field_iter);
  }

  //---------------
  // Private Helper Functions
  //---------------  
  function _iterateThroughAds(ad_iter) {
    while (ad_iter.hasNext()) {
      var ad = ad_iter.next();
      var ag = ad.getAdGroup();
      _createNewAdFromOldAd(ag,ad);
    }
  }
  
  function _createNewAdFromOldAd(adgroup, old_ad) {
    //get the updated ad texts replacing all the old years with the new years
    var new_headline = old_ad.getHeadline().replace(OLD_YEAR,NEW_YEAR);
    var new_desc1 = old_ad.getDescription1().replace(OLD_YEAR,NEW_YEAR);
    var new_desc2 = old_ad.getDescription2().replace(OLD_YEAR,NEW_YEAR);
    var new_display_url = old_ad.getDisplayUrl().replace(OLD_YEAR,NEW_YEAR);
    var new_dest_url = old_ad.getDestinationUrl();/*.replace(OLD_YEAR,NEW_YEAR);*/
    
    //now create the new ad and pause the old one.
    adgroup.createTextAd(new_headline,new_desc1,new_desc2,new_display_url,new_dest_url);
    old_ad.pause();
  }
}

89 comments:

  1. Yes, I can show you how to write an essay about yourself. Just have a peek here https://justdomyhomework.com/blog/essay-about-yourself

    ReplyDelete
  2. Psychology Coursework Writing Services has become a significant challenge owing to the complexity of Psychology Research Writing Services and in other cases lack of time and knowledge needed to prepare Online Psychology Assignment Writing Services .

    ReplyDelete
  3. Engineering assignment writing services are essential for college & university engineering research paper services seekers and Engineering Writing Services.

    ReplyDelete




  4. Wonderful information! I found amazing information on the blogs i suggest everyone to follow the links below to get download files from this website.



    https://apkfasak.com/fmwhatsapp-apk/
    https://apkfasak.com/gb-whatsapp-apk/




    ReplyDelete
  5. Nice post. I learn something totally new and challenging on websites I stumble upon every day. It's always useful to read through articles from other authors and practice something from other sites.also try this WhatsApp Plus Apk.

    ReplyDelete
  6. This is pretty informative. You can also check this messaging app mod that I found :

    https://flosshype.com/fmwhatsapp/

    ReplyDelete
  7. Download thoptv for pc download – Latest version – Free for Android and watch the latest films and tv shows for free! Enjoy unlimited streaming now in this awesome app!

    ReplyDelete
  8. It is important for neurobiology coursework writing help seekers to find the best Neurobiology Writing Services from a reputable neurobiology research paper writing service provider for their custom neurobiology essay writing services.

    ReplyDelete

  9. It's no wonder that in recent whatsapp plus became a huge part of our lives. It's conveyears nient quick and easy to use.

    ReplyDelete
  10. You can also visit ThopTV app download if you want to know everything about tech website and visit this site for getting information in Hindi You can also visit HdMoviesmaza if you want to know everything in Hindi

    ReplyDelete
  11. It is important for business management assignment help seekers to find the best Business Management Writing Services from a reputable business management paper writing service provider for their custom business management essay services.

    ReplyDelete
  12. Thanks for sharing this post.It is very informative and helpful.

    Sydney Brooke Simpson
    Jimmy Graham
    Bhgwalmartoffer

    ReplyDelete
  13. This strategy is the best because through this, many people will enjoy a good business through advertising and now they will get benefits. This update is very useful for them. Masters dissertation writing service.

    ReplyDelete
  14. Did you know that you can easily view the contents of your phone on your TV without a cable? With a screen mirror app you can easily do the screen mirroring from Android to TV. Check out www.screenmirroring.me to find out more.

    ReplyDelete
  15. I will impart to you the most recent Android applications and games with direct download from ruler mod apk on the web, where everybody can get the applications and games with the best modules.

    ReplyDelete
  16. People walk out of their houses on their phones, they drive while checking their emails, and walk down the street while texting someone
    AOL mail login
    grand canyon university portal

    ReplyDelete
  17. you can learn here the most amazing things about mobile app on pc. telechargerpourpc

    ReplyDelete
  18. "This is a very nice article and information by the admin… i like it.. keep sharing information like it.. will visit your site again for such kind of articlesDeskScapes Crack"

    ReplyDelete
  19. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates. coke and popcorn

    ReplyDelete
  20. The finest edubirdie site will never leave you without help. Hundreds of qualified writers will write you an essay on all the topics you just wish and will do their job on time. I advise everyone to order.

    ReplyDelete
  21. nice article!! Thanks for this wonderful content!!
    my site: ultra gamers and Interesting321

    ReplyDelete
  22. hello guys check super fast result here
    Lottery Sambad



    hello guys check super fast result here
    lotterysambadindia.com

    nice post love it Dhankesari Result

    ReplyDelete
  23. i love your work and i daily visit your site for update if you finding satta king then check my site :satta-result.org and check Gali Result

    ReplyDelete
  24. Les sonnerie de téléphone portable sont un excellent genre à utiliser dans un téléphone, et presque tous les téléphones ont au moins une piste de musique douce pour rendre certaines scènes plus profondes. La sonnerie peut me remonter le moral, mais elle peut aussi me dégrader très rapidement. Savez-vous comment percevoir la sonnerie du téléphone comme un cadeau humain pour nos vies?

    ReplyDelete
  25. The only ones are probably dating coach toni muller. It helped me get over my insecurities and I was able to meet and talk to girls. Thank you!

    ReplyDelete
  26. Apk mod downloads
    Thanks for the info, very valuable content. I am searching for this type of solution.

    Mod apk Download

    Apps

    Games

    ReplyDelete

  27. Mod Apk Downloads
    Thanks for the Article, very valuable content. I am searching for this type of site.

    ReplyDelete
  28. Hey, thank you a lot for sharing this article with us. I can’t say, how grateful we are to read this. Also, I would love to share it with my friends and family, who are interested. I hope you will publish such articles in the future as well. It’s so helpful. Goodbye! Take a look at this wonderful article and download clash of clans MOD APK 2021 for free And visit ModsDroid.

    ReplyDelete
  29. https://cracksmox.com/avast-driver-updater-crack
    Avast Driver Updater automatically updates the Avast software program in order that your driving force works with efficiency and smoothness. additionally, It presents you with a great deal higher pics and pics, with the help of this software you can revel in the nice videos, movies, gaming enjoy with excessive excellent and splendid pictures.

    ReplyDelete
  30. These blogs are high quality, So that they can take some time to approve the comment, It may be 3 to 4 days..

    ReplyDelete
  31. You have really inspired me through your way of content representation. I have found here blog for blog commenting in all niche and helped me to get some quality link from blog commenting… Thanks

    ReplyDelete
  32. https://letcracks.com/fonepaw-iphone-data-recovery-crack
    FonePaw iPhone data restoration Serial number has a simple to recognize and comprehensible interface. It comes in a wizard-like format. It offers clean instructions about the process and courses you thru it. The high-quality issue is that you can view the contents of the scan. It affords control to the user by means of choosing the documents they want to shop or bypass. It additionally facilitates you in case you don’t want to anticipate the scan to be over. due to the fact you can view files simultaneously, you can store the files on your computer without problems and correctly with out loss.

    ReplyDelete
  33. Thanks for sharing this info.
    if anybody want to play a game so click. https://cocpureapk.com/clash-of-lights-apk/

    ReplyDelete
  34. best site for satta king result, leak number all game record charts. We provide 100% fix number direct from Satta king gali company which includes all famous games like Satta king Desawar, Gali Satta, Ghaziabad, Faridabad, Shri Ganesh Satta, Taj Satta King, charminar and other games of Satta Market Matka is also a simple game and essentially is a form of old lottery games. Ratan Khatri was the founder of this game in the 70 century and was become popular up until the 90 century. The game is not played that much anymore mostly in the regions of North India and Pakistan. Instead, many enjoy the lottery games Satta king result more so these days.

    ReplyDelete
  35. best site for satta king result, leak number all game record charts. We provide 100% fix number.

    ReplyDelete
  36. it's far the first-class video enhancing software program which comes with diverse options. With clean timeline enhancing, each consumer can create a completely unique video this is unique to his or her wishes.
    https://shehrozpc.com/

    ReplyDelete

  37. GTA 5 Crack is a computer game. It is the world’s best game with a lot of missions. This game gives really excellent graphics to its users.Please open this link and download GTA 5 https://ziapc.org/gta-5-crack/.THANKS!

    ReplyDelete
  38. THANKS FOR SHRING THIS BLOG .IT IS VERY HELPFUL FOR US.

    ReplyDelete
  39. The functions of the Speedify Keygen do not stop at just providing privacy and speeding up internet connection. Rather, the user can benefit from this Program in some other ways. For instance, the Program provides unlimited internet access by bypassing the regional censorship regime
    https://jazzych.com/speedify-crack/

    ReplyDelete
  40. Get unlimited Gujarati Ringtones
    Get unlimited Mahadev Ringtones
    Newsfox - the ultimate source of news.Newsfox

    ReplyDelete
  41. Hey, I really like this blog and it was very helpful for me to thank you so much. Also, check out our blog.

    ReplyDelete
  42. the report is an assessment of the top vendors in the market and does not represent the entire vendor landscape. event marketing and formal invitation email

    ReplyDelete
  43. Thanks for making this wonderful update. Regards: WhatsApp Plus

    ReplyDelete
  44. If you are looking for bloggers, please let us know.
    Your position is very good, I think I will have a great advantage.
    If you want to lose some weight, I'm happy.
    Write something about your blog in exchange for my link.
    If you are interested, please email me, thanks!
    lansweeper crack
    tuxera ntfs crack
    driverma crack
    spyhunter crack

    ReplyDelete
  45. How can you think of this! I am very shocked by your writing. The problem I've been thinking about for a long time has been solved at once. Thank you so much.토토사이트

    ReplyDelete
  46. Thank you dear, you are really a sincere blogger. I expect you to have very good success thanks to the quality of the content that you do apps

    ReplyDelete
  47. Mini Militia Android latest 5.3.4 APK Download and Install https://apkmodule.com/mini-militia-mod-apk/ Mini Militia 2 Mod Apk One of the most addicting and fun multiplayer 2D shooting games is now updated!

    ReplyDelete
  48. ver Doramasmp4 en línea con subtítulos en español.descargar doramas en línea en mi sitio web

    ReplyDelete
  49. Brilliant and strengthening site. Love to watch. Keep shaking. visit my site We give our clients the best things in a social event of materials, including Superhero Costumes.

    ReplyDelete
  50. Amazing post! i like it this is very usefull for me also check football pitch installation




    ReplyDelete
  51. Very nice blog, it was really easy to understand those words provided by an article هابي مود

    ReplyDelete
  52. Thank you for the valuable post. It seems very informative! free search engine submission sites list

    ReplyDelete
  53. Ashampoo PDF Pro Crack is a powerful new software from the software company Ashampoo for managing and editing PDF files. The PPD format is one of the most commonly used formats for digital documents. By providing a very nice and familiar user interface, users can edit their PDF documents like Office documents. Using this software, editing PDF documents is much easier than ever. With Ashampoo PDF Pro Crack you can convert your PDF documents into editable and common files in text format.

    ReplyDelete
  54. My frist Quest is Raise up form the one of the bets play ground that you may lov elaot sform here now a day people are worry about thi stopic to get the full information Tinder Plus Apk Latest Version

    ReplyDelete
  55. When you take the most of the best adventure of the sit ethat you creat well done activity of the sit ethat mak you happy of the site Candy Crush Mod Apk

    ReplyDelete
  56. People are look here fot do the one of the best thing is that you love the most of the topic to creat the one o fthe best app of the iste which is rear to use the one of the best thing that you creat the awsme thing Netflix Mod Apk

    ReplyDelete
  57. People are looking for the one of the best content of the sit ethat make you happy ever for all the time buy they are fail to creat the one ofthe est awsme site of the Pubg Mobile Mod Apk

    ReplyDelete