Hello,
The code I’m currently using to retrieve budget information is as follows:
async getCustomerAccountBudgets(customerId: string, refreshToken: string,
loginCustomerId: string) {
try {
const customer = await this.getCustomer(customerId,
refreshToken, loginCustomerId)
console.log('getCustomerAccountBudgets customer', customer)
// return customer
const results = await customer.report({
entity: 'account_budget',
attributes: [
"account_budget.id",
"account_budget.name",
"account_budget.status",
"account_budget.proposed_spending_limit_micros",
"account_budget.approved_spending_limit_micros",
"account_budget.adjusted_spending_limit_micros",
"account_budget.total_adjustments_micros",
"account_budget.amount_served_micros",
"account_budget.purchase_order_number",
"account_budget.notes",
"account_budget.approved_start_date_time",
"account_budget.approved_end_time_type",
"account_budget.approved_end_date_time",
"account_budget.proposed_start_date_time",
"account_budget.proposed_end_time_type",
"account_budget.proposed_end_date_time",
"account_budget.resource_name"
// "account_budget.start_date_time",
// "account_budget.start_time_type",
// "account_budget.end_date_time",
// "account_budget.end_time_type",
// "account_budget.approved_start_date_time",
// "account_budget.approved_end_date_time",
// "account_budget.id",
// "account_budget.name",
// "account_budget.billing_setup",
// "account_budget.status",
// "account_budget.amount_served_micros",
// "account_budget.proposed_spending_limit_micros"
],
metrics: [],
segments: [] // Google Ads의 metrics 필드와 segments 필드를 조합하면
광고 성과 데이터를 다양한 각도에서 분석할 수 있습니다. 예를 들어, 일별, 주별, 월별 광고 클릭 수, 노출 수, 전환 수 등을
분석하거나, 특정 장치(모바일, 데스크탑 등)나 위치별로 성과를 분석할 수 있습니다.
})
console.log('getCustomerAccountBudgets results', results)
/**
*
*/
return {
statusCode: 200, // statusCode,
data: results,
message: '',
accessToken: '',
refreshToken: refreshToken,
}
My understanding is that:
-
adjusted_spending_limit_micros represents the final approved budget
after adjustments (e.g., credits, modifications).
-
amount_served_micros represents the actual spend so far.
So, logically, the remaining budget (or balance) should be calculated as:
adjusted_spending_limit_micros - amount_served_micros
However, I’ve noticed that this calculated value does not match the
"available funds" shown in the Google Ads UI dashboard. Could you clarify
why this discrepancy exists? Is the UI applying any additional logic or
adjustments that are not exposed via the API?
2025년 4월 7일 월요일 오후 11시 43분 42초 UTC+9에 Google Ads API Forum Advisor님이 작성:
> Hi,
>
> Upon checking the provided information, I could see that you are getting a
> discrepancy in budget data retrieved between the Google Ads UI and the
> Google Ads API. We would like to specify first the following when comparing
> the value of the Google Ads UI and Google Ads API.
>
> - The segments and fields of the API and UI should be the same.
> - The date range should also be the same.
> - Comparing the API and UI at the same level as possible.
>
> Also, in order to investigate your issue further, kindly provide us with
> the complete API logs (request
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
> and response
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response>
> with request-id
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>
> and request header
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>)
>
> generated at your end along with the uncropped UI screenshot by
> highlighting the fields that you are trying to retrieve from the
> account_budget report via the Google Ads API.
>
> 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
> <https://developers.google.com/google-ads/api/docs/client-libs/java/logging>
> , .Net
> <https://developers.google.com/google-ads/api/docs/client-libs/dotnet/logging>
> , PHP
> <https://developers.google.com/google-ads/api/docs/client-libs/php/logging>
> , Python
> <https://developers.google.com/google-ads/api/docs/client-libs/python/logging>
> , Ruby
> <https://developers.google.com/google-ads/api/docs/client-libs/ruby/logging>
> or Perl
> <https://developers.google.com/google-ads/api/docs/client-libs/perl/logging>
> 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.
>
>
> Thanks,
>
> [image: Google Logo] Google Ads API Team
> Feedback
> How was our support today?
>
> [image: rating1]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=500Ht00001pRXnSIAW>
>
> [image: rating2]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=500Ht00001pRXnSIAW>
>
> [image: rating3]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=500Ht00001pRXnSIAW>
>
> [image: rating4]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=4&entry.295079254=500Ht00001pRXnSIAW>
>
> [image: rating5]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=5&entry.295079254=500Ht00001pRXnSIAW>
> [2025-04-07 14:42:46Z GMT] This message is in relation to case
> "ref:!00D1U01174p.!500Ht01pRXnS:ref" (ADR-00298815)
>
>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/adwords-api/7cd2fb21-3243-45c3-9924-b3b89f1c72aen%40googlegroups.com.