AdWords脚本报告 - 导出到展示次数大于0的工作表

时间:2018-05-30 20:22:18

标签: javascript scripting google-adwords

这将是我的代码。我想知道如何通过这种报告方法设置一个只导出超过0次展示的数据的规则。

function main() {

var spreadsheet = SpreadsheetApp.openByUrl("URL");

var sheet = spreadsheet.getSheetByName( "Raw Monthly Data" );

var report = AdWordsApp.report("SELECT Date, AdGroupName, Clicks, Impressions, Conversions, Cost, ConversionRate, CostPerConversion, AverageCpc " +
   "FROM ADGROUP_PERFORMANCE_REPORT " + "THIS_MONTH");

   report.exportToSheet(spreadsheet.getActiveSheet());

 }

1 个答案:

答案 0 :(得分:0)

您需要在where Impressions > 0查询中应用select条件,如下所示:

var report = AdWordsApp.report("SELECT Date, AdGroupName, Clicks, Impressions, Conversions, Cost, ConversionRate, CostPerConversion, AverageCpc " +
       "FROM ADGROUP_PERFORMANCE_REPORT where Impressions > 0 " + "THIS_MONTH");

编辑:我注意到您还有另一个问题,您误认为日期前的“ DURING”一词。这也需要修复。