About Invalid content was found starting with element 'includeZeroImpressions'

566 views
Skip to first unread message

Ip Y

unread,
Apr 19, 2016, 8:47:38 AM4/19/16
to AdWords API Forum
Trying to get an ad performance report :

if ( $this->dateRangeType == "CUSTOM_DATE" ) {
$selector->dateRange = new DateRange($this->dateRangeStart, $this->dateRangeEnd);
}

$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = $this->reportType . "   " . $this->dateRangeType;
if ( $this->dateRangeType == "CUSTOM_DATE" ) {
$reportDefinition->reportName .= "(From : " . $this->dateRangeStart . "  to : " . $this->dateRangeEnd . ")";
}
$reportDefinition->dateRangeType = $this->dateRangeType;
$reportDefinition->reportType = $this->reportType;
$reportDefinition->downloadFormat = $this->outFileType;
$reportDefinition->includeZeroImpressions = FALSE;



In google adwords api version: v201603:
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 'includeZeroImpressions'. No child element is expected at this point.', FieldPath = ''.

Xml file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.INVALID_REPORT_DEFINITION_XML</type><trigger>Invalid ReportDefinition Xml: cvc-complex-type.2.4.d: Invalid content was found starting with element 'includeZeroImpressions'. No child element is expected at this point.</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>


But In google adwords api version: v201506 no this error and successfully download all XML file

Shwetha Vastrad (AdWords API Team)

unread,
Apr 19, 2016, 4:07:32 PM4/19/16
to AdWords API Forum
Hello, 

The includeZeroImpressions field has been removed from the XML report definition schema in API version v201603. You need to use the includeZeroImpressions HTTP header instead. If you are using the PHP client library, then you can do so by setting the options for includeZeroImpressions. Please take a look at the updated PHP example DownloadCriteriaReport.php

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages