這是一個腳本,可以做你想做的事情(它使用一個稍微不同的電子表格,檢查出來)。此外,該腳本僅在電子表格的前365行中讀取,因此它將在一年內中斷。
在未來,你可能要與https://developers.google.com/adwords/scripts檢查對腳本
function main() {
var sheet = SpreadsheetApp.openByUrl(
"https://docs.google.com/spreadsheet/ccc?key=0Aj_Bw31w9s7LdEdLMllQMnZfbW52c3BvcTh0ekVBQ3c#gid=0").getActiveSheet();
var emptyRow = findEmptyRow(sheet);
var yesterday = new Date(new Date().getTime() - (24 * 3600 * 1000));
var range = sheet.getRange(emptyRow + 1, 1, 1, 10);
var row = range.getValues();
row[0][0] = yesterday;
row[0][1] = MONTHS[yesterday.getMonth()];
row[0][2] = DAYS_OF_WEEK[yesterday.getDay()];
var stats = AdWordsApp.report("SELECT Clicks, Impressions, Cost, Conversions " +
"FROM ACCOUNT_PERFORMANCE_REPORT DURING YESTERDAY")
.rows()
.next();
row[0][3] = stats["Clicks"];
row[0][4] = stats["Impressions"];
row[0][7] = stats["Cost"];
row[0][8] = stats["Conversions"];
range.setValues(row);
}
function findEmptyRow(sheet) {
var dates = sheet.getRange(1, 1, 365, 1).getValues();
for (var emptyDate = 0; emptyDate < dates.length; emptyDate ++) {
if (dates[emptyDate][0].length == 0) {
return emptyDate;
}
}
}
面向資源和社區建議你多做一點功課,張貼一些代碼,當你有一些。 – eddyparkinson