Search filter has no results with 'LIKE' operator but '=' works

94 views
Skip to first unread message

Kateřina Henzlová

unread,
Nov 7, 2023, 7:22:18 AM11/7/23
to Google Ads API and AdWords API Forum
Hi all,

I have found out that the LIKE operator doesn't always work as expected.

POST https://googleads.googleapis.com/v15/customers/<customer_id>/googleAds:search

Body:
{
"pageSize": 10000,
"query": "SELECT campaign.id, campaign.name FROM campaign WHERE  campaign.name = '<campaign_name>"
}

-> returns the campaign

Body:
{
"pageSize": 10000,
"query": "SELECT campaign.id, campaign.name FROM campaign WHERE  campaign.name LIKE '%<campaign_name>%"
}

-> doesn't return the campaign

<campaign_name> contains some special characters "()[]" and I suspect they are the problem as this works just fine for campaigns without special characters. Can you please advise how to make the LIKE operator work? I'll send additional info in the private message if needed.

Thanks for your help,
Katerina Henzlova

Google Ads API Forum Advisor

unread,
Nov 7, 2023, 10:50:30 AM11/7/23
to adwor...@googlegroups.com
Hi Katerina,

Thank you for reaching out to the Google Ads API support team.

By reviewing your concern, I understand that your issue is regarding the like operator. In order to assist you further, please provide us with the complete API logs (request and response with request-id and request header) generated at your end for both the cases which returns the campaign and doesn't return the campaign.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qAvGj:ref"

Thanks,
 
Google Logo Google Ads API Team


Kateřina Henzlová

unread,
Nov 8, 2023, 3:39:36 AM11/8/23
to Google Ads API and AdWords API Forum
Hi team,

Thanks for getting back to me. I have sent the details via the Reply privately to the author option. I hope it helps with the investigation.

Kind regards,
Katerina Henzlova

Kateřina Henzlová

unread,
Nov 14, 2023, 11:01:27 AM11/14/23
to Google Ads API and AdWords API Forum
Hi there,

Do you have any updates on this? The issue persists.

Thanks,
Katerina Henzlova

Kateřina Henzlová

unread,
Dec 11, 2023, 6:44:23 AM12/11/23
to Google Ads API and AdWords API Forum
Hi there,

Do you have any updates on this? The issue persists.

Thanks,
Katerina Henzlova

Google Ads API Forum Advisor

unread,
Dec 11, 2023, 11:19:46 AM12/11/23
to adwor...@googlegroups.com
Hi Katerina,

Thank you for getting back to us.

To match a literal [, ], %, or _ using the LIKE operator, surround the character in square brackets.

You can use the below query to fetch the required campaign using LIKE operator. I would recommend you to check this guide on Rules and limitations of Google Ads Query Language Grammar for more information.

You can get back to us if you still have any issues/concerns related to the Google Ads API.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages