Geo Performance Report - Geo Target - Metro Codes Names mapping CSV ?

822 views
Skip to first unread message

Pranay

unread,
Mar 6, 2019, 5:11:51 PM3/6/19
to AdWords API and Google Ads API Forum

Hi , 

Is there a way to get the Metro codes vs Readable Metro Names mapping CSV just like the one we have at https://developers.google.com/adwords/api/docs/appendix/geotargeting

Downloaded report from UI shows Metro Names like - "Charlotte NC", "Des Moines-Ames IA", "Indianapolis IN" but the report extracted using API gives me codes "200517", "200535","200679"

Can any one please let me know, if there is any other way?

Thanks,
Pranay

googleadsapi...@google.com

unread,
Mar 6, 2019, 10:00:58 PM3/6/19
to AdWords API and Google Ads API Forum
Hi,

Could you confirm if what your're looking is to get the criteria ID based on the Metro Names that you retrieved from UI reports? If so, you may use the LocationCriterionService to retrieve the criterion id of those location base on locaitonName.

Let me know if this is what you're looking for.

Thanks and regards,
Luis
AdWords API Team


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.

Take Survey

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.

googleadsapi...@google.com

unread,
Mar 7, 2019, 12:00:47 AM3/7/19
to AdWords API and Google Ads API Forum
Hi Pranay,

Thank you for the confirmation. You could still use the LocationCriterionService in this case. Then, you could get the locationName by filtering the result by setting the id field based on those metro IDs that you want to look up to.

Let me know if it works.

Regards,
Luis
AdWords API Team


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.

Take Survey

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

On 03/07/19 11:51:08 appani...@gmail.com wrote:
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


Pranay

unread,
Mar 7, 2019, 12:56:56 PM3/7/19
to AdWords API and Google Ads API Forum

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

googleadsapi...@google.com

unread,
Mar 8, 2019, 3:01:32 AM3/8/19
to adwor...@googlegroups.com
Hi Pranay,

Before proceeding further with the investigation, could you provide to me your clientCustomerId and the complete screenshot of where you downloaded the report from the Google Ads UI?

Thanks and regards,
Peter
AdWords API Team

'operator': 'EQUALS','values': ['en']        }]    }# Make the get request.location_criteria = location_criterion_service.get(selector)            





Pranay

unread,
Mar 8, 2019, 10:10:19 AM3/8/19
to AdWords API and Google Ads API Forum
Hi Peter,

Here is the clientcustomerID: 6528378274. Please let me know, if you need any further info. 

GAds_UI_ReportScreenshot1.png

 


Thanks,
Pranay

googleadsapi...@google.com

unread,
Mar 10, 2019, 10:15:06 PM3/10/19
to AdWords API and Google Ads API Forum
Hi Pranay,

Thank you for providing additional information. However, upon double checking your code implementation, I noticed that the predicate you used to filter your result was the locationName instead of the id field. Could you try to change your predicate to id field then let me know if it works?

Regards,
Luis
AdWords API Team


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.

Take Survey

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

Reply all
Reply to author
Forward
0 new messages