I want to appendrow weekly in a specific spreadsheet column.
With this code it appendrow in the first column.
I want it in the 3rd Column.
I have tried it with sheet.getRange (1,3).setValue(numKeywords) but that it overwrite the
cell. I need a weekly history.
CODE:
function main() {
function main() {
var targetSheet = 'QDE';
var sheetID = '1pbF7flPcD5IsDyiC_KMSNK5PCL8qwBedsHjaooEo1go';
var spreadsheet = SpreadsheetApp.openById(sheetID);
var sheet = spreadsheet.getSheetByName(targetSheet);
var keywords = AdsApp.keywords()
.forDateRange("TODAY")
.withCondition("Status = ENABLED")
.withCondition("CampaignStatus = ENABLED")
.withCondition("AdGroupStatus = ENABLED")
.get();
var numKeywords = keywords.totalNumEntities();
sheet.appendRow([numKeywords]);
//Logger.log("Total keywords: " + account.getName() + " " + numKeywords);
}