Predicates Error In Keyword Performance Report

44 views
Skip to first unread message

luke.a...@bet365.com

unread,
Dec 28, 2017, 12:32:36 PM12/28/17
to AdWords API Forum
Hi,

I have just resolved an error that I have been debugging for a while, and I'm not sure it was really a fault with my code. The issue is the ordering of the "Predicates" node within the SOAP body. In scenario 1, I get a 400 INVALID REPORT DEFINITION XML, and scenario 2, I get a 200 ok with full response. Is this expected behaviour? I not using any of the AdWords libraries to generate the SOAP or request.


Scenario 1 - 400 INVALID REPORT DEFINITION XML - (Trigger: Invalid ReportDefinition Xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'predicates'. One of '{"https://adwords.google.com/api/adwords/cm/v201710":ordering, "https://adwords.google.com/api/adwords/cm/v201710":paging}' is expected.)

<reportDefinition
<selector>
<fields>CampaignId</fields>
<fields>AdGroupId</fields>
<fields>CampaignName</fields>
<fields>AdGroupName</fields>
<fields>Criteria</fields>
<fields>Status</fields>
<fields>SystemServingStatus</fields>
<fields>Impressions</fields>
<fields>Clicks</fields>
<fields>Cost</fields>
<fields>AverageCpc</fields>
<fields>Ctr</fields>
<fields>TrackingUrlTemplate</fields>
<fields>FinalMobileUrls</fields>
<fields>FinalUrls</fields>
<fields>AveragePosition</fields>
<fields>SearchImpressionShare</fields>
<fields>QualityScore</fields>
<fields>AccountCurrencyCode</fields>
<fields>AccountDescriptiveName</fields>
<dateRange>
<min>20171220</min>
<max>20171227</max>
</dateRange>
<predicates>
<field>Clicks</field>
<operator>GREATER_THAN</operator>
<values>0</values>
</predicates>
</selector>
<reportName>Report</reportName>
<reportType>KEYWORDS_PERFORMANCE_REPORT</reportType>
<dateRangeType>CUSTOM_DATE</dateRangeType>
<downloadFormat>CSV</downloadFormat>
</reportDefinition>


Scenario 2 - 200 OK

<reportDefinition
<selector>
<fields>CampaignId</fields>
<fields>AdGroupId</fields>
<fields>CampaignName</fields>
<fields>AdGroupName</fields>
<fields>Criteria</fields>
<fields>Status</fields>
<fields>SystemServingStatus</fields>
<fields>Impressions</fields>
<fields>Clicks</fields>
<fields>Cost</fields>
<fields>AverageCpc</fields>
<fields>Ctr</fields>
<fields>TrackingUrlTemplate</fields>
<fields>FinalMobileUrls</fields>
<fields>FinalUrls</fields>
<fields>AveragePosition</fields>
<fields>SearchImpressionShare</fields>
<fields>QualityScore</fields>
<fields>AccountCurrencyCode</fields>
<fields>AccountDescriptiveName</fields>
<predicates>
<field>Clicks</field>
<operator>GREATER_THAN</operator>
<values>0</values>
</predicates>
<dateRange>
<min>20171220</min>
<max>20171227</max>
</dateRange>
</selector>
<reportName>Report</reportName>
<reportType>KEYWORDS_PERFORMANCE_REPORT</reportType>
<dateRangeType>CUSTOM_DATE</dateRangeType>
<downloadFormat>CSV</downloadFormat>
</reportDefinition>

Bharani Cherukuri (AdWords API Team)

unread,
Dec 28, 2017, 3:26:49 PM12/28/17
to AdWords API Forum
Hello Luke, 

Thank you for sharing the logs. The report error 400 indicates that it might be an error in the API request. I see that you're defining date range followed by the condition. The report query would be something like this: 

SelectClause FromClause WhereClause DuringClause OrderByClause

You may refer to this guide for more information. Let me know if you have any other questions. 

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