'''SELECT segments.geo_target_region, metrics.clicks, metrics.cost_microsFROM geographic_viewWHERE customer.id = XXXXXXXXXXX AND geographic_view.country_geo_target_constant = 'geoTargetConstants/2840' AND geographic_view.location_type = 'LOCATION_OF_PRESENCE' AND segments.week = '2019-04-15'ORDER BY metrics.clicks DESCLIMIT 100'''
'''SELECT metrics.clicks, metrics.cost_microsFROM geographic_viewWHERE customer.id = XXXXXXXXXX AND geographic_view.country_geo_target_constant = 'geoTargetConstants/2840' AND geographic_view.location_type = 'LOCATION_OF_PRESENCE' AND segments.week = '2019-04-15'ORDER BY metrics.clicks DESCLIMIT 100'''
'''SELECT metrics.clicks, metrics.cost_microsFROM geographic_viewWHERE customer.id = XXXXX AND geographic_view.country_geo_target_constant = 'geoTargetConstants/2840' AND geographic_view.location_type = 'LOCATION_OF_PRESENCE' AND segments.date = '2019-04-15'ORDER BY metrics.clicks DESCLIMIT 100'''
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.
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/08697597-a5b9-40e0-8df5-78a6e56a02b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def geo_costs(client, customer_id): ga_service = client.get_service('GoogleAdsService', version='v1') query = ('''SELECT
segments.geo_target_region, metrics.clicks, metrics.cost_microsFROM geographic_viewWHERE
customer.id = XXXXXXXXXXXX
AND geographic_view.country_geo_target_constant = 'geoTargetConstants/2840' AND geographic_view.location_type = 'LOCATION_OF_PRESENCE' AND segments.date = '2019-04-15'ORDER BY metrics.clicks DESCLIMIT
100''') response = ga_service.search(customer_id, query) for row in response: print(row.geographic_view.resource_name,",",row.metrics.clicks.value,"," , row.metrics.cost_micros.value)
geo_costs(client,'client_id')
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.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/b98167a2-4c5d-4bb2-a22f-7797e7cec5a0%40googlegroups.com.
_DEFAULT_PAGE_SIZE = 1000
def geo_costs(client, customer_id): ga_service = client.get_service('GoogleAdsService', version='v1') query = ('''SELECT segments.geo_target_region
AND geographic_view.country_geo_target_constant = 'geoTargetConstants/2840' AND geographic_view.location_type = 'LOCATION_OF_PRESENCE'
LIMIT 100''') response = ga_service.search(customer_id, query) for row in response:
print(row.segments.geo_target_region.resource_name)
geo_costs(client,customer_id)
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/5189431d-f0a9-4c76-a5d1-b9bbab47ce89%40googlegroups.com.