client = adwords.AdWordsClient.LoadFromStorage(yaml_file_path)
report_downloader = client.GetReportDownloader(version='v201809')
# Create report definition.
report = {
'reportName': 'Last 30 days AD_PERFORMANCE_REPORT',
'dateRangeType': 'LAST_30_DAYS',
'reportType': 'AD_PERFORMANCE_REPORT',
'downloadFormat': 'CSV',
'selector': {
'fields': ['CriterionId', 'CampaignId']
}
}
# Retrieve the report stream and print it out
report_data = StringIO()
stream_data = report_downloader.DownloadReportAsStream(
report, skip_report_header=False, skip_column_header=False,
skip_report_summary=False, include_zero_impressions=True) #and I tried False - it's not working too...
...
Returns:
"Last 30 days AD_PERFORMANCE_REPORT (Dec 30, 2018-Jan 28, 2019)"
Keyword ID,Campaign ID
Total, --
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/