Search code examples
javaawql

AWQL report where condition syntax


I need to expand an AWQL report query. The query is currently

"SELECT Id, AveragePosition, CpcBid, KeywordMatchType, Labels, AdGroupId, AccountDescriptiveName, Criteria "
            + " FROM KEYWORDS_PERFORMANCE_REPORT "
            + " WHERE Status IN [ENABLED] "

            + " DURING " + reportingPeriod.value;

I need to add some more conditions in the WHERE clause. Specifically, I have a list of objects each having a Set<String> for labels and a requirement on the average position.

I tried:

AND ((Labels CONTAINS_ANY ['object_1_label1'] AND CpcBid>2.0) 
OR (Labels CONTAINS_ANY ['object_2_label_1','object_2_label_2'] AND CpcBid<=3.0)
...)

Google reports an error in where clause.

Any ideas?


Solution

  • As of now the Google Ads Report Service does not know 'OR' and cannot filter for Label names, only Label IDs.