Today we have a little script to help adjust keyword ad params at a large scale. This is an example of how you can use the integration with Google Spreadsheets to update param1 and param2 values for keywords. I have provided a sample spreadsheet which you can make a copy of.
As long as the Adwords Account and the Google Docs account use the same login, it will be able to access any spreadsheet you have. I suggest opening my sample spreadsheet and then making a copy if it in your account. You can then replace the URL from the script below with the url of your copy of the spreadsheet.
Link to my sample spreadsheet: https://docs.google.com/spreadsheet/ccc?key=0Aotb6eheEOpodC1yVjUwc2Y1NDIzUVFLLThJdTFPUnc#gid=0
Thanks,
Russ
/************************************************ * Update Ad Params Using a Google Spreadsheet * Version 1.1 * ChangeLog v1.1 * - Added the ability to enable param1 or 2 individually * - Looks for Keywords on all sheets * - Runs much faster * Created By: Russ Savage * FreeAdWordsScripts.com ************************************************/ var SPREADSHEET_URL = "THE URL FOR YOUR GOOGLE SPREADSHEET GOES HERE"; var SET_PARAM1 = true; var SET_PARAM2 = false; var DATA_RANGE = 'A:E'; // A - CampaignName, B - AdGroupName, // C - Keyword, D - Param1, E - Param2 function main() { var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL); var allSheets = spreadsheet.getSheets(); var allData = []; for(var i in allSheets) { var sheet = allSheets[i]; var data = sheet.getRange(DATA_RANGE).getValues(); data.shift(); //get rid of headers allData = allData.concat(data); } var allDataHash = {}; for(var i in allData) { var row = allData[i]; if(row[0] === '') { continue; } var rowKey = [row[0],row[1],row[2]].join('~~!~~'); allDataHash[rowKey] = { param1 : row[3], param2: row[4] }; } var kwIter = AdWordsApp.keywords() .withCondition('CampaignStatus = ENABLED') .withCondition('AdGroupStatus = ENABLED') .withCondition('Status = ENABLED') .get(); while(kwIter.hasNext()) { var kw = kwIter.next(); var campName = kw.getCampaign().getName(); var adGroupName = kw.getAdGroup().getName(); var rowKey = [campName,adGroupName,kw.getText()].join('~~!~~'); if(allDataHash[rowKey]) { if(SET_PARAM1) { kw.setAdParam(1, allDataHash[rowKey].param1); } if(SET_PARAM2) { kw.setAdParam(2, allDataHash[rowKey].param2); } } } }
Hi Russ,
ReplyDeleteThis is a great help thank you.
Can we set set these Ad Params at ad group level or are they applied to keywords only?
Thanks again.
Neilos
It should be pretty easy to modify the script above to update ad params based on ad group name. Follow these steps:
ReplyDelete1. First you need to update the spreadsheet. Currently we have keyword text and matchtype, but if you want to use adgroup instead, just update the column A header to be "adgroup", and keep column be the same. We will just ignore it later.
2. Now, the logic is going to pull column A in the kw_text parameter. You can change the name if you like, but you don't have to. Now we need to update the Keyword Selector to find all the keywords in a given adgroup. So change the line:
.withCondition("Text = '"+kw_text+"'")
to
.withCondition("AdGroupName = '"+kw_text+"'")
3. So now you are pulling all the keywords in a given adgroup. The last update would be to remove the check for matchtype. So delete the line:
if(kw.getMatchType() == mt) {
And then also the closing } two lines down.
You should end up with something like this:
var kw_iter = AdWordsApp.keywords()
.withCondition("AdGroupName = '"+kw_text+"'")
.withCondition("Status = ENABLED")
.get();
while(kw_iter.hasNext()) {
var kw = kw_iter.next();
kw.setAdParam(1, param1);
kw.setAdParam(2, param2);
}
Let me know if you have any issues.
Thanks for checking out my blog,
Russ
Thanks a lot!
DeleteIt's awesome.
I have edited the script to edit at the ad group level as above and it seems to keep throwing up 'script runtime errors'
DeleteAny idea why?
Hi Ashley, Could you post your script here so that I could take a look at it?
DeleteThanks,
Russ
Russell, thanks for this great collection of AW Scripts.
DeleteI tried your suggestion above to update prices for all keywords within an ad group and it works fine.
However, I noticed that it only works when I use a copy of your sample spreadsheet. The moment I create my own, the script generates this error: TypeError: Cannot call method "getRange" of null. (line 11)
All that's different is the Google Drive URL.
Do you use any special formatting in the spreadsheet?
Cheers,
Stefan
Make sure that you name the sheet in your new spreadsheet KeywordParams. By default, it is named Sheet1. Let me know if that solves your issue.
DeleteThanks for reading,
Russ
That was it! Thanks again for the help, Russ.
DeleteGreat stuff. Thanks!
ReplyDeleteCould you help modify the script using regex so that it chooses ad groups containing the word/words in the spreadsheet?
BR
Mads
Hi Mads, I think all you need to do is modify the script using the comment above, but instead of saying:
ReplyDelete.withCondition("AdGroupName = '"+kw_text+"'")
Change it to be
.withCondition("AdGroupName CONTAINS_IGNORE_CASE '"+kw_text+"'")
That will match any Ad Groups that contain the word from the spreadsheet. Let me know if that works for you. More information about the operators available for the .withCondition function can be found here: https://developers.google.com/adwords/scripts/docs/reference/adwordsapp_adgroupselector#withCondition_1.
Thanks,
Russ
Does this update business data feed or is it stored elsewhere?
ReplyDeleteWhen i try to use the script i dont get any errors however I don't see it updating the feed either so how can see if and whats updating?
I am trying to update these ad params hourly but appears I cant do it with bulk upload with csv or spreadsheet and only works if i manually do it from the schedule window of that specific data feed.
Is there a way to update the feed hourly? Even 2 hours would be fine, 6 hours is too long for what I am hoping to achieve.
I hope this would work for me https://samedaypaper.org/blog/persuasive-essay. Thanks a lot!
ReplyDeleteEveryone wants to be a 'Google AdWord professional' and who wouldn't? The Google advertising team has given any and every inspiring Internet marketer an open gateway to make money with AdWord advertising. Using AdWords can lead to much success as a marketer.https://www.flow20.com/blog/get-perfect-google-ads-quality-score/
ReplyDeleteThis ensures the advertising income for the magazine and they are most often willing to cut a good deal. The advertising company will then go out and sell advertising space on these pages that they bought from the magazine.negative keyword ideas
ReplyDeleteOne of the most significant snippets of data among this information is the wellspring of referral. Free Google Ads Audit
ReplyDeletesadsa
ReplyDeleteOn the off chance that you recognize any that you know beyond a shadow of a doubt are phony, banner them.buy reviews on google
ReplyDeleteHowever, considering the growing trend in Google +, it can be said that it would not be long before people would be in pace with its trend. Best Data Scraping Tools
ReplyDeletetanx for post
ReplyDeleteدانلود کتاب صوتی هنر شفاف اندیشیدن دانلود کتاب صوتی هنر شفاف اندیشیدن
دانلود کتاب صوتی هنر شفاف اندیشیدن دانلود کتاب صوتی هنر شفاف اندیشیدن
tanx for post
ReplyDeleteدانلود کتاب صوتی هنر شفاف اندیشیدن دانلود کتاب صوتی هنر شفاف اندیشیدن
دانلود کتاب صوتی هنر شفاف اندیشیدن دانلود کتاب صوتی هنر شفاف اندیشیدن
ReplyDeletemicrosoft word not responding mac
word not responding mac
microsoft word won t open on mac
word not responding
word won t open on mac
Thank you for the post. Seems very informative!
ReplyDeleteHOW TO RENEW AVG ANTIVIRUS SUBSCRIPTION?
How to deal with Internet Explorer keeps crashing error?
Samsung printer do not connect – Get troubleshooting tricks
How to print an email from Yahoo?
getting an error "cannot fetch more adwords entities from iterator: exceed limit of 50000)
ReplyDeleteThis article isn't tied in with Bing. This article is about how to rank on the ebb and flow lord of web indexes, Google. Lead generation website
ReplyDeletenorton liveupdate failed to complete
ReplyDeletenorton error 8504 104
epson error 0xf1
malwarebytes won t open
malwarebytes not opening
canon mg3600 setup
Why Malwarebytes Will Not Open And What To Do?
ReplyDeleteMALWAREBYTES NOT OPENING – LET'S FIX MALWAREBYTES WON'T OPEN ISSUE.
ReplyDeleteWhat to Do When Malwarebytes is Unable to Connect to the Service
Epson Printer Communication Error
ReplyDeleteDefault Brother printer password
Brother Printer Default Password.
Brother Printer is in an Error State
Epson printer communication error.
Epson error code 0x97 wf-3640
Brother Printer Default Password