Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/be0dc88c-78fb-4b38-b123-3111d141acfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
Hi Luis,Thanks for your response.It's the other way around, we have a bunch of metro criteria ids for which we need metro names.We had the similar situation for country,city ..we had criteria ids and we mapped those criteria ids in the geotargets.csv file (https://developers.google.com/adwords/api/docs/appendix/geotargeting ) which was their in API docs and got the country and city names.I cannot find metro ids in that csv, so looking for similar kind of csv where I can load that into a lookup table and handle lookups at my end, as we have hundreds of metro ids.Let me know, if you need any further info.Thanks,Pranay
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1ajo44o0000000000fpr8o000lcoq0y6kmjidpg70o30c1g68qjad1g%40mail.gmail.com.
Hi Luis,
Below are few things, I tried and their results:
1) Tried with minimum set of metro ids in the Predicate.
a. For most of them, result was empty. Below are few Ids
location_names_metro = ['200517', '200535','200679','200501','200574','200534','200722','200635','200508','200570','200770','200757','200538','200514','200771','200754','200626','200765','200801']
b. Got result for only few, ex: '200635',’200801’.
Response:
[{
'location': {
'id': 9062537,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'Rochor',
'displayType': 'Neighborhood',
'targetingStatus': 'ACTIVE',
'parentLocations': [
{
'id': 2702,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'Singapore',
'displayType': 'Country',
'targetingStatus': 'ACTIVE',
'parentLocations': []
}
]
},
'canonicalName': 'Rochor,Singapore',
'reach': 804000,
'locale': None,
'searchTerm': '200635',
'countryCode': None
}, {
'location': {
'id': 1001655,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'Rio de Janeiro',
'displayType': 'City',
'targetingStatus': 'ACTIVE',
'parentLocations': [
{
'id': 20102,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'State of Rio de Janeiro',
'displayType': 'State',
'targetingStatus': 'ACTIVE',
'parentLocations': []
},
{
'id': 2076,
'type': None,
'Criterion.Type': 'Location',
'locationName': 'Brazil',
'displayType': 'Country',
'targetingStatus': 'ACTIVE',
'parentLocations': []
}
]
},
'canonicalName': 'Rio de Janeiro,State of Rio de Janeiro,Brazil',
'reach': 24700000,
'locale': None,
'searchTerm': '200801',
'countryCode': None
}]
The search term "200635" returned the location "Rochor" of type "Neighborhood" with parent locations "Singapore (Country)", reach "804000" and id "9062537" (ACTIVE)
The search term "200801" returned the location "Rio de Janeiro" of type "City" with parent locations "State of Rio de Janeiro (State), Brazil (Country)", reach "24700000" and id "1001655" (ACTIVE)
Code:
def main(client):
# Initialize appropriate service.
location_criterion_service = client.GetService(
'LocationCriterionService', version='v201809')
location_names_metro = ['200517', '200535','200679','200501','200574','200534','200722','200635','200508','200570',
'200770','200757','200538','200514','200771','200754','200626','200765','200801']
# Create the selector.
selector = {
'fields': ['Id', 'LocationName', 'DisplayType', 'CanonicalName',
'ParentLocations', 'Reach', 'TargetingStatus'],
'predicates': [{
'field': 'LocationName',
'operator': 'IN',
'values': location_names_metro
}, {
'field': 'Locale',
'operator': 'EQUALS',
'values': ['en']
}]
}
# Make the get request.
location_criteria = location_criterion_service.get(selector)
2) Cant test for all Metro IDs at once, due to error: googleads.errors.GoogleAdsServerFault: [SizeLimitError.REQUEST_SIZE_LIMIT_EXCEEDED @ locationName; trigger:'25']
Web report vs API report:
Considering only few records for comparison.
Below are the values returned from the UI/Web report
|
Region (User location) |
Metro area (User location) |
City (User location) |
|
New Jersey |
New York NY |
Manasquan |
|
New York |
New York NY |
New York |
|
New York |
New York NY |
Farmingville |
Values returned by API:
|
Region |
Metro area |
City |
|
21164 |
200501 |
1022240 |
|
21167 |
200501 |
1023191 |
|
21167 |
200501 |
1022909 |
I was able to map Region and City Ids in the geotargets csv. (as mentioned in previous question)
|
Region |
Region_name |
Metro |
Metro_name |
City |
City_name |
|
21164 |
New Jersey |
200501 |
|
1022240 |
Manasquan |
|
21167 |
New York |
200501 |
|
1023191 |
New York |
|
21167 |
New York |
200501 |
|
1022909 |
Farmingville |
Can you please suggest, if there is any other better way to get Metro Names which are same as the ones shown in the UI/Web report?
If this is a limitation, I will try to use the metro codes as is.
Thanks,
Pranay
'operator': 'EQUALS','values': ['en'] }] }# Make the get request.location_criteria = location_criterion_service.get(selector)

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/