I am confused on where to add the min and max data ranges. If anyone could
assist that would be great.
class ParallelReportDownload {
// Timeout between retries in seconds.
const BACKOFF_FACTOR = 5;
// Maximum number of retries for 500 errors.
const MAX_RETRIES = 5;
// The number of entries per page of the results.
const PAGE_LIMIT = 500;
public static function runExample(AdWordsServices $adWordsServices,
AdWordsSessionBuilder $sessionBuilder, $reportDir) {
// Construct an API session for the client customer ID specified in the
// configuration file.
$session = $sessionBuilder->build();
// Create selector.
$selector = new Selector();
$selector->setFields(['Month', 'Impressions', 'Clicks', 'Ctr',
'AverageCpc', 'AveragePosition', 'Cost', 'Conversions',
'CostPerConversion', 'ConversionRate', 'SearchImpressionShare']);
// Use a predicate to filter out paused criteria (this is optional).
//$selector->setPredicates([
//new Predicate('Impressions', PredicateOperator::GREATER_THAN,
[1000]),
//new Predicate('CampaignName', PredicateOperator::CONTAINS,
['Branded'])
//]);
// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->setSelector($selector);
$reportDefinition->setReportName('LAST_MONTH
ACCOUNT_PERFORMANCE_REPORT');
$reportDefinition->setDateRangeType(
ReportDefinitionDateRangeType::CUSTOM_DATE);
$reportDefinition->setReportType(
ReportDefinitionReportType::ACCOUNT_PERFORMANCE_REPORT);
$reportDefinition->setDownloadFormat(DownloadFormat::CSV);
$customerIds = self::getAllManagedCustomerIds($adWordsServices,
$session);
printf("Downloading reports for %d managed customers.\n",
count($customerIds));
$successfulReports = [];
$failedReports = [];
foreach ($customerIds as $customerId) {
$filePath = "../../../../../../clients/client_reports/accounts/" .
$customerId . "_LAST_MONTH___account.csv";
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/a48ce5f0-3aca-495e-9cab-4aa8f1cbdc0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.