[PHP] API returning different results then the web interface on account performance report

17 views
Skip to first unread message

Ppc Center

unread,
Oct 27, 2016, 4:37:28 AM10/27/16
to AdWords API Forum

Hi, 
I'm using the API to get an account performance report

here is part of my php code

<?php
$this->user->LoadService('ReportDefinitionService', 'v201605');
$this->user->SetClientCustomerId($account->customerId);
$selector         = new \Selector();
$selector->fields = [
'Cost',
'Impressions',
'Ctr',
'Clicks',
'AverageCpc',
'AllConversions',
'CostPerConversion',
'AllConversionRate',
];
$reportDefinition = new \ReportDefinition();
$reportDefinition->selector       = $selector;
$reportDefinition->reportName     = 'foo_bar_'.time();
$reportDefinition->dateRangeType  = 'THIS_MONTH';
$reportDefinition->reportType     = 'ACCOUNT_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'XML';

$options = [
'returnMoneyInMicros' => true,
'skipReportHeader'    => true,
'skipReportSummary'   => true,
];
$data = \ReportUtils::DownloadReport($reportDefinition, null, $this->user, $options);

the API returns 0 for AllConv and 191 for clicks
But in the web GUI it shows 9 for AllConv and 279 for clicks

adw.PNG
adw-api.PNG

Joyce Lava

unread,
Oct 27, 2016, 5:01:13 AM10/27/16
to AdWords API Forum
Hi,

Based on the screenshot you've attached, it seems that the UI is viewing the data at MCC level which can be the reason why the data will be returned differently when you generate the report using the API. This is because the API does not support report generation at MCC level. You may want to view the data in UI based on the clientCustomerId you set in the configuration file when running the report in the API. This way, we can validate and match the data between the UI and API. If you still see some discrepancies, please send me (reply privately to author) the clientCustomerId you used in API and the screenshot of the UI with this specified account selected.

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