I am unable to create the SuggestKeywordThemesRequest, while creating the smart ads using the example given

192 views
Skip to first unread message

souv...@gmail.com

unread,
Jun 30, 2023, 2:26:59 PM6/30/23
to Google Ads API and AdWords API Forum
Hi.

All I am trying to do is create a smart ad following the example given here


here is my code where I am getting the error

suggestion_infor object

final_url: "https://xxxxx/"
language_code: "en"
business_context {
  business_name: "xxx"
}
location_list {
  locations {
    geo_target_constant: "geoTargetConstants/1023191"
  }
}

the error I get while setting up  SuggestKeywordThemesRequest

suggest_keyword_request = client.get_type("SuggestKeywordThemesRequest")
suggest_keyword_request.customer_id = str(customer_id)
#print(suggestion_info)
suggest_keyword_request.suggestion_info = suggestion_info
print(suggest_keyword_request)

Error 

    suggest_keyword_request.suggestion_info = suggestion_info
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Assignment not allowed to message, map, or repeated field “suggestion_info” in protocol message object.

can you help me out, I am bit stuck

Thanks
Souvik


souv...@gmail.com

unread,
Jun 30, 2023, 7:10:33 PM6/30/23
to Google Ads API and AdWords API Forum

I was able to solve the above using CopyFrom, but that works but I got this

AttributeError: Assignment not allowed to message, map, or repeated field "keyword_themes" in protocol message object.


But I got a different error 
AttributeError: 'google._upb._message.RepeatedCompositeContainer' object has no attribute 'CopyFrom'


Google Ads API Forum Advisor

unread,
Jul 3, 2023, 8:40:08 AM7/3/23
to souv...@gmail.com, adwor...@googlegroups.com

Hi Souvik,

Thank you for raising your concern to the Google Ads API team.

Upon checking it appears you're having issues with our sample code provided. With this, I recommend raising your concern to the author of the client library you are using. To raise your concern, kindly go to the page of your Client Library(https://developers.google.com/google-ads/api/docs/client-libs) and then go to the issues tab to create new issue. Here's an example for Perl client library: https://github.com/googleads/google-ads-perl/issue

Let me know if you have any questions.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2mqNyz:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages