Multiple Contains-Statements in Awql-Request

1,699 views
Skip to first unread message

Kai steudten

unread,
Jul 16, 2014, 5:45:29 AM7/16/14
to adwor...@googlegroups.com
Hello,

is it possible to have multiple contains-statements in one awql-request? 

In my case, i want to request all keywords from an account which contains several strings.
So there should be selected all keywords which contains for example "string1" or "string2".

Dont think that this is possible with awql or?


Regards,
Kai

Jason Stedman

unread,
Jul 16, 2014, 7:57:18 AM7/16/14
to adwor...@googlegroups.com
AWQL doesn't support the OR keyword, but does have a CONTAINS_ANY condition that according to the grammar should accept a STRINGLIST value.

https://developers.google.com/adwords/api/docs/guides/awql

testmc...@unister.de

unread,
Jul 16, 2014, 8:47:00 AM7/16/14
to adwor...@googlegroups.com
Ok, how is the syntax for this? Seems that CONTAINS_ANY isnt in the documentation.

I have tried it over "AND KeywordText CONTAINS_ANY [string1, string2]" and get following error-message:

SelectorError.INVALID_PREDICATE_OPERATOR @ query; trigger:'KeywordText'


Regards,
Kai

Danial Klimkin

unread,
Jul 16, 2014, 10:12:10 AM7/16/14
to adwor...@googlegroups.com
Hello,


CONTAINS_* operators apply to stringlists only, currently it's only Labels.

There is "IN" operator though, you should be able to do "Id IN (123,456)" or "KeywordText IN ('foo', 'bar')".


-Danial, AdWords API Team.

ferry Ardhana

unread,
Sep 9, 2016, 3:52:00 AM9/9/16
to AdWords API Forum
Hi,

Today is 2 year after your answer, i just want to make sure does CONTAINS_* operators only available for Labels field?
I've try using CampaignName, but it seems not work

Thanks

Shwetha Vastrad (AdWords API Team)

unread,
Sep 19, 2016, 4:22:03 PM9/19/16
to AdWords API Forum
Hi,

Yes, the CONTAINS_* predicate operator is only available for Labels. You can use the IN operator as suggested in the previous post. Please keep an eye on our blog for any updates. 

Regards,
Shwetha, AdWords API Team. 

bastien rabaute

unread,
Feb 8, 2018, 9:43:57 AM2/8/18
to AdWords API Forum
Hi,

You can use contains with CampaignName. It works for me.

WHERE Cost > 0 AND CampaignName contains 'FR'

Bastien
Reply all
Reply to author
Forward
0 new messages