Daily Ad Impressions, Clicks and CTR Statistics

22 views
Skip to first unread message

Nooni

unread,
Sep 30, 2015, 7:35:20 AM9/30/15
to AdWords API Forum
Hi,

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);
?>


Could you advise how to obtain them?
Or do you have a code sample or tips etc for this issue?

Thank you very much for your support.




Umesh Dengale

unread,
Sep 30, 2015, 4:31:49 PM9/30/15
to AdWords API Forum
Hello,

For AD_PERFORMANCE_REPORT, you could use the Date field which is of type behavior segment to do the data segmentation based on date. Please check out our AD_PERFORMANCE_REPORT document for more details. 

Cheers,
Umesh, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages