How to segment Google AdWordsAPI Ad_Performance_Report?
I am new to Google AdWords API.
Right now I am downloading the AD_PERFORMANCE_REPORT
and I want to segment it by day, but I cant find the right example in their documentation
My code looks like this:
def get_data(customer_id): df = None for item in customer_id: report_query = (adwords.ReportQueryBuilder() .Select('AdGroupId', 'AdGroupName', 'AbsoluteTopImpressionPercentage', 'Impressions', 'Conversions') .From('AD_PERFORMANCE_REPORT') .During('LAST_7_DAYS') .Build()) # You can provide a file object to write the output to. For this # demonstration we use sys.stdout to write the report to the screen. report_downloader.DownloadReportWithAwql( report_query, 'CSV', output, client_customer_id=item, # denotes which adw account to pull from skip_report_header=True, skip_column_header=False, skip_report_summary=True, include_zero_impressions=False) output.seek(0) df = pd.read_csv(output) if df is None: df = pd.DataFrame(output) else: df = df.append(pd.DataFrame(output)) return df
Thank you for your suggestions.