如何使用 google adwords api 获取每日报告?

How to get the daily report using google adwords api?

我从 api google adwords 开始,这是我的代码:

$reportQuery = 'SELECT CampaignId,CampaignName, '
        . 'Impressions, Clicks, Cost FROM CAMPAIGN_PERFORMANCE_REPORT DATE 20151119 ';
       // . 'WHERE Status IN [Campagne mise en veille, PAUSED] DURING ' . $dateRange;
  // Set additional options.
  $options = array('version' => ADWORDS_VERSION);
 ReportUtils::DownloadReportWithAwql($reportQuery, $filePath, $user,
      $reportFormat, $options);
  $dataArray =file($filePath);

它与 'During last_7_days' 一起工作正常,但是对于每日统计它失败了我尝试了 'Date today' 和 'Date 20151119' 但它不起作用。 谢谢

问题是什么? 你的情况下 $dateRange 是什么?

无论如何,试试:

SELECT CampaignId,CampaignName,Impressions,Clicks,Cost
FROM CAMPAIGN_PERFORMANCE_REPORT
DURING 20151119,20151119; //or: DURING TODAY

查看文档:https://developers.google.com/adwords/api/docs/guides/awql

编辑: 如果您想要每日报告,则必须在 select 子句中包含 DATE column/attribute 并在 during 子句中包含有效时间跨度