Query campaigns and metrics, segmented by the Geographic location

257 views
Skip to first unread message

Karam Bowidany

unread,
Apr 8, 2019, 9:12:54 AM4/8/19
to AdWords API and Google Ads API Forum
Hello Google Ads API Forum:

I using the the new Google Ads API  to get some reports from our GoogleAds account (using PHP library v1.1)

I need to write a query get metrics of our campaigns, segmented by the Geographic location (not the Targeted location) from GoogleAds in a certain day or period

campaign.id

metrics.clicks, metrics.impressions

geo_location id

 

 

 

 

 

 

 


Something similar to this tab

geographic.png



(Even if the targeted locations are not set)

targeted.png





  • I was able to get the metrics of the targeted location using the following query

    SELECT
         campaign
    .id,
         campaign
    .name,
         location_view
    .resource_name,
         metrics
    .clicks,
         metrics
    .cost_micros
    FROM
        location_view
    WHERE
    segments
    .date DURING LAST_7_DAYS

    but I need the geographic report not the targeted locations

  • I tried to query on geographic_view instead of location_view, but I couldn't get what I want
  • I tried a little with campaign_criterion, without fine results


Waiting for your kind answers

Best regards

googleadsapi...@google.com

unread,
Apr 8, 2019, 2:33:20 PM4/8/19
to en.kar...@gmail.com, AdWords API and Google Ads API Forum
Hello Karam, 

Could you please elaborate on what you're trying to achieve along with the report query?

Thanks,
Bharani, Google Ads API Team

Karam Bowidany

unread,
Apr 9, 2019, 6:06:19 PM4/9/19
to AdWords API and Google Ads API Forum
All what I want to achieve is

How much did we spend on each country in each campaign at a certain day

(according to the geographic location of the users, not the targeted locations of the campaigns)
(of course I need all the metrics, not only the cost)


thanks in advanced

googleadsapi...@google.com

unread,
Apr 10, 2019, 11:51:53 AM4/10/19
to en.kar...@gmail.com, AdWords API and Google Ads API Forum
Hello Karam, 

You will be able to use the report query as below to pull the metrics data.

"SELECT geographic_view.country_geo_target_constant, metrics.all_conversions, metrics.clicks, metrics.ctr, campaign FROM geographic_view"

Let me know if you have any other questions. 

Regards,

Karam Bowidany

unread,
Apr 16, 2019, 7:05:04 PM4/16/19
to AdWords API and Google Ads API Forum
Thank you for your kind response

Unfortunately it didn't work as expected, There is some thing strange with the geographic_view query you gave me

executing this query
SELECT geographic_view.country_geo_target_constant, metrics.all_conversions, metrics.clicks, metrics.ctr, campaign.id, campaign.name  FROM geographic_view
only returned 13 rows, while it should return thousands (of course it's not a case of pagination, I'm sure)

it excludes the campaigns having type Universal App, it only returns the rows that relates to (Video / Search Only/ Search Network with Display Select) campagins



on the other hand, executing this query
SELECT location_view.resource_name, metrics.all_conversions, metrics.clicks, metrics.ctr, campaign.id, campaign.name  FROM location_view

works well, and does actually return thousands of rows, (IE. it includes all the campaigns, no exclusion)


Waiting for your kind response
Best regards

googleadsapi...@google.com

unread,
Apr 17, 2019, 10:07:59 AM4/17/19
to en.kar...@gmail.com, AdWords API and Google Ads API Forum
Hello Karam, 

Thank you for the details. Universal App campaigns does not support geograhic_view report type. Please check this guide for the supported report types for Universal App Campaigns. If you're still noticing the discrepancy for other campaign types, please share the report query along with the CID using the reply privately to author option.

Karam Bowidany

unread,
Apr 18, 2019, 4:08:10 PM4/18/19
to AdWords API and Google Ads API Forum
Thanks again:

I've checked the guide but still have some questions

  1. will it be supported in the near future? since I can see the geographic report of Universal Apps in the GoogleAds dashboard, I've sent it to you privately along the the CustomerId
  2. isn't there any other way (other than querying on geographic_view) to get the geographic report of the campaigns using GoogleAds api?
  3. if it is not supported to get the geographic reports of all campaigns together,  is there is a way to get the geographic report of a certain campaign alone? it also works for me

Thanks for your patience,

googleadsapi...@google.com

unread,
Apr 18, 2019, 4:35:02 PM4/18/19
to en.kar...@gmail.com, AdWords API and Google Ads API Forum
Hi Karam,

I've responded to your private reply.

1. will it be supported in the near future? since I can see the geographic report of Universal Apps in the GoogleAds dashboard, I've sent it to you privately along the the CustomerId 
We cannot say whether this will be supported in the future. Please follow our blog for updates.

2. isn't there any other way (other than querying on geographic_view) to get the geographic report of the campaigns using GoogleAds api?
There is no other way to get this data currently in Google Ads API. 

3. if it is not supported to get the geographic reports of all campaigns together,  is there is a way to get the geographic report of a certain campaign alone? it also works for me
You can a filter to your report such as WHERE campaign.id = 12345.

Regards,
Anthony
Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_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/4d3dfbb4-817d-4fbd-86e7-6a3e32b91744%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages