When i use Adwords API to download some customer_id Ad report. In the UI,
we see data. However using API to download, we will get zero files. Could
you help me check this problme?
Code is here:
*/****** input parameters: *
* reportFields: report fileds*
* customerId: customerId*
* dateRange: report start date & end date*
***/*
*public void downloadAdReport(AdWordsSession session, DateRange dateRange ,
String customerId, ArrayList reportFields) throws Exception {*
* Selector selector = new Selector();*
* selector.setDateRange(dateRange);*
* selector.getFields().addAll(Lists.newArrayList(reportFields));*
* ReportDefinition reportDefinition = new ReportDefinition();*
* reportDefinition.setReportName("Criteria performance report #" +
System.currentTimeMillis());*
*
reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.CUSTOM_DATE);*
*
reportDefinition.setReportType(ReportDefinitionReportType.AD_PERFORMANCE_REPORT);*
* reportDefinition.setDownloadFormat(DownloadFormat.CSV);*
* reportDefinition.setSelector(selector);*
* ReportingConfiguration reportingConfiguration =*
* new ReportingConfiguration.Builder()*
* .skipReportHeader(true)*
* .skipColumnHeader(true)*
* .skipReportSummary(true)*
* .includeZeroImpressions(false)*
* .build();*
* session.setReportingConfiguration(reportingConfiguration);*
* session.setClientCustomerId(customerId);*
* ReportDownloadResponse response = new
ReportDownloader(session).downloadReport(reportDefinition);*
* response.saveToFile(reportFile);*
*}*
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/9ce66e10-19a7-425a-9c3a-26b1b9d3dc2fn%40googlegroups.com.