Hello Alex,
Thanks for getting back to us.
You can utilize this Google Ads Query Builder to validate your query. With
regard to those escape characters inputted by users, you can use regular
expressions to validate user inputs.
As an aside, we suggest that you raise this to the client library
This seems like an issue with all of the client libraries. How do you build
a GAQL query with untrusted user input? is there a query builder interface
that sanitizes input?
On Thursday, August 12, 2021 at 11:51:47 AM UTC-7 adsapi wrote:
> Hi Alex,
>
> You can get support for the Python Client L
Hi Alex,
You can get support for the Python Client Library from its issue tracker.
Regards,
Aryeh Baker
Google Ads API Team
ref:_00D1U1174p._5004Q2LmYRT:ref
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~
What's the best way to escape user input for use in GAQL queries when
searching with the GoogleAdsService with the Python client library?
For example:
search = "Something from user input"
query = f"SELECT campaign.id FROM campaign WHERE campaign.name LIKE
'%{search}%'"
google_ads_service.search