Why the Google Ads API doesn't provide data for countries shown in the UI?

207 views
Skip to first unread message

Chad Wood

unread,
Apr 28, 2023, 2:16:52 PM4/28/23
to Google Ads API and AdWords API Forum
Hello,

When reviewing reports in the UI, I can get our performance as it pertains to each country.
See below, I have data coming from Albania.
2023-04-28 11_06_42-.png

Now see, I try querying the same info using the Google Ads API
```
SELECT
  geographic_view.country_criterion_id,
  metrics.cost_micros,
  metrics.impressions,
  metrics.clicks,
  metrics.ctr,
  metrics.average_cpm,
  metrics.average_cpc,
  campaign.status,
  segments.date
FROM geographic_view
WHERE
  segments.date BETWEEN '2022-01-01' AND '2023-04-28'
  AND campaign.status IN ('ENABLED', 'PAUSED')
  AND geographic_view.location_type = 'LOCATION_OF_PRESENCE'
```

With this, I craft a request to get the actual country names.
My resulting data does not have anything for Albania and several other countries.

So I'm not sure what is wrong. Here is how I get the country names:
```
SELECT
  geo_target_constant.id,
  geo_target_constant.name,
FROM geo_target_constant
WHERE
  geo_target_constant.resource_name IN ('geoTargetConstants/2031', 'geoTargetConstants/2032', 'geoTargetConstants/2036', 'geoTargetConstants/2040', 'geoTargetConstants/2044', 'geoTargetConstants/2048', 'geoTargetConstants/2050', 'geoTargetConstants/2051', 'geoTargetConstants/2052', 'geoTargetConstants/2056', 'geoTargetConstants/2070', 'geoTargetConstants/2072', 'geoTargetConstants/2076', 'geoTargetConstants/2090', 'geoTargetConstants/2092', 'geoTargetConstants/2100', 'geoTargetConstants/2124', 'geoTargetConstants/2136', 'geoTargetConstants/2152', 'geoTargetConstants/2184', 'geoTargetConstants/2191', 'geoTargetConstants/2196', 'geoTargetConstants/2203', 'geoTargetConstants/2208', 'geoTargetConstants/2212', 'geoTargetConstants/2233', 'geoTargetConstants/2242', 'geoTargetConstants/2246', 'geoTargetConstants/2250', 'geoTargetConstants/2258', 'geoTargetConstants/2268', 'geoTargetConstants/2276', 'geoTargetConstants/2288', 'geoTargetConstants/2300', 'geoTargetConstants/2308', 'geoTargetConstants/2344', 'geoTargetConstants/2348', 'geoTargetConstants/2352', 'geoTargetConstants/2356', 'geoTargetConstants/2360', 'geoTargetConstants/2372', 'geoTargetConstants/2376', 'geoTargetConstants/2380', 'geoTargetConstants/2388', 'geoTargetConstants/2392', 'geoTargetConstants/2400', 'geoTargetConstants/2404', 'geoTargetConstants/2410', 'geoTargetConstants/2414', 'geoTargetConstants/2422', 'geoTargetConstants/2428', 'geoTargetConstants/2440', 'geoTargetConstants/2442', 'geoTargetConstants/2450', 'geoTargetConstants/2458', 'geoTargetConstants/2484', 'geoTargetConstants/2492', 'geoTargetConstants/2498', 'geoTargetConstants/2499', 'geoTargetConstants/2504', 'geoTargetConstants/2512', 'geoTargetConstants/2516', 'geoTargetConstants/2528', 'geoTargetConstants/2531', 'geoTargetConstants/2533', 'geoTargetConstants/2540', 'geoTargetConstants/2554', 'geoTargetConstants/2566', 'geoTargetConstants/2578', 'geoTargetConstants/2586', 'geoTargetConstants/2604', 'geoTargetConstants/2608', 'geoTargetConstants/2616', 'geoTargetConstants/2620', 'geoTargetConstants/2630', 'geoTargetConstants/2634', 'geoTargetConstants/2642', 'geoTargetConstants/2662', 'geoTargetConstants/2682', 'geoTargetConstants/2688', 'geoTargetConstants/2702', 'geoTargetConstants/2703', 'geoTargetConstants/2704', 'geoTargetConstants/2705', 'geoTargetConstants/2710', 'geoTargetConstants/2724', 'geoTargetConstants/2752', 'geoTargetConstants/2756', 'geoTargetConstants/2764', 'geoTargetConstants/2776', 'geoTargetConstants/2784', 'geoTargetConstants/2792', 'geoTargetConstants/2796', 'geoTargetConstants/2800', 'geoTargetConstants/2804', 'geoTargetConstants/2807', 'geoTargetConstants/2826', 'geoTargetConstants/2833', 'geoTargetConstants/2840', 'geoTargetConstants/2850', 'geoTargetConstants/2882', 'geoTargetConstants/2887', 'geoTargetConstants/2900')
```

Google Ads API Forum Advisor

unread,
May 2, 2023, 2:17:47 AM5/2/23
to chadwo...@gmail.com, adwor...@googlegroups.com
Hi Chad,

Thank you for raising this concern to the Google Ads API support team.

Kindly note that Google Ads API mirrors the Google Ads UI. Meaning the data available in the Google Ads UI should be retrieved or managed via the Google Ads API. That being said, can you please provide the uncropped screenshot of the Google Ads UI showing the data that you want to retrieve via the Google Ads API and the complete logs below for investigation:
You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2l8Jzs:ref

Chad Wood

unread,
May 4, 2023, 11:06:41 AM5/4/23
to Google Ads API and AdWords API Forum
I'll compile this info and send it. How again do I enable logging with the Python library?

For any future comers, I found a workaround by creating the report in the Google Ads Report Editor interface and scheduling that report to get emailed to me in .csv format in the timing interval I need. I think connect to the email server through IMAP protocol and locate the correct email by subject and date. Following, I locate a download link in the email and send a request to that link. The response is the encoded UI data, and I just decode it from there for use in the ETL pipeline.

Google Ads API Forum Advisor

unread,
May 4, 2023, 5:25:21 PM5/4/23
to chadwo...@gmail.com, adwor...@googlegroups.com

Hi Chad,

Thanks for getting back with us.

Thank you for sharing your insights on this. Moreover, for enabling logs in Python, logging can be enabled by navigating to the Client libraries > Your client library (ex. Python) > Logging documentation, which you can access from the link below. For REST interface requests, you can enable logging via the curl command by using the -i flag. This will cause the tool to include the HTTP response headers in the output.

Links included in this email:

Reply all
Reply to author
Forward
0 new messages