GAQL: Escape % and _ in LIKE

76 views
Skip to first unread message

FW API

unread,
Jun 9, 2023, 7:14:10 AM6/9/23
to Google Ads API and AdWords API Forum
Hi.

I would like to use % and _ literally in a LIKE filter.

How can I escape these special characters?

Does GAQL LIKE use other special characters besides these two?

Thanks.

Google Ads API Forum Advisor

unread,
Jun 14, 2023, 8:38:47 AM6/14/23
to api.fw...@gmail.com, adwor...@googlegroups.com

Hi there,

Thanks for reaching out to the Google Ads API Forum.

You may note that to match a literal [, ], %, or _ using the LIKE operator, surround the character in square brackets. For example, the following condition matches all campaign.name values that start with [Earth_to_Mars]:

The LIKE operator can only be used on a string field, not an array.

Let me know if you have any questions. 

This message is in relation to case "ref:_00D1U1174p._5004Q2mBBLh:ref"

Thanks,
 
Google Logo Google Ads API Team

 



Reply all
Reply to author
Forward
0 new messages