Thursday, 27 October 2016

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


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

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/ec0c3eb1-85b2-4ef3-8dc2-d72495bd1182%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment