Hi,
Thank you for reaching out to the Google Ads API support team.
After verifying your account '6429714750' for the Campaign level data and Search term view level data. I couldn't observe any discrepancy and the Google Ads API is returning the same values as the UI. As you are trying to compare the campaign level data with Search term view level data which are different resources. So that is the reason you are seeing the difference in metric level data.
I have observed that you are comparing the metric data in the wrong way. Note that you should not compare metrics of the two different resources as they serve for different purposes. As the
Campaign and
Search term view are distinct and serve different purposes in the API. As the campaign resource provides the campaign level metrics data and the search term view with metrics aggregated by search term at the ad group level.
For example:
- I have executed the query for the campaign '22045300920' and observed the results below which are the same as in the UI:
"query":"SELECT campaign.id, metrics.clicks, metrics.cost_micros, segments.date FROM campaign WHERE segments.date = '"'"'2024-12-28'"'"' AND campaign.id = 22045300920"
- I have executed for Search term view also and observed the results same as in the UI:
"query":"SELECT campaign.id, segments.date, metrics.clicks, metrics.cost_micros FROM search_term_view WHERE segments.date = '"'"'2024-12-28'"'"' AND campaign.id = 22045300920","summaryRowSetting":"SUMMARY_ROW_ONLY"
I hope this helps.