Tuesday, November 20, 2012

Update Your Keywords for the Holiday Season

The other day, RKGBlog had a great post about updating your keywords for the holiday season. One of the mentions was to update all the years in your Keywords to the current year. Here is a little script that will find all the Keywords with the previous year in them and create new Keywords in the same AdGroup with the current year.

Thanks,
Russ
/*********************************************
* Update Keywords for the New Year
* Version 1.1
* Changelog v1.1
*   - Updated for speed and added comments 
* Created By: Russ Savage
* FreeAdWordsScripts.com
**********************************************/
function main() {
  var sameDayLastYear = new Date();
  sameDayLastYear.setYear(sameDayLastYear.getYear()-1);
  var oldYearStr = sameDayLastYear.getYear().toString();
  var newYearStr = new Date().getYear().toString();
  
  Logger.log('Updating keywords with old year: '+oldYearStr+' to new year: '+newYearStr);
  
  // Let's start by getting all of the keywords
  var kwIter = AdWordsApp.keywords()
    .withCondition("Text CONTAINS " + oldYearStr)
    .withCondition("Status = ENABLED")
    .withCondition("AdGroupStatus = ENABLED")
    .withCondition("CampaignStatus = ENABLED")
    .get();
 
  // It is always better to store and batch process afterwards
  var toPause = [];
  var toCreate = [];
  while (kwIter.hasNext()) {
    var kw = kwIter.next();
    var ag = kw.getAdGroup();
    var oldText = kw.getText();
    var newText = oldText.replace(oldYearStr,newYearStr);
    // Save the info so that we can create them as a batch later
    toCreate.push({ ag: ag, text: newText, cpc:kw.getMaxCpc(), destUrl : kw.getDestinationUrl() });
    // Same with the ones we want to pause
    toPause.push(kw) 
  }
  // Now we create the new keywords all at once
  for(var i in toCreate) {
    var elem = toCreate[i];
    elem.ag.createKeyword(elem.text, elem.cpc, elem.destUrl);
  }
  // And pause the old ones all at once
  for(var i in toPause) {
    toPause[i].pause();
    //or toPause[i].remove(); to delete the old keyword
  }
}

43 comments:

  1. Avail best Ford case study solution and zara 4p strategy at My AssignmentHelp. They are a team of highly skilled professionals at providing complete assignments in any educational field.

    ReplyDelete
  2. Why Geographical Maps Are Important? View the full infographics here and understand why? Homeworkminutes provides online assignment help services round the clock.

    ReplyDelete
  3. Assignment Help provides required assistance to all students who require reliable support for composing their academic papers. For more explanation, visit greatassignmenthelp and quote your order as soon as possible.
    Assignment Help Online
    Online Assignment Help
    Assignment Help Online Services
    Assignment Helper
    Assignment Assistance
    Assignment Help Experts
    Online Assignment Help Services

    ReplyDelete
  4. If you are looking for the best online assignment help, I suggest you contact AllAssignmentHelp.com. Our assignment expert offers the best and high-quality assignment so the student can get high marks and ranking in their academic career. We provide online assignment help at global of the world.
    Assignment Help
    Assignment Help Australia
    Java homework help
    programming homework help
    My Assignment Help

    ReplyDelete
  5. Thanks for sharing a very required peice of information about AdWords, I provides PPC services so this information is going to help me a lot.

    ReplyDelete
  6. We as a Small Business SEO Services will meet the meet of your online marketing needs. We offer full-service SEO for local and small business with costs like phonebook promoting and other traditional advertising strategies.

    ------------------
    for more visit here: -
    https://firstrankseoservices1.blogspot.com/

    ReplyDelete
  7. Excellent information Providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit livewebtutors website we providing best assignment help services in Australia.
    Read more now :- My Assignment Help

    ReplyDelete
  8. All the devices of HP are very reliable but some users report that they are facing technical issues with the device. Contact Hewlett Packard Support to easily resolve all your HP device related queries.

    ReplyDelete
  9. Buying the HP printer is considered to be childish, but maintain the overall performance of this device is not as simple as you think. Now, you can proceed the printing outcome through marinating the hp printer setup in your all expected business work. Sometimes, it is noticed that Hp printer setup cannot capture in real time scenario. At that time, there is zero chance to get printing function as associated flaws does pave the way to find the result. If you do not know the real way to manage the hp printer setup, then you should contact to our third party professional team. Our team does not feel discourage as you do not spot the right way to crack the problem in the definite time. Feel free to contact us when you cannot postpone the problematic issue. Come on our website to know more information. https://www.hpprintersupportpro.com/hp-wireless-printer-setup

    ReplyDelete
  10. Geek Squad Tech Support provides the best technical help and guidance. Get in touch with extensively trained tech support team for all sort of queries and issues regarding your devices. You can contact Geek Squad round the clock according to your convenience.

    ReplyDelete

  11. Get the solutions to all the technical issues with all your electronic appliances at Geek Squad Tech Support. Avail wide no of services, on-site, and over the Internet via remote access and In-store, and also provides 24/7 telephone and emergency on-site support. Reach the experts at Geek Squad Tech Support for removing all technical glitches with your devices

    ReplyDelete
  12. Geek Squad Support works effortlessly towards serving the consumers and have a wide stretch toward resolving the issues, our Geek Squad Support provides you with all the answers to your issues.

    ReplyDelete

  13. Geek Squad Protection is an insurance plan offered by Geek Squad experts for customer ease. Under this plan you need not to pay labor cost or instruments retrieved while fixing the damage. Contact us for Geek squad protection plan renewal.

    ReplyDelete
  14. You can rely on the Plumbers Near Me services if you have any emergency breakdown related plumbing issues. The support offered is prompt and instant.

    ReplyDelete
  15. Very nice!!! This is really good blog information thanks for sharing. We are a reliable third party Quickbooks update error 404 company offering technical support for various any types of technical errors.

    ReplyDelete
  16. Your blog is very good and very informative. Your blog post is very useful. It is exceptionally accommodating for me I learn new information from your post. I truly love your blog post.Thank you for sharing this post with us keep it up.Students always asking us who can do my assignment for me in USA? What we suggest them is to hire assignment helper from 500+ writers online. best free plagiarism checker , harvard style referencing website , how to write an annotated bibliography

    ReplyDelete
  17. brother printers troubleshooting


    If you occur to find any trouble with your printer, troubleshoot by referring to resolutions of respected error. Not only brother printers troubleshooting model but our technical experts can assist you to fix this failure by providing online remote help.just call us +1 800-684-5649

    ReplyDelete
  18. Get help with Online Assignment Help Cheap at affordable prices by professional experts. We provide 24 * 7 service and support for all our users.
    buy research paper writing service uk

    best dissertation conclusion
    ,pay someone to do my coursework, 
    programming assignment help

    ReplyDelete
  19. It is sure that one should confirm this thing to dial their phone number for HP Printer Support. As you interact in our team, our team member provides instant solution to overcome pitfall.
    https://www.hpprintersupportpro.com/blog/steps-to-connect-hp-officejet-wireless-printer-with-wireless-network/

    ReplyDelete
  20. Thanks for sharing your idea. Garmin GPS helps in to find routes and navigation of those routes are quick easy with Garmin GPS devices. You must have latest Garmin Map Update. If you are facing any trouble in updating garmin device then feel free to call us.

    ReplyDelete
  21. Get help from programming experts courses at cheap prices. Get help in all programming subjects. We provide Online Programming Assignment Help with superior prices. Computer science areas of programming and other. We cover all the major topic in their relative requirement, you can get professional research paper writing service online assistance with all your academic writing easily with Program Assignment help writing service. We work 24*7 for your convenience, so you don’t need to wait for any certain time, you can reach any time at our site for help me do my coursework.

    ReplyDelete
  22. Brother Printer Setup Number can be dialed if you need some technical assistance for Brother Printer WiFi Setup or any other issues. Reach us anytime.

    ReplyDelete
  23. I personally thought the written post is well suited and trouble-free for me to go after provided guideline. Overall, I really enjoyed the assistance provided by Microsoft Office 365 Support team. Hence, if any of my friends needed assistant regarding Microsoft Office 365 I would personally recommend this support service to him/her. Get support click here Office 365 Support
    Microsoft 365 Support
    Microsoft Office 365 Support
    Outlook Support
    Outlook Support Phone Number
    Microsoft Outlook Support
    Outlook Tech Support
    Outlook Tech Support Number
    Outlook Tech Support Phone Number
    Outlook Technical Support
    Outlook Technical Support Number
    Outlook Technical Support Phone Number
    Microsoft Support
    Microsoft Number
    Microsoft Support Number
    Microsoft Support Phone Number
    Microsoft Chat Support
    Microsoft Support Chat
    Microsoft Live Chat

    ReplyDelete
  24. If your HP Printer Not printing Black, it means that your HP printer is passing through serious technical faults. This issue is very serious technical error that cannot be resolved simply. Our printer experts have technical skills to fix this error instantly.

    ReplyDelete
  25. Every student wants to write my assignment to any other person it’s good because a student has no time to write an assignment, He also wants to take rest in free time, I would like to inform you about allassignmenthelp.com go here write your assignment online by an expert.write my assignment for me

    ReplyDelete
  26. Do you want to set up Epson printer? Do you want to take technician’s help for Epson printer set up issue? If yes, we are a trustworthy and independent third party technical support service provider, offering online Epson printer support in very nominal charges. We provide unlimited technical help for Epson printer users. Our printer technicians have rich knowledge and extensive experience of setting up Epson printer in the right technical ways. Our Epson printer setup process is quite different from others, so you can trust on us and get the best support services.
    Epson Printer Error Code 0x97

    Epson Error Code 0x97

    Epson windows service disabled error

    Epson error code 0xf1

    Epson wireless printer setup

    Epson printer offline

    Epson Printer in error state

    Epson Support

    Epson Printer Support
    Epson Printer Not Printing
    Epson Printer Setup
    Epson 0x97 fix patch

    ReplyDelete
  27. Nice blog. Assignment Help service in Australia offering top-notch and original Assignment Help with quality results at an amazing price.
    My Assignment Help
    Assignment Help Sydney

    ReplyDelete
  28. This comment has been removed by the author.

    ReplyDelete
  29. There could be many reasons for receiving the message "Brother Printer Offline". Follow the easy steps in the article to resolve Brother Printer Offline Windows 10 issues. If you are still facing issues for the same you can reach our experts at our toll-free number.

    ReplyDelete
  30. Get help with Online Assignment Help Cheap at affordable prices by professional experts. We provide 24 * 7 service and support for all our users.

    ReplyDelete
  31. Are you worried about pending assignments, no matter the subject, Assignment Desk provides specialised help with Assignment Writing work for all major universities. Submit your assignment in style with help from Assignment Desk.
    You can also avail Marketing Assignment Help form them, they have a team of marketing experts who will definitely help you with your assignments.

    ReplyDelete
  32. Initiate with downloading and installing Epson Connect Printer Setup Utility at Epson Setup Phone Number. Call the advanced printer setup team for assistance.

    ReplyDelete
  33. To bring your HP printer setup, you need to give a click at 123.hp/setup by opening a web browser on your computer system. The effectual and hands-free solution is there, you only have to follow the guidelines as mentioned on that page. Once you reach to the bottom of the page, you will see your HP printer has been setup. Be careful while downloading and installing printer driver and software as during this setting up process in case the network gets lost, your printer won’t setup properly and might create some problems during print job.

    ReplyDelete
  34. Thanks for sharing an article like this. The information which you have provided is better than another blog.


    download fortnite for linux

    ReplyDelete
  35. Get the best internet bundles from CenturyLink, Windstream, Viasat and Frontier.

    ReplyDelete