Campaign Performance Report blank

23 views
Skip to first unread message

perdana adhitama

unread,
Aug 10, 2016, 5:21:07 AM8/10/16
to AdWords API Forum
Hi All,

I am using Adwords API to get campaign performance report but there was no data to return. Here is my code

define('CLIENT_ID', 'MY_CLIENT_ID');
define
('CLIENT_SECRET', 'MY_CLIENT_SECRET');

define
('REFRESH_TOKEN', 'MY_REFRESH_TOKEN');
define
('DEVELOPER_TOKEN', 'MY_DEVELOPER_TOKEN');
define
('USER_AGENT', 'MY_COMPANY');

$oauth2Info
= array(
   
'client_id' => CLIENT_ID,
   
'client_secret' => CLIENT_SECRET,
   
'refresh_token' => REFRESH_TOKEN
 
);

$user
= new AdWordsUser(null, DEVELOPER_TOKEN, USER_AGENT, null, null,$oauth2Info);
$user
->SetClientCustomerId('MY_ID');//this is my sub client-customer id
// Log every SOAP XML request and response.
$user
->LogAll();

$user
->LoadService('ReportDefinitionService', ADWORDS_VERSION);
$selector
= new Selector();
  $selector
->fields = array('AccountCurrencyCode', 'AccountDescriptiveName', 'AccountTimeZoneId', 'ActiveViewCpm',
     
'ActiveViewCtr', 'ActiveViewImpressions', 'ActiveViewMeasurability', 'ActiveViewMeasurableCost');

$reportDefinition
= new ReportDefinition();
$reportDefinition
->selector = $selector;
$reportDefinition
->reportName = 'Criteria performance report #' . uniqid();
$reportDefinition
->dateRangeType = 'LAST_7_DAYS';
$reportDefinition
->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
$reportDefinition
->downloadFormat = 'CSV';

$options
= array('version' => ADWORDS_VERSION);

$reportUtils
= new ReportUtils();
$reportUtils
->DownloadReport($reportDefinition, "report.csv", $user, $options);

However when I tried to use get campaign as shows in GetCampaign.php it works. I also tried to change different client customer id between parent and sub bot none works.

Thank You

Joyce Lava

unread,
Aug 10, 2016, 6:36:27 AM8/10/16
to AdWords API Forum
Hi Perdana,

Could you please confirm if you set includeZeroImpressions to true? This will include zero impression rows in the report generated. If you set it as true and the issue persists, could you please reply privately to author the clientCustomerId, the sample report generated, and the SOAP request and response while using GetCampaign.php example code?

Thanks,
Joyce, AdWords API Team
Reply all
Reply to author
Forward
0 new messages