I am finding the way to obtain impressions, clicks and CTR data of ads by day.
If the campaign duration is 30 days, I want to obtain the ads data of each day separately for 30 days.
Here is the PHP code we made.
<?php
error_reporting(E_STRICT | E_ALL);
$filePath = dirname(__FILE__) . '/tests/';
set_include_path(get_include_path() . PATH_SEPARATOR . $filePath);
require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
$user = new AdWordsUser();
$user->LogDefaults();
$user->SetClientCustomerId('xxx-xxxx-xxx');
// Create selector.
$selector = new Selector();
$selector->fields = array('Id', 'AdGroupName', 'AdGroupStatus', 'Status', 'AdType', 'DisplayUrl', 'CreativeDestinationUrl', 'CreativeFinalUrls', 'CreativeTrackingUrlTemplate', 'CreativeUrlCustomParameters','Impressions', 'Clicks', 'Cost', 'Ctr');
// Filter out removed criteria.
$selector->predicates[] = new Predicate('CampaignId', 'IN', 'xxxxxxxxx');
//$selector->predicates[] = new Predicate('AdGroupStatus', 'NOT_IN', array('REMOVED'));
//$selector->predicates[] = new Predicate('Status', 'NOT_IN', array('DISABLED'));
$startDate = '20150101';
$endDate = '20150812';
$selector->dateRange = new DateRange($startDate, $endDate);
// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = 'Ad Performance Report #' . uniqid();
$reportDefinition->dateRangeType = 'CUSTOM_DATE';
$reportDefinition->reportType = 'AD_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'CSV';
// Set additional options.
$options = array('returnMoneyInMicros' => TRUE);
ReportUtils::DownloadReport($reportDefinition, $filePath, $user, $options);
?>
Thank you very much for your support.