How can I get active account_bugdet only?

124 views
Skip to first unread message

min jia

unread,
Oct 25, 2019, 2:56:49 AM10/25/19
to AdWords API and Google Ads API Forum
The only account_budget active in my google-ads management  backend is as below showed:

gg1024.png


gg1024.png



{
        "account_id":xxxxxxxx,
        "account_budget_id":xxxxxxxxxx,
        "account_budget_name":"BlueFocus International Limited - 2018年12月27日",
        "account_budget_status":"APPROVED",
        "approved_start_date_time":20181227,
        "approved_end_date_time":null,
        "approved_end_time_type":"FOREVER",
        "approved_spending_limit_type":"UNSPECIFIED",
        "approved_spending_limit_micros":1000,
        "adjusted_spending_limit_micros":1200,
        "amount_served_micros":12230
    }



But when I want to get all account_budgets under my account , I got results below, I‘m using GASQL



query = """
SELECT
customer.id,
account_budget.id,
account_budget.name,
account_budget.status,
account_budget.approved_end_date_time,
account_budget.approved_start_date_time,
account_budget.approved_spending_limit_micros,
account_budget.adjusted_spending_limit_micros,
account_budget.approved_spending_limit_type,
account_budget.approved_end_time_type,
account_budget.amount_served_micros,

account_budget.pending_proposal.creation_date_time,
account_budget.pending_proposal.proposal_type,
account_budget.resource_name,
account_budget.total_adjustments_micros,
billing_setup.payments_account_info.payments_account_id
FROM
account_budget


WHERE account_budget.approved_end_time_type = 'FOREVER'
AND account_budget.status = 'APPROVED'

ORDER BY
account_budget.approved_start_date_time DESC

LIMIT
100
"""



[
    {
       
"account_id":xxxxxx ,
       
"account_budget_id":xxxxxx ,
       
"account_budget_name":"BlueFocus International Limited - 2018年12月27日",
       
"account_budget_status":"APPROVED",
       
"approved_start_date_time":20181227,
       
"approved_end_date_time":null,
       
"approved_end_time_type":"FOREVER",
       
"approved_spending_limit_type":"UNSPECIFIED",
       
"approved_spending_limit_micros":1000,
       
"adjusted_spending_limit_micros":1200,
       
"amount_served_micros":12230
   
}
,
    {
       
"account_id":xxxxxx  ,
       
"account_budget_id":mmmmm  ,
       
"account_budget_name":"",
       
"account_budget_status":"APPROVED",
       
"approved_start_date_time":20170814,
       
"approved_end_date_time":null,
       
"approved_end_time_type":"FOREVER",
       
"approved_spending_limit_type":"INFINITE",
       
"approved_spending_limit_micros":0,
       
"adjusted_spending_limit_micros":-1,
       
"amount_served_micros":123456
   
}

]


How can I get the active account_budget only?   Any commentary is very welcome.   great thanks.
gg1024.png

Google Ads API Forum Advisor Prod

unread,
Oct 25, 2019, 10:56:47 AM10/25/19
to 14421...@qq.com, adwor...@googlegroups.com
Hello Min,

Could you please try to filter with WHERE account_budget.status = 'APPROVED' and account_budget.approved_end_date_time >= "[TODAY's DATE]". Please give it a try and let me know if you have any further questions.

Regards,
Sai Teja, Google Ads API Team

ref:_00D1U1174p._5001UKOSk0:ref
Message has been deleted

min jia

unread,
Oct 27, 2019, 11:15:57 PM10/27/19
to AdWords API and Google Ads API Forum
Hi, Sai 

Thanls for  your replying first, I've tried with your suggestion like 

WHERE account_budget.approved_end_date_time >= "2019-10-28"
AND account_budget.status = 'APPROVED'

but same results which still include two budgets one active as  the other ended returned as my filtering condition like 

WHERE account_budget.approved_end_time_type = 'FOREVER'
AND account_budget.status = 'APPROVED'


returned results:


[{'account_id': account_id, 'account_budget_id': xxxxx, 'account_budget_name': 'xxxxxxxxxx - 2018年12月27日', 'account_budget_status': 'APPROVED', 'approved_start_date_time': 20181227, 'approved_end_date_time': None, 'approved_end_time_type': 'FOREVER', 'approved_spending_limit_type': 'UNSPECIFIED', 'approved_spending_limit_micros': 27806080000, 'adjusted_spending_limit_micros': 18030640000, 'amount_served_micros': 36159540000},

{'account_id': account_id, 'account_budget_id': xxxxx, 'account_budget_name': '', 'account_budget_status': 'APPROVED', 'approved_start_date_time': 20170814, 'approved_end_date_time': None, 'approved_end_time_type': 'FOREVER', 'approved_spending_limit_type': 'INFINITE', 'approved_spending_limit_micros': 0, 'adjusted_spending_limit_micros': 0, 'amount_served_micros': 46848340000}]



related UI budget as attatchment showed :


20191028_active.png




20191028_ended.png






在 2019年10月25日星期五 UTC+8下午10:56:47,adsapiforumadvisor写道:
20191028_active.png
20191028_ended.png

Google Ads API Forum Advisor Prod

unread,
Oct 28, 2019, 12:28:56 PM10/28/19
to 14421...@qq.com, adwor...@googlegroups.com
Hello Min,

I will raise a feature request for the status of active budget and update you on this thread once I have more information.

Google Ads API Forum Advisor Prod

unread,
Oct 29, 2019, 12:14:52 PM10/29/19
to luban20...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for reaching out. Could you please share the client customer id for me to investigate this further? Please use Reply privately to author option while sharing the details.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UKOkav:ref

min jia

unread,
Oct 30, 2019, 10:36:27 PM10/30/19
to AdWords API and Google Ads API Forum
Hi Nikisha ,

I've replied you in privately way,  and could you please let me know if there is any progress?

在 2019年10月30日星期三 UTC+8上午12:14:52,adsapiforumadvisor写道:
Reply all
Reply to author
Forward
0 new messages