Hi,
I'm afraid that there is no readily available script that can set budgets for each campaign where the budget amount will be fetched from the Google spreadsheet. However, you may follow the instructions below to get you started on creating this script.
1.) First, you have to implement the
SpreadsheetApp to retrieve data from the spreadsheet. You may refer to this
link for your guide.
3.) Use the
setAmount method to set the budget of the campaign.
You may refer to the sample script below as reference.
function main(){
var ss = SpreadsheetApp.openByUrl("INSERT_SPREADSHEET_URL_HERE");
var sheet = ss.getSheetByName("INSERT_SHEET_NAME_HERE");
var range = sheet.getRange("INSERT_CELL_RANGE_HERE");
var cellValues = range.getValues();
for (var i = 0; i < cellValues.length; i++) {
var campaignIterator = AdsApp.campaigns()
.withCondition("Name = " + JSON.stringify(cellValues[i][0])); //The cellvalues[i][0] corresponds to the campaign names listed in the spreadsheet
.get();
while (campaignIterator.hasNext()) {
var campaign = campaignIterator.next();
campaign.getBudget().setAmount(cellValues[i][1]); //The cellvalues[i][1] is the corresponding amount budget of specific campaigns
Logger.log('Campaign with name = ' + campaign.getName() +
' has budget = ' + campaign.getBudget().getAmount());
}
}
}
You may test the provided sample script by clicking the PREVIEW button. After you confirmed that the script is working after previewing, you may schedule the script daily to update the budget amount daily. Also, you may update the script based on your preferences.
Please let me know if you have further questions/clarifications.
Regards,
Vincent
Google Ads Scripts Team