Wildcards in CONTAINS predicate?

87 views
Skip to first unread message

Preston Hinkle

unread,
Oct 5, 2018, 6:57:19 PM10/5/18
to AdWords API and Google Ads API Forum
Hello,

I was wondering if in AdWords it is possible to search for AdGroup names using a wildcard in a CONTAINS predicate; for instance, something like 

'predicates': [
    {
        'field': 'Name',
        'operator': 'CONTAINS',
        'values': 'adgroup*'
}
],

where the wildcard asterisk above indicates that adgroups with name 'adgroup1', 'adgroup2', ... would be found. Is something like this possible in AdWords? I'm not seeing anything in the documentation.

Thank you

Luis Xander Talag (AdWords API Team)

unread,
Oct 5, 2018, 7:40:22 PM10/5/18
to adwor...@googlegroups.com
Hi Preston,

Yes, it is possible to use "CONTAINS" as a predicate operator as stated in here. However, specifically in your sample code, you don't need to include the asterisk(*) in your "values" field to achieve your desired result since the asterisk is not a sub-string of your ad group names. "CONTAINS" operator checks for fields that contains the given value as a sub-string. So for example, if you have a field "Name", with operator "CONTAINS" and values "adgroup" in your predicate, it should return ad groups with names 'adgroup1', 'adgroup2', and the like.

Hope this helps. Let me know should you have further concerns.

Best regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages