Hello,

During the migration of Google Ads Migration, I stuck with the migration of 
*TargetingIdeaService*. I want to get 'KEYWORD_TEXT' 
and 'CATEGORY_PRODUCTS_AND_SERVICES' values.

I tried to apply the example 
in 
https://github.com/googleads/google-ads-python/blob/main/examples/planning/generate_keyword_ideas.py,
 
I am having *"ValueError: Specified type 'StringValue' does not exist in 
Google Ads API v10" *error using only keyword_texts in the example (I don't 
use page_url)

In old googleads library (it works):

targeting_idea_service = client.GetService(
'TargetingIdeaService', version=self.config.version
)

selector = {'ideaType': 'KEYWORD',
'requestType': 'STATS',
'requestedAttributeTypes': ['KEYWORD_TEXT', 
'CATEGORY_PRODUCTS_AND_SERVICES']}

# Network search parameter (optional)
selector['searchParameters'].append({
'xsi_type': 'NetworkSearchParameter',
'networkSetting': {
'targetGoogleSearch': True,
'targetSearchNetwork': False,
'targetContentNetwork': False,
'targetPartnerSearchNetwork': False
}
})

# Language setting (optional).
selector['searchParameters'].append({
# The ID can be found in the documentation:
# https://developers.google.com/adwords/api/docs/appendix/languagecodes
'xsi_type': 'LanguageSearchParameter',
'languages': [{'id': '1002'}]
})

page = targeting_idea_service.get(selector)

for result in page['entries']:
    attributes = {}
    for attribute in result['data']:
        attributes[attribute['key']] = getattr(
            attribute['value'], 'value', '0')

Thank you so much in advance!

Cheers


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8bfe08ed-792a-4466-91fe-bb01f9a70e06n%40googlegroups.com.

Reply via email to