Daily Ad Impressions, Clicks and CTR Statistics

18 vues
Accéder directement au premier message non lu

Nooni

non lue,
30 sept. 2015, 07:35:2030/09/2015
à 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

non lue,
30 sept. 2015, 16:31:4930/09/2015
à 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.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message