Hi - we need geographic data at the ad_group level from the geographic_view 
resource on a daily basis - the issue is that we hit error 429: resource 
exhausted when we run this for even 1 account

*my question is:* how can we get the geographic metrics by ad_group?

this is the code:

client = GoogleAdsClient.load_from_storage(CREDS_PATH)
ga_service = client.get_service('GoogleAdsService', version='v6')
gt_service = client.get_service('GeoTargetConstantService', version='v6')

*# this query returns about 8500 records*
geo_query = {
    "api_query": '''
        SELECT ad_group.id, customer.id, ad_group.campaign, ad_group.name, 
geographic_view.location_type, geographic_view.resource_name, 
segments.geo_target_city, segments.month
        FROM geographic_view      
        WHERE segments.date = '2020-03-19'
        ORDER BY customer.id '''
}

*# but when we try to run the geo_target_constant service we meet with 429 
error*
def get_batch_list(customer_id, query):
    response = ga_service.search_stream(str(customer_id), query)
    batch_list = []
    for batch in response:
        for row in batch.results:
            
*geotarget = gt_service.get_geo_target_constant(row.segments.geo_target_city)*
            batch_list.append(geotarget)
    return batch_list

get_batch_list('123456789', geo_query['api_query'])

thanks, frank

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/03f63d01-4e0a-4f5e-a632-7c03d1fadee1n%40googlegroups.com.

Reply via email to