$selector = new Selector();
$selector->setFields(
[
"AdGroupId", "AdGroupName", "Cost"
]
);
// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->setSelector($selector);
$reportDefinition->setReportName(
'ADGROUP performance report '
);
$reportDefinition->setDateRangeType(
ReportDefinitionDateRangeType::LAST_7_DAYS
);
$reportDefinition->setReportType(
ReportDefinitionReportType::ADGROUP_PERFORMANCE_REPORT
);
$reportDefinition->setDownloadFormat(DownloadFormat::CSV);
// Download report.
$reportDownloader = new ReportDownloader($session);
$reportSettingsOverride = (new ReportSettingsBuilder())->includeZeroImpressions(true)->build();
$reportDownloadResult = $reportDownloader->downloadReport(
$reportDefinition,
$reportSettingsOverride
);
$reportDownloadResult->saveToFile($filePath);
no data returned
Hi Wenbin,
Thank you for reaching out. Can you also please share your client customer ID via reply privately to author so that I can further investigate the issue?
Regards,
Mitchell
Google Ads API Team