Unable to select by label?

182 views
Skip to first unread message

João Aparício

unread,
Nov 24, 2014, 4:53:36 AM11/24/14
to adwor...@googlegroups.com
Hi

In the reports, I'm trying to select for ads that contain (or don't contain) a certain label. Somehow I'm getting an error both from the API and from Scripts. The query is the following:

SELECT AdGroupId FROM AD_PERFORMANCE_REPORT WHERE Labels CONTAINS_NONE ['my special label'] DURING 20140801,20141122

From the API I'm getting:

googleads.errors.AdWordsReportBadRequestError: Type: ReportDownloadError.ERROR_GETTING_RESPONSE_FROM_BACKEND

And from Scripts I'm getting:

Failed to read from AdWords. Please wait a bit and try again. (line 6)

Interestingly, the error messages are different if instead I use the CONTAINS operator, and suggest to me a syntax error. That is, the query:

SELECT AdGroupId FROM AD_PERFORMANCE_REPORT WHERE Labels CONTAINS ['my special label'] DURING 20140801,20141122

Returns from the API:

googleads.errors.AdWordsReportBadRequestError: Type: QueryError.INVALID_WHERE_CLAUSE

And from Scripts:

One of the conditions in the query is invalid. (line 6)

Any ideas?

Best regards,
Joao



Danial Klimkin

unread,
Nov 24, 2014, 6:11:22 AM11/24/14
to adwor...@googlegroups.com
Hello Joao,


Filtering by Labels requires using label IDs, not texts. Pull the IDs for the labels and add a filter using LabelIds column instead.


-Danial, AdWords API Team.

João Aparício

unread,
Nov 24, 2014, 9:25:22 AM11/24/14
to adwor...@googlegroups.com
You might be right, but I still haven't managed to get it to work though.

I can get the label id, but neither of the following queries work:

SELECT AdGroupId FROM AD_PERFORMANCE_REPORT WHERE Labels EQUALS '49545027' DURING 20140801,20141122
SELECT AdGroupId FROM AD_PERFORMANCE_REPORT WHERE Labels CONTAINS ['49545027'] DURING 20140801,20141122

I get:

googleads.errors.AdWordsReportBadRequestError: Type: QueryError.INVALID_WHERE_CLAUSE

Danial Klimkin

unread,
Nov 25, 2014, 7:46:31 AM11/25/14
to adwor...@googlegroups.com
Hello João,


Please see:


Try:

SELECT AdGroupId FROM AD_PERFORMANCE_REPORT WHERE LabelIds CONTAINS_ANY [49545027] DURING 20140801,20141122


-Danial, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages