Reputation: 797
i'm starting with api google adwords here is my code :
$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);
It works fine with 'During last_7_days' , but for daily stats it fails i tried 'Date today' and 'Date 20151119' but it doesn't work. Thanks.
Upvotes: 1
Views: 934
Reputation: 1048
What is the question? What is $dateRange in your case?
Anyways, try:
SELECT CampaignId,CampaignName,Impressions,Clicks,Cost
FROM CAMPAIGN_PERFORMANCE_REPORT
DURING 20151119,20151119; //or: DURING TODAY
see docs: https://developers.google.com/adwords/api/docs/guides/awql
EDIT: if you want a daily report you have to include the DATE column/attribute in the select clause and a valid timespan in the during clause
Upvotes: 1