CAMPAIGN_PERFORMANCE_REPORT with predicate Labels CONTAINS_ANY results in a 500 Internal Server Error

281 views
Skip to first unread message

jpuc...@dealerinspire.com

unread,
Aug 6, 2018, 1:22:32 AM8/6/18
to AdWords API and Google Ads API Forum
How can I filter reports for campaigns that have a given label's name?

Attempting to use the predicate Labels CONTAINS_ANY labelName fails with a server error. The predicate LabelIds CONTAINS_ANY with the label ID works just fine, but I would rather not have to make an additional network call just to first look up the Label ID given the Label name.

Thanks,
Jeff

POST /api/adwords/reportdownload/v201802 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: adwords.google.com
Authorization: REDACTED
developerToken: REDACTED
clientCustomerId: 4625294097
User-Agent: FUEL API (AwApi-PHP, googleads-php-lib/34.0.0, PHP/7.1.3, GuzzleHttp/6.3.3, curl/7.38.0)
skipReportHeader: true
skipColumnHeader: true
skipReportSummary: true
useRawEnumValues: false
includeZeroImpressions: true

__rdxml=<?xml version="1.0"?>
<reportDefinition><selector><fields>CampaignId</fields><fields>Cost</fields><fields>Labels</fields><fields>CampaignStatus</fields><fields>BudgetId</fields><fields>LabelIds</fields><predicates><field>Labels</field><operator>CONTAINS_ANY</operator><values>Video</values></predicates></selector><reportName>Campaign Budget Report for AdWords Client 4625294097</reportName><reportType>CAMPAIGN_PERFORMANCE_REPORT</reportType><dateRangeType>TODAY</dateRangeType><downloadFormat>CSV</downloadFormat></reportDefinition>


Response:
REDACTED REPORT DATA
--------
Error:
Server error: `POST https://adwords.google.com/api/adwords/reportdownload/v201802` resulted in a `500 Internal Server Error` response

Dannison Yao (AdWords API Team)

unread,
Aug 6, 2018, 3:35:51 AM8/6/18
to AdWords API and Google Ads API Forum
Hi Jeff,

Unfortunately, filtering of labels by name is not supported in the AdWords API as stated in this guide. It is only recommended to use the label Id for filtering.

Let me know if you have further clarifications.

Regards,
Dannison
AdWords API Team

jpuc...@dealerinspire.com

unread,
Aug 6, 2018, 10:40:20 AM8/6/18
to AdWords API and Google Ads API Forum
Thanks, that's helpful!

I was confused because the documentation here says that specific attribute is filterable. Secondly, I'd expect the API to return a 400 bad request response, not a 500 internal server error - even the SDK message says this is a temporary problem and to retry the request in a few minutes. Normally, we'd see a bad predicate or related error message.

I really appreciate your quick response.

Thanks,
Jeff P.

Dannison Yao (AdWords API Team)

unread,
Aug 7, 2018, 2:19:42 AM8/7/18
to AdWords API and Google Ads API Forum
Hi Jeff,

My apologies for the confusion that the documentation may have caused. This documentation only pertains that the Label can be used as filter. However, the values used to filter the said field is done differently and is discussed more in details in this guide.

For your second concern, I have tried replicating the issue, however, I did not encounter the same results with what you encountered. I was able to encounter the error ERROR_GETTING_RESPONSE_FROM_BACKEND, since it recognized my predicate as an invalid string filter. Could you confirm if you are using the same AWQL statement as the one below? 

"SELECT CampaignId, Cost, Labels, CampaignStatus, BudgetId, LabelIds FROM CAMPAIGN_PERFORMANCE_REPORT WHERE Labels CONTAINS_ANY ['Video']"

If yes, let me know if you still encounter the 500 error so I could investigate this further.

Regards,
Dannison
AdWords API Team


Reply all
Reply to author
Forward
0 new messages