Querying the search query report for accented charaters

131 views
Skip to first unread message

Axel Vermeil

unread,
Nov 3, 2015, 5:17:11 AM11/3/15
to AdWords API Forum
Hi,

When I search for a search_term in the search_query_performance_report, and this search term has an accent in it (in my case, é), it doesn't seem to find it. For example, in the account I'm looking at, doing the query:

__fmt=XML&__rdquery=SELECT+Impressions,Clicks,Cost,Query+FROM+SEARCH_QUERY_PERFORMANCE_REPORT+WHERE+CampaignStatus=ENABLED+AND+AdGroupStatus=ENABLED+AND+Clicks>1+DURING+20150904,20151103

reveals a number of search queries, including one for "structure métallique". But if I try to look for it again:

__fmt=XML&__rdquery=SELECT+Impressions,Clicks,Cost+FROM+SEARCH_QUERY_PERFORMANCE_REPORT+WHERE+Query="structure+métallique"+DURING+20130206,20151103

I come up with an empty array. Looking for "structure metallique" (no accents) yields a result, but I'm not certain that it is the same search query. 

Is this expected behavior? I've gotten around this problem for keywords by using the adgroupCriterionService GET (not reports), but I can't find the equivalent for search queries. Am I missing something? Is there some kind of ID field I could use for search queries instead?

Thanks for any help!

Axel


Michael Cloonan (AdWords API Team)

unread,
Nov 3, 2015, 1:44:32 PM11/3/15
to AdWords API Forum
Hello,

Unfortunately, there are no ids for search queries like there are for other, more specific criteria like keywords. I'm going to follow up with the API team to see if there's something you can do to get this working with accented characters, or if not to add it as a feature request since it definitely seems like a very valid use case.

Regards,
Mike, AdWords API Team

Axel Vermeil

unread,
Nov 3, 2015, 1:49:40 PM11/3/15
to AdWords API Forum
Thanks!

I look forward to hearing more about this :). Note that I have not tested other characters such as arabic or cyrillic, but it would be great if those worked as well.

Axel

Michael Cloonan (AdWords API Team)

unread,
Nov 10, 2015, 10:46:16 AM11/10/15
to AdWords API Forum
Hello,

To help the engineering team look into this issue, we need some sample queries. You've provided those, which is great, but unfortunately we also need your account ID for the right context. Please provide this to me whenever you get a chance; you can reply privately to me using the drop-down at the top-right of my post if privacy is a concern.

Regards,
Mike, AdWords API Team

Axel Vermeil

unread,
Nov 10, 2015, 10:51:05 AM11/10/15
to AdWords API Forum
Hi Mike, 

I've sent you a private message with the customer ID.

Axel

Michael Cloonan (AdWords API Team)

unread,
Nov 10, 2015, 4:48:04 PM11/10/15
to AdWords API Forum
Hello,

In your initial query, you have Query="structure+métallique"

Try replacing the + in the quotes with a space character. This should hopefully allow you to query for accented characters. Let me know how it works out.

Regards,
Mike, AdWords API Team

Axel Vermeil

unread,
Nov 11, 2015, 5:11:09 AM11/11/15
to AdWords API Forum
Hi Mike,

I tried 

__fmt=XML&__rdquery=SELECT+Impressions,Clicks,Cost+FROM+SEARCH_QUERY_PERFORMANCE_REPORT+WHERE+Query="structure métallique"+DURING+20130206,20151103

But still got no results.

Axel

Michael Cloonan (AdWords API Team)

unread,
Nov 11, 2015, 9:05:05 AM11/11/15
to AdWords API Forum
Hello,

I've gotten this to return results. Here's an example report request:

__rdquery=SELECT+Impressions%2CClicks%2CCost+FROM+SEARCH_QUERY_PERFORMANCE_REPORT+WHERE+Query%3D%22structure+m%C3%A9tallique%22+DURING+20130206%2C20151103&__fmt=CSV

It looks like, if you want to support accented characters, you need to URL escape the string before passing it. Please try that.

I apologize for the back and forth repeatedly trying to figure out this issue; we should have been able to identify it faster on our end.

Regards,
Mike, AdWords API Team


Axel Vermeil

unread,
Nov 13, 2015, 5:40:31 AM11/13/15
to AdWords API Forum
Hi Mike,

That seems to work for me as well! It looks like I must URL escape all characters, and that I can even replace "+" with %20. So in the end, I can just stick the whole thing into encodeURIComponent() (I'm using nodejs) and get

__fmt=XML&__rdquery=SELECT%20Impressions%2CClicks%2CCost%20FROM%20SEARCH_QUERY_PERFORMANCE_REPORT%20WHERE%20Query%3D%22structure%20m%C3%A9tallique%22%20DURING%2020130216%2C20151113

Which works, surprisingly. Will this work for other alphabets, such as Cyrillic, Arabic, or Japanese?

It would be great to specify these rules in the AWQL documentation at https://developers.google.com/adwords/api/docs/guides/awql.

On a separate topic, it would be amazing to have an AdWords library for nodejs. 

Thanks for your help,

Axel

Michael Cloonan (AdWords API Team)

unread,
Nov 13, 2015, 2:13:00 PM11/13/15
to AdWords API Forum
Hello,

To my knowledge, this should work with other alphabets as well. If you run into issues with those, don't hesitate to reach out again.

Regards,
Mike, AdWords API Team

manuel...@360imprimir.pt

unread,
Oct 18, 2018, 7:10:32 AM10/18/18
to AdWords API and Google Ads API Forum
Hello Michael,

I did the same as Alex, and, for a long period of time, that solution worked. However, today, even after encoding the request with URL encode, no results are returned.

Were there any changes to the API that make this solution obsolete? Thanks

Manuel

Milind Sankeshware (AdWords API Team)

unread,
Oct 18, 2018, 2:53:24 PM10/18/18
to AdWords API and Google Ads API Forum
Hi Manuel,

Could you please share your query along with the client customer id so that we can troubleshoot further? You can use 'Reply privately to the author' option while responding.

Thanks,
Milind, AdWords API Team

manuel...@360imprimir.pt

unread,
Oct 19, 2018, 9:39:36 AM10/19/18
to AdWords API and Google Ads API Forum
Hi Milind,

I sent you the query and Client Customer ID and the query in a private reply.

Thanks, Manuel
Reply all
Reply to author
Forward
0 new messages