Encoding seed list as bytes object

23 views
Skip to first unread message

Si J

unread,
Mar 12, 2019, 6:20:22 AM3/12/19
to AdWords API and Google Ads API Forum
Hi there,

I'm getting an error around the seed list for a call against TargetingIdeasService (seed keywords). Works fine if I have a string list of 5 keywords which has been converted to a list, from a dataframe. 

`a bytes-like object is required, not 'str'`


Read that there might be an issue with python3 and the encoding that it sends as per this: https://stackoverflow.com/questions/43352496/gmail-api-error-from-code-sample-a-bytes-like-object-is-required-not-str


Any help would be great!

Thanks,
Si

Si J

unread,
Mar 12, 2019, 6:38:20 AM3/12/19
to AdWords API and Google Ads API Forum
Some more context:


Traceback (most recent call last):


  File "<ipython-input-293-5fef7228d404>", line 8, in <module>
    main
(adwords_client, int(AD_GROUP_ID) if AD_GROUP_ID.isdigit() else None)


 
File "<ipython-input-292-c86abcd9b7a2>", line 87, in main
    page
= targeting_idea_service.get(selector)


 
File "~//site-packages\googleads\common.py", line 1387, in MakeSoapRequest
   
'{%s}ApiExceptionFault' % self._GetBindingNamespace())

googleadsapi...@google.com

unread,
Mar 12, 2019, 1:51:17 PM3/12/19
to AdWords API and Google Ads API Forum
Hi Si,

Are you using the code sample get_keyword_ideas.py as is with just the modification of the seed keywords? If not, could you share your code snippet? Also, could you please double check that the requirements mentioned here are met? You could use reply privately to author while sharing your code. 

Thanks,
Sreelakshmi, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Si J

unread,
Mar 14, 2019, 11:54:29 AM3/14/19
to AdWords API and Google Ads API Forum
Hello

yes using that format, I've edited the format - was importing a csv as a pandas dataframe and then to a list but not using the .to_list() function. 

I'm having a new issue where I'm missing data for keywords that are similar, looks like the API is returning a single dataset for similar keywords - is this the case?

Thanks,
Si

googleadsapi...@google.com

unread,
Mar 14, 2019, 4:54:08 PM3/14/19
to AdWords API and Google Ads API Forum
Hello,

Could you please confirm that you are able to fix the first issue and now facing a new issue? For your second question "I'm missing data for keywords that are similar, looks like the API is returning a single dataset for similar keywords - is this the case", could you please share the list of keywords in your request which is missing data in the response? Please note that TargetingIdeaService when tested against a test Google Ads account will only return dummy data. You can check here for reference.
Reply all
Reply to author
Forward
0 new messages