Create "suggestSmartCampaignAd“ successfully but return null.

70 views
Skip to first unread message

Chen Xiaowei

unread,
Dec 16, 2021, 6:20:03 AM12/16/21
to AdWords API and Google Ads API Forum
Hi,I use  Method: customers.suggestSmartCampaignAd to get a Smart campaign ad suggestion,the response status is 200OK, but reponse body is null,not like the example 
{ "adInfo": { object (SmartCampaignAdInfo) } },
Thanks!

My request:
curl --location --request POST 'https://googleads.googleapis.com/v9/customers/XXXXXXXX:suggestSmartCampaignAd' \
--header 'Content-Type: application/json' \
--data-raw '{
    "suggestionInfo": {
        "final_url": "www.abc.com",
        "language_code": null,
        "ad_schedules": null,
        "keyword_themes": [
            {
                "keyword_theme_constant": "keywordThemeConstants/41242~0"
            }
        ],
        "business_context": {
            "business_name": "abcttt"
        }
    }
}'

My response:
{}

Google Ads API Forum Advisor

unread,
Dec 16, 2021, 8:36:46 AM12/16/21
to viviana...@gmail.com, adwor...@googlegroups.com
Hi Chen,

Thank you for raising your concern to my team.

To further investigate the issue, could you provide the complete request and response logs with request ID and request header generated on your end? You can use the -i flag in your curl command so that your tool will include the HTTP response headers in the output.  

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 Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2TLiMM:ref

Chen Xiaowei

unread,
Dec 17, 2021, 6:36:40 AM12/17/21
to AdWords API and Google Ads API Forum
Thanks for your reply.Now try again and successfully get the correct structure response by adding a “language code” eum.But the "language code" field is optional listed in document. I want to confirm if the “language code” is necessary.
企业微信截图_16397138273647.png
Thanks,Vivi

Google Ads API Forum Advisor

unread,
Dec 17, 2021, 8:10:21 PM12/17/21
to viviana...@gmail.com, adwor...@googlegroups.com
Hi Vivi,

I work with Ernie and will assist you. Thank you for privately sending your logs. I reproduced this issue that without a language setting you don't get the default of English and the request returns empty. I also took out the languageCode key value pair all together and it didn't help. I raised this with my team. You may monitor the document for an update.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2TLiMM:ref

Chen Xiaowei

unread,
Dec 21, 2021, 6:13:01 AM12/21/21
to AdWords API and Google Ads API Forum
So thankful for your reply

Chen Xiaowei

unread,
Dec 29, 2021, 6:40:20 AM12/29/21
to AdWords API and Google Ads API Forum
Hi,team.Now I find that I use other language code but not "en", it always return null.If now API just support for English?

Google Ads API Forum Advisor

unread,
Dec 29, 2021, 7:53:18 AM12/29/21
to viviana...@gmail.com, adwor...@googlegroups.com
Hi Chen,

Would you be able to provide also the complete request and response logs with request ID and request header generated on your end for setting different languages so that I can present it as well to my team?

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2TLiMM:ref

Google Ads API Forum Advisor

unread,
Dec 29, 2021, 7:55:52 AM12/29/21
to adwor...@googlegroups.com, viviana...@gmail.com
Hi Chen,

Please provide the information that I recently requested via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Chen Xiaowei

unread,
Dec 30, 2021, 1:51:19 AM12/30/21
to AdWords API and Google Ads API Forum
I've provided response and request.Thanks

Google Ads API Forum Advisor

unread,
Dec 30, 2021, 5:08:27 PM12/30/21
to viviana...@gmail.com, adwor...@googlegroups.com

Hello there,

Thanks for getting back to us. My name is Jakeia, I am a member of the Google Ads API team. Allow me to assist you further. Can you please provide the complete request and response logs with request ID for further investigation. Please use the Reply privately to the author option while sharing the details to ensure the information is shared privately.

Regards,

Google Logo
Jakeia Sabrina
Google Ads API Team
 

ref:_00D1U1174p._5004Q2TLiMM:ref

Google Ads API Forum Advisor

unread,
Dec 30, 2021, 6:58:06 PM12/30/21
to viviana...@gmail.com, adwor...@googlegroups.com

Hello there,

Please ignore my previous email.
Thanks for providing all the details. Please allow me to share this with our team and we will provide an update shortly.

Regards,

Google Ads API Forum Advisor

unread,
Dec 30, 2021, 9:34:23 PM12/30/21
to adwor...@googlegroups.com, viviana...@gmail.com
Greetings!

Thank you for providing all the additional detail. I took a deep dive into this, and this is what I found. I've covered my observations in three sections.

The language_code is required for the methods being called.

It appears that language_code is required according to https://developers.google.com/google-ads/api/reference/rpc/v9/SuggestKeywordThemesRequest if you are calling the method SuggestKeywordThemes. The reason the field looks optional is because this same object is used for many different methods. Some methods require the field, and other fields do not require the field. It's best to double-check in the description of the method to see if a field is required or not.

Null is returned because language_code is required for that method.

I believe the reason null is coming back is because language_code is required for those particular methods that you are calling. If you do not provide the required fields, then the result will be empty. I have put in a request to return an error in a future version of the API if a field is required. I believe that would cause less confusion.   

I believe at this time English is the only supported language.

I took a look in the Google Ads UI for your account, and I'm not seeing any other option but a default of English at this time. I will double-check with my teammates who wrote this particular piece of code to confirm if this is the case. Please keep in mind that it is the holidays for much of the US and Europe, so we may get an answer a bit slower than usual.

Best,
 
Google Logo
Nadine Wang
Google Ads API Team
Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey


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