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

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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/da2e2d5c-f557-4acb-b21d-04923fde793f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Geo Per... Pranay
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... Pranay
        • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to