Okay, I have come up with a python script to interact with the LocationCriterionService, which has helped me learn more about the API, but am still having the issue with the locations returned from the API not being vaild
If this helps anyone, the code I am using is:
def find_names(client):
location_criterion_service = client.GetService(
'LocationCriterionService', version='v201806')
selector = {
'fields': ['Id', 'LocationName'],
'predicates': [{
'field': 'Id',
'operator': 'EQUALS',
'values': 21179
}]
}
return location_criterion_service.get(selector)
client = adwords.AdWordsClient.LoadFromStorage()
find_names(client)
this returns
[{
'location': {
'id': 21179,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'Vermont',
'displayType': 'State',
'targetingStatus': 'ACTIVE',
'parentLocations': [
{
'id': 2840,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'United States',
'displayType': 'Country',
'targetingStatus': 'ACTIVE',
'parentLocations': []
}
]
},
'canonicalName': 'Vermont,United States',
'reach': 725000,
'locale': None,
'searchTerm': None,
'countryCode': None
}]
for a known location, as expected, but just an empty list for some of these longer locations Ids that I have been seeing
Any help on this matter would be appreciated.
Mathew