Hi Team,
I need to get report for multiple client accounts under one manager
account. I dont know how to use this feature. my client id and other
configuration are configured in 'adsapi_php.ini' file.
$selector = new Selector();
$FromDate = ($fromdate) ? $fromdate : date('Ymd');
$ToDate = ($todate) ? $todate : date('Ymd');
$selector->setDateRange(new DateRange($FromDate, $ToDate));
$selector->setFields(['CampaignName', 'AdGroupName', 'Criteria',
'QualityScore', 'Impressions', 'Clicks', 'Ctr', 'AverageCpc', 'Cost',
'AveragePosition', 'Conversions']); //, 'CostPerConversion',
'ConversionRate', 'AllConversions', 'ViewThroughConversions'
// $selector->setPredicates([new Predicate('Status',
PredicateOperator::NOT_IN, ['PAUSED'])]);
$reportDefinition = new ReportDefinition();
$reportDefinition->setSelector($selector);
$reportDefinition->setReportName(
'Criteria performance report #' . uniqid());
$reportDefinition->setDateRangeType(
ReportDefinitionDateRangeType::CUSTOM_DATE);
$reportDefinition->setReportType(ReportDefinitionReportType::
KEYWORDS_PERFORMANCE_REPORT);
// $reportDefinition->setReportType(ReportDefinitionReportType::
KEYWORDLESS_QUERY_REPORT);
$reportDefinition->setDownloadFormat(DownloadFormat::CSV);
// Download report.
$reportDownloader = new ReportDownloader($session);
// Optional: If you need to adjust report settings just for this one
// request, you can create and supply the settings override here.
Otherwise,
// default values from the configuration file (adsapi_php.ini) are
used.
$reportSettingsOverride = (new ReportSettingsBuilder())
->includeZeroImpressions(false)
->build();
$reportDownloadResult = $reportDownloader->downloadReport(
$reportDefinition, $reportSettingsOverride);
$reportDownloadResult->saveToFile($filePath);
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/0a23f06e-0eba-4b8e-985f-0a0b58a31f17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.