Google Ads API reporting user location and cost

197 views
Skip to first unread message

Bruno B. Correa

unread,
May 27, 2019, 2:25:44 AM5/27/19
to AdWords API and Google Ads API Forum

Hi everybody. 

I have been studying the new Ads API to extract campaign and clicks related data which i will use to create internal reports.

My main interest is to segment my query by a date range and retrieve information such as campaign, location of presence (user) and cost. 
Something similar to a User locations report that can be generated on the interface.

At first I had created the following query:

SELECT
    customer
.descriptive_name,
    campaign
.id,
    campaign
.name,
    segments
.geo_target_county,
    segments
.geo_target_city,
    segments
.date,
    segments
.device,
    customer
.currency_code,
    metrics
.clicks,
    metrics
.cost_micros,
    metrics
.impressions
FROM
    geographic_view
WHERE
    segments
.date
>= '2019-02-01'
    AND segments.date < '2019-03-01'
ORDER BY metrics.clicks DESC

I realized segments.geo_target_county does not represent user location. So, looking into the documentation I think i should usclick_view.location_of_presence.country instead and for this I created the new query.

SELECT
    customer.descriptive_name,
    campaign.id,
    campaign.name,
    click_view.location_of_presence.country,
    click_view.location_of_presence.city,
    segments.date,
    segments.device,
    customer.currency_code,
    metrics.clicks,
    metrics.cost_micros,
    metrics
.impressions
FROM
    click_view
WHERE
    segments.date >= '2019-02-01'
    AND segments.date < '2019-03-01'
ORDER BY metrics.clicks DESC

Here I found 2 problems:
  1. I cannot retrieve metrics.cost_micros and metrics.impressions from click_view. (most important one)
  2. The date range should not be older than 90 days and should be segmented by day.

Any ideas on how to solve or work around this?
A query for the ads API capable to retrieve the data from a 
User locations report  also would be very helpful.


Thanks for the help ;)

Google Ads API Forum Advisor Prod

unread,
May 27, 2019, 8:19:50 AM5/27/19
to adwor...@googlegroups.com
Hi Bruno,

Thank you for contacting support, you may refer below for my answers to your questions :

1. I cannot retrieve metrics.cost_micros and metrics.impressions from click_view. (most important one)

I'm afraid that these metrics are indeed not supported for in Click View. You may follow our blog for updates. 

2. The date range should not be older than 90 days and should be segmented by day.

This too has been the standard since the old API. In the old (click) report, the available duration can only be up to 90 days from the date of your (report) request and you may only specify a date range for a single day only.

Best regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UAqixl:ref
Reply all
Reply to author
Forward
0 new messages