Combine Multiple Selector Predicates Using OR

1,026 views
Skip to first unread message

Dorian Kind

unread,
Jan 6, 2012, 11:00:20 AM1/6/12
to AdWords API Forum
Hi all,

In a blog post[1] dating back to 2010, it is stated that "[i]t’s not
possible to combine predicates using OR logic at this time[...]".
I was wondering whether this is still correct. For example, I'd love
to filter campaign data according to the campaign names using the
CONTAINS predicate, providing multiple possible name components
instead of just one. Am I correct in assuming that this has to be done
client-side by sending multiple requests and combining the results?

Many thanks for any feedback and best regards,
Dorian

[1]: <http://adwordsapi.blogspot.com/2010/12/harness-power-of-
predicates-in-your.html>

Anash P. Oommen

unread,
Jan 9, 2012, 3:54:19 AM1/9/12
to adwor...@googlegroups.com
Hi Dorian,

Yes, this is still correct. CONTAINS take only one item in predicate.values, and the rule for combining predicates is AND, so you need multiple requests to filter results by multiple name components.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Charlie Saunders

unread,
Jun 6, 2013, 10:53:50 AM6/6/13
to adwor...@googlegroups.com
Hi everyone,

This still seems to be true, but can anyone confirm?

Thanks!

Charlie Saunders

unread,
Jun 6, 2013, 11:52:27 AM6/6/13
to adwor...@googlegroups.com
So after some further research, it seems like this might be possible with the IN operator, but there's no ignore case version of this.  I take it there's no way to do a case insensitive OR?

Thanks again!

Kevin Winter (AdWords API Team)

unread,
Jun 10, 2013, 9:52:34 AM6/10/13
to adwor...@googlegroups.com
Correct, OR is still not possible.  If you aren't already, you might want to look into using multiple reports, requested concurrently to perform this type of operation more quickly.

- Kevin Winter
AdWords API Team

Charlie Saunders

unread,
Jun 10, 2013, 12:04:05 PM6/10/13
to adwor...@googlegroups.com
Hi Kevin,

Thanks for your response.  I considered that approach, but downloading and handling 2^n - 1 reports (where n is the number of CONTAINS I want to specify) seemed somewhat unappealing, so I was hoping for a cleaner solution.

For anyone wondering, it looks like IN requires an exact match to the criterion you specify- it doesn't work like CONTAINS.

Thanks again!
Reply all
Reply to author
Forward
0 new messages