Hi Bharani,
The below is the code that I used. Please guide me so that I can download ad report with necessary columns and metrics.
import sys
from googleads import adwords
def main(client):
# Initialize appropriate service.
report_downloader = client.GetReportDownloader(version='v201710')
# Create report query.
report_query = (adwords.ReportQueryBuilder()
.Select('AdGroupName','Labels','Impressions', 'Clicks','Cost')
.From('AD_PERFORMANCE_REPORT')
.Where('Status').In('ENABLED', 'PAUSED')
.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.
result = report_downloader.DownloadReportAsStringWithAwql(report_query, 'CSV', skip_report_header=False,
skip_column_header=False,skip_report_summary=False,
include_zero_impressions=True)
file_path = 'my path'
with open(file_path, 'w') as out_file:
out_file.write(result)
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage(path of credentials.yaml")
adwords_client.client_customer_id = 'my id goes here'
main(adwords_client)
Thanks!