hello
I'm trying to make a report of my ads with "AD_PERFORMANCE_REPORT"
run the same example for "KEYWORD_PERFORMANCE_REPORT" and it worked well,
but the ads I get empty rows.
Code:
<?php
error_reporting(E_STRICT | E_ALL);
require_once 'src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
require_once 'src/Google/Api/Ads/AdWords/Util/ReportUtils.php';
try {
$user = new AdWordsUser();
$user->LogAll();
$user->LoadService('ReportDefinitionService', 'v201109');
$report_date = date("Y-m-d" ,time());
$fileName = 'data/'.$report_date.'_new.xls';
// Create selector.
$selector = new Selector();
$selector->fields =
array('Date','CampaignId','CampaignName','AdGroupId','AdGroupName','Id','Headline','AdType');
// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = 'Ad performance report #'. time();
$reportDefinition->dateRangeType = 'TODAY';
$reportDefinition->reportType = 'AD_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'CSVFOREXCEL';
$reportDefinition->includeZeroImpressions = FALSE;
$path = dirname(__FILE__) . '/' . $fileName;
$options = array('version' => 'v201109', 'returnMoneyInMicros' => TRUE);
// Download report.
ReportUtils::DownloadReport($reportDefinition, $path, $user, $options);
printf("Report with name '%s' was downloaded to '%s'.\n",
$reportDefinition->reportName, $fileName);
} catch (Exception $e) {
print $e->getMessage();
}
?>
It is run from an account "mcc" and the client ID of a customer
Where should I change my code?
Can anyone help me please.
thanks
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en