Hide
AdWords scripts

AdWordsApp.Report

Represents an AdWords report.

Methods:

MemberTypeDescription
exportToSheet void Exports the content of the report into a SpreadsheetApp.Sheet.
getColumnHeader AdWordsApp.ReportColumnHeader Returns the column header of the report matching the given AWQL column name.
rows AdWordsApp.ReportRowIterator Returns an iterator over the rows of the report.

exportToSheet(sheet)

Exports the content of the report into a SpreadsheetApp.Sheet.

Typical usage:

   var spreadsheet = SpreadsheetApp.create("Report output");
   var report = AdWordsApp.report("SELECT Clicks, Impressions, AverageCpc, HourOfDay " +
       "FROM ACCOUNT_PERFORMANCE_REPORT " +
       "DURING LAST_MONTH");
   report.exportToSheet(spreadsheet.getActiveSheet());
   Logger.log("Report available at " + spreadsheet.getUrl());

Note that reports containing over 10,000 rows cannot be exported.

Returns nothing.

Arguments:

NameTypeDescription
sheet SpreadsheetApp.Sheet The sheet in a Google Spreadsheet to export the report to.

getColumnHeader(awqlColumnName)

Returns the column header of the report matching the given AWQL column name.

AWQL names are the names of the selected columns as they appear in the generated report. For a full list of AWQL column names, and the display column names they correspond to, please see the Name and Display Name column in all types of reports.

   var report = AdWordsApp.report("SELECT Clicks, Impressions, AverageCpc, HourOfDay " +
       "FROM ACCOUNT_PERFORMANCE_REPORT " +
       "DURING LAST_MONTH");
   var columnHeader1 = report.getColumnHeader("HourOfDay");
   // AWQL name: "HourOfDay"
   Logger.log(columnHeader1.getAwqlColumnName());
   // display name: "Hour of day"
   Logger.log(columnHeader1.getDisplayColumnName());
   var columnHeader2 = report.getColumnHeader("AverageCpc");
   // AWQL name: "AverageCpc"
   Logger.log(columnHeader2.getAwqlColumnName());
   // display name: "Avg. CPC"
   Logger.log(columnHeader2.getDisplayColumnName());

Arguments:

NameTypeDescription
awqlColumnName String The AWQL column name specifying the ReportColumnHeader.

Return values:

TypeDescription
AdWordsApp.ReportColumnHeader The column header of the report matching the given AWQL column name.

rows()

Returns an iterator over the rows of the report.

Return values:

TypeDescription
AdWordsApp.ReportRowIterator An iterator over the rows of the report.