Specify historical date for click performance report

607 views
Skip to first unread message

big.a...@gmail.com

unread,
Apr 7, 2016, 8:43:10 AM4/7/16
to AdWords API Forum
Hi

I am trying to download historical data for the click performance report.  I can get it to run with the YESTERDAY and TODAY date range type, but I want to be able to go back and download the last 90 days worth of data.  I am using the Java adwords.axis examples as a base, and trying to do something like the following:


        DateRange dr = new DateRange();
        dr.setMin("20160401");
        dr.setMax("20160402");
        selector.setDateRange(dr);

        reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.CUSTOM_DATE);
        reportDefinition.setReportType(ReportDefinitionReportType.CLICK_PERFORMANCE_REPORT);
        reportDefinition.setDownloadFormat(DownloadFormat.CSV);

However, I get the following error:

---
[07 Apr 2016 11:50:59,539-report_download:WARN:main] Response received with status code 400 and message: Bad Request

Report was not downloaded due to: HTTP Response Code: 400, Trigger: A single day DateRange is required for reportType: CLICK_PERFORMANCE_REPORT, Type: ReportDefinitionError.INVALID_DATE_RANGE_FOR_REPORT
---

If I omit the date range type altogether but leave the min and max in I get the exact same error.

Any help appreciated.

Thanks
Neil


Anthony Madrigal

unread,
Apr 7, 2016, 10:58:04 AM4/7/16
to AdWords API Forum
Hi Neil,

The Click Performance Report only runs for a single day. If you change for date range to have the same value for both the min and max, it should work. You could also use the values TODAY and YESTERDAY. Please note that this report's date range only can run for dates up to 90 days old.

Cheers,
Anthony
AdWords API Team
Reply all
Reply to author
Forward
0 new messages