Thanks for the info. I don't have adequate permissions to reply to author, so I'll send you what I can via this post. Shown below is the code I'm using to execute the request. The error message I get back is '429 Resource has been exhausted (e.g., check quota)'. I'm pretty certain the limit that's being exceeded is because of the call to get_geo_target_constant. If I run the code without this it works fine. I think what I'm trying to figure out is how to resolve resource names without a 'get' call. This applies to other items such as campaign_budget. Hope this helps. Thanks.
***************************************************************************************************************
from google.ads.google_ads.client import GoogleAdsClient
client = GoogleAdsClient.load_from_storage('/users/google-ads.yaml')
gas = client.get_service('GoogleAdsService', version='v5')
query = '''
SELECT
campaign.advertising_channel_type,
campaign.campaign_budget,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
segments.geo_target_metro,
segments.date
FROM geographic_view
WHERE
segments.date BETWEEN "2020-10-01" AND "2020-10-20"
LIMIT 1000'''
cid = <CUSTOMER ID>
resp = gas.search_stream(cid, query)
report = []
for batch in resp:
for row in batch.results:
cdate = row.segments.date
metro = gts.get_geo_target_constant(row.segments.geo_target_metro).name
impr = row.metrics.impressions
clicks = row.metrics.clicks
cost = row.metrics.cost_micros / 1000000
channel = row.campaign.advertising_channel_type
budget = row.campaign.campaign_budget
report.append([cdate, camp, metro, impr, clicks, cost, channel, budget])
***************************************************************************************************************