Hi Steve,

You're absolutely correct - using the CSV file 
<https://developers.google.com/adwords/api/docs/appendix/geotargeting> is 
the best way to go. I would expect all valid zip codes to be in that list, 
however. If you have examples of missing zip codes, could you send them 
over?

Thanks,
Josh, AdWords API Team

On Friday, October 3, 2014 8:08:41 PM UTC-4, Steve Renaker wrote:
>
> It looks like the solution here is to download the entire ID data file and 
> do the ID lookups locally. But I've noticed something with the datafile -- 
> not all U.S. zip codes are listed there. Only about 80% of all U.S. zip 
> codes have a Criteria ID. Is there a reason for that?
>
> Thanks, 
>
> - Steve
>
> On Friday, October 3, 2014 2:39:38 PM UTC-7, Steve Renaker wrote:
>>
>> I have a long list of geographical locations which I would like to add to 
>> a campaign.  I would like to read from a list of zip codes, look up the 
>> criteria ID for each one, and add them all to a campaign. The bit of python 
>> code which does the ID lookup looks like this:
>>
>> def find_ids(client):
>>   location_criterion_service = client.GetService(
>>       'LocationCriterionService', version='v201402')
>>   
>>   with open('zip_codes.txt') as temp_file:
>>     location_names = [line.rstrip('\n') for line in temp_file]
>>
>>   selector = {
>>       'fields': ['Id', 'LocationName'],
>>       'predicates': [{
>>           'field': 'LocationName',
>>           'operator': 'IN',
>>           'values': location_names
>>       }, {
>>           'field': 'Locale',
>>           'operator': 'EQUALS',
>>           'values': ['en']
>>       }]
>>   }
>>
>>   location_criteria = location_criterion_service.get(selector)
>>
>> It works as long as the list of zip codes is no longer than 25. Any 
>> longer and it throws an error: 
>>
>> SizeLimitError.REQUEST_SIZE_LIMIT_EXCEEDED @ locationName; trigger:'25'
>>
>> Is there a better way to do this, or do I need to set up a batching loop? 
>>
>> Thanks very much for any help.
>>
>> - Steve Renaker
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/36832a8f-1b48-4688-a5dc-067c73450bed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to