I'm having problems arming the selector to TargetingIdeaService. I need to make this selector using searchParameters and filter it by location, but I can't.
In another hand, I need to filter this location by COUNTRY, and I don't find the way to do this, so the location_criterion_service returns all locations types (cities, neighborhoods, countries)
selector = {
'fields': ['Id', 'LocationName', 'DisplayType', 'CanonicalName', 'ParentLocations', 'Reach', 'TargetingStatus'],
'predicates': [{'field': 'LocationName', 'operator': 'IN', 'values': 'South Africa'},
{'field': 'Locale', 'operator': 'EQUALS', 'values': 'en'}]}
location_criteria = location_criterion_service.get(selector)
targeting_idea_service = client.GetService('TargetingIdeaService', version='v201802')
offset = 0
selector = {'ideaType': 'KEYWORD', 'requestType': 'IDEAS',
'requestedAttributeTypes': ['KEYWORD_TEXT', 'SEARCH_VOLUME'],
'paging': {'startIndex': str(offset), 'numberResults': str(PAGE_SIZE)},
'searchParameters': [{'xsi_type': 'RelatedToQuerySearchParameter', 'queries': ['bla bla']},
{'xsi_type': 'LocationSearchParameter', 'locations': [
{'Criterion.type': 'LOCATION',
'locationName': location_criteria['Location']['parentLocations']['locationName']}]}]}