To use it, you will need to create a new Google Spreadsheet and load it with the adgroup name, param 1 value, and param 2 value in columns A, B, and C respectively (with column headers). Then copy that url into the script and you should be good to go.
Thanks,
Russ
/************************************************ * Update Ad Params by Ad Groups * 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 = "PUT YOUR SPREADSHEET URL HERE"; var SET_PARAM1 = true; var SET_PARAM2 = false; var DATA_RANGE = 'A:D'; // A - CampaignName, B - AdGroupName, // C - Param1, D - 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]].join('~~!~~'); allDataHash[rowKey] = { param1 : row[2], param2: row[3] }; } 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].join('~~!~~'); if(allDataHash[rowKey]) { if(SET_PARAM1) { kw.setAdParam(1, allDataHash[rowKey].param1); } if(SET_PARAM2) { kw.setAdParam(2, allDataHash[rowKey].param2); } } } }