Bom dia galera,
Esse é meu script:
ID da Campanha: 281-396-0359
$user = new AdWordsUser();
$user->SetClientCustomerId($id);
$user->LogDefaults();
$user->LoadService('ReportDefinitionService', 'v201409');
$selector = new Selector();
$selector->fields = array('DayOfWeek', 'Date', 'AveragePosition', 'Ctr',
'ConversionRateManyPerClick', 'Conversions', 'Clicks', 'Impressions');
if ($display != "s") {
$selector->predicates[] = new Predicate('AdNetworkType1', 'IN', array(
'SEARCH'));
}
$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = ' ';
$reportDefinition->dateRangeType = $data;
$reportDefinition->reportType = 'ACCOUNT_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'XML';
$reportDefinition->includeZeroImpressions = TRUE;
//$filePath = dirname(__FILE__) . '\report.XML';
$filePath = NULL;
$report = ReportUtils::DownloadReport($reportDefinition, $filePath,
$user, $options = NULL);
$xml = new SimpleXMLElement($report);
$rows = $xml->xpath('/report/table/row');
echo json_encode($rows);
Quando jogo os dados no gráfico, ele ficam assim:
<https://lh5.googleusercontent.com/-diCgrJqE9p4/VQrLcPj6VjI/AAAAAAAAALU/uBalKZ_mF2o/s1600/duplicatedData.PNG>
Obrigado Josh, pela resposta rápida.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
---
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 [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/bd292190-b0b4-4a9b-85a2-fc23821b88dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.