Doh! Thanks!
On Tuesday, March 18, 2014 5:28:31 AM UTC-6, Danial Klimkin wrote:
>
> Hello Jake,
>
>
> The date range is part of the selector, not definition, so:
>
> $selector->dateRange = new DateRange('20140101', '20140110');
> $reportDefinition->dateRangeType = 'CUSTOM_DATE';
>
>
> - Danial, AdWords API Team.
>
>
> On Tuesday, March 18, 2014 3:02:20 AM UTC+4, Jake Wilson wrote:
>>
>> Trying to get an ad performance report for a custom range:
>>
>> $reportDefinition = new ReportDefinition();
>> $reportDefinition->selector = $selector;
>> $reportDefinition->reportName = 'Ad performance report #' . uniqid();
>> $reportDefinition->dateRange = new DateRange('20140101', '20140110');
>> $reportDefinition->dateRangeType = 'CUSTOM_DATE';
>> $reportDefinition->reportType = 'AD_PERFORMANCE_REPORT';
>> $reportDefinition->downloadFormat = 'XML';
>> $reportDefinition->includeZeroImpressions = FALSE;
>>
>> // Report Options
>> $options = array('version' => ADWORDS_VERSION, 'returnMoneyInMicros' =>
>> FALSE);
>>
>> // Download Report
>> $response = ReportUtils::DownloadReport($reportDefinition, null, $user,
>> $options);
>>
>>
>> I get the following error:
>>
>> Report download failed. Underlying errors are Type =
>> 'ReportDownloadError.INVALID_REPORT_DEFINITION_XML', Trigger = 'Invalid
>> ReportDefinition Xml: cvc-complex-type.2.4.d: Invalid content was found
>> starting with element 'dateRange'. No child element is expected at this
>> point.', FieldPath = ''.
>>
>> If I get rid of the dateRange and just do
>>
>> $reportDefinition->dateRangeType = 'LAST_7_DAYS';
>>
>> Then it works fine. What am I missing here?
>>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.