Google ads will remove the special characters like - or " in keywords

767 views
Skip to first unread message

Rock Qi

unread,
Mar 13, 2022, 4:35:09 AM3/13/22
to Google Ads API and AdWords API Forum
Hi,

During the process of migrating adwords to ads, I found keywords with special characters, such as built-in, 30"" cooktop, the special characters in keywords will be removed when ads API return. (built-in -> built in, 30"" cooktop -> 30 cooktop)
But adwords will not.
My question is, how to preserve these special characters so that the input and output keywords are consistent?


val operations = keywords.map(w => {
val keyword1 = KeywordPlanAdGroupKeyword.newBuilder
.setKeywordPlanAdGroup(planAdGroupResource)
.setCpcBidMicros(2000000L)
.setMatchType(KeywordMatchType.BROAD)
.setText(w)
.build
KeywordPlanAdGroupKeywordOperation.newBuilder.setCreate(keyword1).build
}).toList

Br,
Rock

Google Ads API Forum Advisor

unread,
Mar 14, 2022, 6:07:10 AM3/14/22
to qiqin...@gmail.com, adwor...@googlegroups.com
Hi Rock, 

Thank you for raising this concern to Google Ads API team.

With regard to your concern, "how to preserve these special characters so that the input and output keywords are consistent", I would suggest implementing scaping of special characters which is the backslash (/). With this, you will see that input and output of the keywords are consistent.

Let us know if you have any questions.

Regards,
Google Logo
Carmela
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YkqMU:ref

Rock Qi

unread,
Mar 14, 2022, 5:35:08 PM3/14/22
to Google Ads API and AdWords API Forum
Hi,

Could you share me sample code for keywords containing - or "?(build-in, 2-in-1 etc.)

For example,
The keywords are built-in oven  and 30"" cooktop, which will be set on KeywordPlanAdGroupKeyword.setText()
But the ads API will return like "built in oven" and "30 cooktop".  - and " are removed.
I tried / and \, looks like the result is the same as before.

I can paste more code if needed, Thanks!

Br,
Rock

Google Ads API Forum Advisor

unread,
Mar 15, 2022, 3:38:12 AM3/15/22
to qiqin...@gmail.com, adwor...@googlegroups.com
Hi Rock,

Thank you for raising this concern to Google Ads API team.

Can I ask what client library you are using? In order for us to route you to the client library author because they are more equipped to provide sample codes for you. 

Rock Qi

unread,
Mar 15, 2022, 4:25:32 AM3/15/22
to Google Ads API and AdWords API Forum
Hi,

Client library is Java.
Maven: com.google.api-ads:google-ads:17.0.1

-Rock

Google Ads API Forum Advisor

unread,
Mar 15, 2022, 5:56:44 AM3/15/22
to qiqin...@gmail.com, adwor...@googlegroups.com
Hi Rock,

Thank your response.

I see that the client library you are using is Java. With this, please directly reach out to the client library owner by filing the issue in the Issue Tab on github to know how to use escape characters in Java so that the (-) and ("") will reflect on the UI.


Let us know if you have any questions.

Rock Qi

unread,
Mar 17, 2022, 11:51:49 AM3/17/22
to Google Ads API and AdWords API Forum
Hi,

Thanks for your reply. I have opened a question on github.

If you don't mind, i'd like to post another question here.
Sometimes when setting 2 forward/reverse keywords to one keywordplan, only the first keyword is returned. Sometimes both will return. E.g:one_return.png
two_return.png
Screenshot 2022-03-17 at 17.32.40.png

Did I do something wrong?
How to make sure that all keywords can be returned from ads api? Thanks.

Br,
Rock

Ngon Nguyen

unread,
Mar 17, 2022, 8:08:42 PM3/17/22
to qiqin...@gmail.com, Google Ads API and AdWords API Forum
Chào mừng bạn đến với bảng nhớ tạm của Gboard, bất kỳ văn bản nào bạn sao chép sẽ được lưu tại đây.Sử dụng biểu tượng chỉnh sửa để ghim, thêm hoặc xóa đoạn.Nhấn vào một đoạn để dán vào hộp văn bản.Chạm và giữ một đoạn để ghim đoạn đó. Các đoạn đã bỏ ghim sẽ bị xóa sau 1 giờ.

Vào 4:35, Th 3, 15 thg 3, 2022 Rock Qi <qiqin...@gmail.com> đã viết:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/2979dbef-a64f-4445-9fca-9547ad2c648dn%40googlegroups.com.

Google Ads API Forum Advisor

unread,
Mar 18, 2022, 3:55:21 AM3/18/22
to qiqin...@gmail.com, adwor...@googlegroups.com
Hi Rock,

Thank you for raising your additional concern. Allow me to provide support to it.

So that I can investigate the issue, could you provide the complete request and response logs with request ID and request header generated on your end for the 2 scenarios?

You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YkqMU:ref
Reply all
Reply to author
Forward
0 new messages