REPORT_TYPE = 'VIDEO_PERFORMANCE_REPORT'
def main(adwords_client):
report_downloader = adwords_client.GetReportDownloader(version='v201809')
# Create report definition.
report = {
'reportName': 'VIDEO_PERFORMANCE_REPORT',
'dateRangeType': 'LAST_7_DAYS',
'reportType': 'VIDEO_PERFORMANCE_REPORT',
'downloadFormat': 'CSV',
'selector': {
'fields': ['Date','AdGroupStatus','AdGroupName', 'CreativeStatus','AccountCurrencyCode','VideoViews','AverageCpv','Cost','Impressions', 'VideoQuartile25Rate','VideoQuartile50Rate','VideoQuartile75Rate','VideoQuartile100Rate', 'Clicks','AdGroupId']
}
}
# Print out the report as a string
print (report_downloader.DownloadReportAsString(
report, skip_report_header=False, skip_column_header=False,
skip_report_summary=False, include_zero_impressions=True))
if __name__ == '__main__':
adwords_client = adwords.AdWordsClient(DEVELOPER_TOKEN, oauth2_client, USER_AGENT,CLIENT_CUSTOMER_ID)
main(adwords_client)