Questions about campaign and user_location_view !!!

92 views
Skip to first unread message

余小七七

unread,
Jan 7, 2025, 3:43:19 AM1/7/25
to Google Ads API and AdWords API Forum
Hello,
I encountered a problem when pulling metrics.cost_micros.
When I used the campaign view to pull data, the returned metrics.cost_micros value was 494881490, but when I used user_location_view to pull metrics.cost_micros, the aggregated data was 509038341.
But from the background statistics, the metrics.cost_micros values ​​pulled back by campaign are relatively close.
20250107-163750.jpg
The following is my curl and the result;
campaign:  
{
  "query": " SELECT campaign.id, campaign.name, campaign.campaign_budget,campaign.target_spend.target_spend_micros,segments.date,metrics.cost_micros , metrics.average_cpc, metrics.average_cpm, metrics.impressions, metrics.clicks, metrics.ctr, customer.currency_code, metrics.video_quartile_p25_rate, metrics.video_quartile_p50_rate, metrics.video_quartile_p75_rate, metrics.video_quartile_p100_rate, metrics.video_view_rate, metrics.engagements, metrics.engagement_rate,campaign_budget.amount_micros FROM campaign  where segments.date ='2025-01-06'  and  campaign.id='220****'   "
}
20250107-162847.jpg
user_location_view:
{
  "query": " SELECT campaign.id, campaign.name, campaign.campaign_budget, campaign.target_spend.target_spend_micros, segments.date, metrics.cost_micros, metrics.average_cpc, metrics.average_cpm, metrics.impressions, metrics.clicks, metrics.ctr, customer.currency_code, metrics.video_view_rate, metrics.video_views, campaign.resource_name, campaign.campaign_group   , user_location_view.country_criterion_id,segments.ad_network_type FROM user_location_view WHERE segments.date = '2025-01-06' and  metrics.cost_micros!=0    and  campaign.id='220****'   "
}
I really want to know which view to use if I pull data by the country-campaign-date dimension.

Google Ads API Forum Advisor

unread,
Jan 7, 2025, 5:57:23 AM1/7/25
to yuqi2...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Kindly note that the campaign and user_location_view reports are distinct and serve different purposes in the API. Therefore, they should not be compared when retrieving data from the API. For determining discrepancy you should compare it from the Google Ads UI to the Google Ads API. Also, to fetch a country-campaign-date dimension, you can use the user_location_view or geographic_view report. 

From the logs, it appears that you are still using v16. Please be informed that the 'v16' is deprecated on February 21, 2024, and will be sunset by February 5, 2025. So, I would suggest you upgrade to the latest version (v18) as soon as possible to benefit from new features. You may refer to this documentation on deprecation and sunset for more information regarding the specific depreciation and sunset dates for each available version.

In order to analyze the issue further, please share the following details:
  • customer ID / client customer id
  • uncropped screenshot of the Google Ads UI by highlighting the cost field
  • latest complete API logs (request and response with request-id and request header) generated at your end. If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.
You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGrgH:ref" (ADR-00280694)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Reply all
Reply to author
Forward
0 new messages