Different Responses from Google Ads Endpoints

156 views
Skip to first unread message

Carlie McLaughlin

unread,
Jun 26, 2024, 10:19:53 AMJun 26
to Google Ads API and AdWords API Forum
When calling the Google Ads API endpoint for the geography ad group breakdown, the response is different from what we get when we call the campaign non breakdown endpoint and also what we see in the Google Ads tool.

API Call for Geography Ad Group Breakdown: 
curl --location 'https://googleads.googleapis.com/v15/customers/2574544911/googleAds:search' \ --header 'Authorization: Bearer [token]' \ --header 'Developer-Token: [developer_token]' \ --header 'login-customer-id: [id]' \ --header 'Content-Type: application/json' \ --data '{"query":"SELECT segments.date, http://campaign.id , campaign.name, ad_group.id, ad_group.name, metrics.all_conversions, metrics.all_conversions_value, metrics.clicks, metrics.conversions, metrics.conversions_value, metrics.cost_micros, metrics.cross_device_conversions, metrics.impressions, metrics.video_views, metrics.interaction_event_types, metrics.interactions, metrics.view_through_conversions, segments.geo_target_city, segments.geo_target_metro, segments.geo_target_region, segments.geo_target_county, segments.geo_target_most_specific_location, geographic_view.location_type FROM geographic_view WHERE segments.date between '\''2024-06-05'\'' and '\''2024-06-05'\'' and metrics.clicks != '\''0'\''","pageSize":"4000"}
In the Google Ads tool, we see that total clicks returns 86 clicks. But in the above API call for ad group geo breakdown, we get 82 clicks. Data seems to be missing. I've also attached the json results from the above query and a screenshot of the Google Ads tool.
Screenshot 2024-06-26 at 10.19.22 AM.png
google_ads_geo_data.json

Google Ads API Forum Advisor

unread,
Jul 1, 2024, 2:43:08 PMJul 1
to car...@unified.com, adwor...@googlegroups.com

Hi,

If you want to compare the API data with respect to the provided UI screenshot, you can refer to the below query to get the exact number of clicks.

SELECT campaign.id, campaign.name, ad_group.id, ad_group.name, metrics.all_conversions,
 metrics.all_conversions_value, metrics.clicks, metrics.conversions, metrics.conversions_value,
 metrics.cost_micros, metrics.cross_device_conversions, metrics.impressions, metrics.video_views,
 metrics.interaction_event_types, metrics.interactions, metrics.view_through_conversions, segments.date 
FROM ad_group WHERE segments.date BETWEEN '2024-06-05' and '2024-06-05' AND metrics.clicks != '0'

I hope it helps. Kindly get back to us if you have any further issues or concerns related to the Google Ads API.



ref:!00D1U01174p.!5004Q02tJTqh:ref

Google Ads API Forum Advisor

unread,
Jul 1, 2024, 2:44:38 PMJul 1
to car...@unified.com, adwor...@googlegroups.com

Hi,

Please ignore my previous email.

This message is in relation to case "ref:!00D1U01174p.!5004Q02tJTqh:ref" (ADR-00244034)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Carlie McLaughlin

unread,
Jul 2, 2024, 9:32:51 AMJul 2
to Google Ads API and AdWords API Forum
Hello! So should we not use the info you posted in the first reply? Are there any further updates? 

Google Ads API Forum Advisor

unread,
Jul 2, 2024, 2:57:58 PMJul 2
to car...@unified.com, adwor...@googlegroups.com

Hi,

No, you can refer to that response and query in order to get the clicks as per the screenshot provided by you. However, for better visibility, I am adding the same query again below for your reference.

, metrics.all_conversions,
 metrics.all_conversions_value, metrics.clicks, metrics.conversions, metrics.conversions_value,
 metrics.cost_micros, metrics.cross_device_conversions, metrics.impressions, 
 metrics.video_views,metrics.interaction_event_types, metrics.interactions,
 metrics.view_through_conversions, segments.date 
FROM ad_group WHERE segments.date BETWEEN '2024-06-05' and '2024-06-05' AND metrics.clicks != '0'

Carlie McLaughlin

unread,
Jul 3, 2024, 9:34:44 AMJul 3
to Google Ads API and AdWords API Forum
Hi!

This doesn't really answer our question. 

We have 2 endpoints that return different total impression totals.


This is a 1 endpoint (breakdown):

SELECT campaign.id, campaign.name, ad_group.id, ad_group.name, metrics.all_conversions, metrics.all_conversions_value, metrics.clicks, metrics.conversions, metrics.conversions_value, metrics.cost_micros, metrics.cross_device_conversions, metrics.impressions, metrics.video_views,metrics.interaction_event_types, metrics.interactions, metrics.view_through_conversions, segments.date FROM ad_group WHERE segments.date BETWEEN '2024-06-05' and '2024-06-05' AND metrics.clicks != '0'

This is a 1 endpoint (non breakdown)

SELECT segments.date, campaign.id, campaign.name, metrics.clicks, metrics.impressions FROM campaign WHERE segments.date between '2024-06-05' and '2024-06-05''

When you call the 2 different endpoints, they result in different impression numbers.

Google Ads API Forum Advisor

unread,
Jul 3, 2024, 2:46:58 PMJul 3
to car...@unified.com, adwor...@googlegroups.com
Hi,

The screenshot which you have provided corresponds to the ad_group resource not the geographic_view, so I would recommend to use the query which was provided by us and then match the metrics data from the Google Ads UI. While mapping the data from the Google Ads UI to the Google Ads API you should use the same resource.

Kindly note that we have executed both queries provided by you and observed the same impression value of '83300' without any discrepancies in the results. I recommend re-running both queries and then comparing the impressions from the ad_group and campaign resources in the Google Ads API. However, if you are still facing discrepancies, then kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end to better assist you further. 

Carlie McLaughlin

unread,
Jul 5, 2024, 8:27:48 AMJul 5
to Google Ads API and AdWords API Forum
See the requested info below:

Geo API: curl --location 'https://googleads.googleapis.com/v15/customers/2574544911/googleAds:search' \
--header 'Authorization: Bearer ya29.a0AXooCgt2pCQygzHmfuHwGC2C5FGzfHJzb3vTyPwtpOZ4wjwxpd_4HBdhUEPa22s4je3L90nqyfLpzuNzWOdb5MPQthT-oiu1xw7vUtOjk3QDHaFEkUAn5-93bw4oioJrn1XHxZ0TWGWMS6i8G0XNvBMgtB5lJ9Q2e5Btv40aCgYKAcESARESFQHGX2MigOwHdh7P90dqXIwt0rss4w0174' \
--header 'Developer-Token: wHW9zT2p9X3SKI8mhb7L9A' \
--header 'login-customer-id: 4742540146' \
--header 'Content-Type: application/json' \
--data '{"query":"SELECT segments.date, campaign.id , campaign.name, ad_group.id, ad_group.name, metrics.all_conversions, metrics.all_conversions_value, metrics.clicks, metrics.conversions, metrics.conversions_value, metrics.cost_micros, metrics.cross_device_conversions, metrics.impressions, metrics.video_views, metrics.interaction_event_types, metrics.interactions, metrics.view_through_conversions, segments.geo_target_city, segments.geo_target_metro, segments.geo_target_region, segments.geo_target_county, segments.geo_target_most_specific_location, geographic_view.location_type FROM geographic_view WHERE segments.date between '\''2024-06-05'\'' and '\''2024-06-05'\'' and metrics.clicks != '\''0'\''"
}'
Request ID: K4FfjuuC82b2k6PxYCZ_Ew
Developer-Token: wHW9zT2p9X3SKI8mhb7L9A
Customer ID: 4742540146

Daily APi: curl --location 'https://googleads.googleapis.com/v15/customers/2574544911/googleAds:search' \
--header 'Authorization: Bearer ya29.a0AXooCgt2pCQygzHmfuHwGC2C5FGzfHJzb3vTyPwtpOZ4wjwxpd_4HBdhUEPa22s4je3L90nqyfLpzuNzWOdb5MPQthT-oiu1xw7vUtOjk3QDHaFEkUAn5-93bw4oioJrn1XHxZ0TWGWMS6i8G0XNvBMgtB5lJ9Q2e5Btv40aCgYKAcESARESFQHGX2MigOwHdh7P90dqXIwt0rss4w0174' \
--header 'Developer-Token: wHW9zT2p9X3SKI8mhb7L9A' \
--header 'login-customer-id: 4742540146' \
--header 'Content-Type: application/json' \
--data '{"query":"SELECT segments.date, campaign.id, campaign.name, metrics.clicks, metrics.impressions FROM campaign WHERE segments.date between '\''2024-06-05'\'' and '\''2024-06-05'\''"
}'
Request ID: yEoPfcpTx9Un5qutP-2IFA
Developer-Token: wHW9zT2p9X3SKI8mhb7L9A
Customer ID: 4742540146

Google Ads API Forum Advisor

unread,
Jul 5, 2024, 2:52:40 PMJul 5
to car...@unified.com, adwor...@googlegroups.com

Hi,

Unfortunately, you missed adding the response data for both queries. So kindly get back to us with the response data also so that we can check the different impression numbers between both queries. 

Carlie McLaughlin

unread,
Jul 15, 2024, 10:21:06 AM (7 days ago) Jul 15
to Google Ads API and AdWords API Forum
Please see attached response data for both breakdown and non breakdown data

breakdown response (attached as json)

non-breakdown response: 
image-20240703-162744.png
google_ads_geo_data.json

Google Ads API Forum Advisor

unread,
Jul 15, 2024, 2:45:06 PM (7 days ago) Jul 15
to car...@unified.com, adwor...@googlegroups.com
Hi,

I would like to inform few things related to your query:

Firstly, if you want to get the 86 clicks from the screenshot that you have provided in our first conversation, I would recommend that you try the below query via API.

Query : "SELECT campaign.id, campaign.name, ad_group.id, ad_group.name, metrics.all_conversions,

 metrics.all_conversions_value, metrics.clicks, metrics.conversions, metrics.conversions_value,
 metrics.cost_micros, metrics.cross_device_conversions, metrics.impressions, metrics.video_views,
 metrics.interaction_event_types, metrics.interactions, metrics.view_through_conversions, segments.date 
FROM ad_group WHERE segments.date BETWEEN '2024-06-05' and '2024-06-05' AND metrics.clicks != '0'"

Later, you have mentioned 2 endpoints that return different total impression totals. Here, I could see that you have compared ad_group(breakdown) and campaign(non breakdown) resources. But then in next conversations, I noticed that you have again compared with geographic_view and campaign resources.

I would recommend that you use the ad_group resource to get the same clicks as in geographic_view. Let us know how it goes on your end.
Reply all
Reply to author
Forward
0 new messages