How do I get customer cost metrics aggregated at the country level?

52 views
Skip to first unread message

jia Jimmy

unread,
Jun 19, 2020, 11:12:30 AM6/19/20
to AdWords API and Google Ads API Forum
I'm tried with `geographic_view` [geographic_view](https://developers.google.com/google-ads/api/fields/v3/geographic_view) to get acustomer's cost group by country.

As below query showed:


query = """
SELECT
customer.descriptive_name,
customer.id,
metrics.cost_micros,
geographic_view.country_criterion_id,
segments.geo_target_state
FROM
geographic_view
WHERE
segments.date BETWEEN '{}' AND '{}'

""".format("2020-06-01","2020-06-17")

Then I got multiple results with different `geoTargetConstants` which belonged to same country. After I group those by same country. I found there are some country costed not appeared with GAQL as I could find at my google manage backend.Also the sum cost with all these country  didn't meet the cost I  request singlely

query_cost_only = """
SELECT
customer.descriptive_name,
customer.id,
metrics.cost_micros
FROM
customer
WHERE
segments.date BETWEEN '{}' AND '{}'

""".format("2020-06-01","2020-06-17")


Can you give me some advice about these?

Thanks.











Reply all
Reply to author
Forward
0 new messages