Internal details: Missing field accountBudget.totalAdjustmentsMicros

23 views
Skip to first unread message

Denys Nykula

unread,
Jan 13, 2022, 7:10:27 PMJan 13
to Google Ads Scripts Forum
Hello, a script notifies our marketing department about low balance:

function main() {
  var bgt = AdsApp.budgetOrders().get().next();
  var usr = AdsApp.currentAccount();

  var adjust = bgt.getTotalAdjustments(); /* Crashes here. */
  var limit = bgt.getSpendingLimit();
  var total = usr.getStatsFor("ALL_TIME").getCost();

  console.log(limit - adjust - total); /* UrlFetchApp.fetch query in reality. */
}

Unless I stub adjust = 0, it fails:

SystemError: Could not read from Google Ads
(Internal details: Missing field accountBudget.totalAdjustmentsMicros
in object {"accountBudget": {
"resourceName": "customers/.../accountBudgets/...",
"status": "APPROVED",
...
"approvedStartDateTime": "2017-...",
...
}})
  at g (adsapp_compiled:264:50)
  at Ws.getTotalAdjustments (adsapp_compiled:8095:9)
  at Object.<anonymous> (adsapp_compiled:15958:46)

How to fix?

Google Ads Scripts Forum Advisor

unread,
Jan 14, 2022, 2:44:49 AMJan 14
to adwords...@googlegroups.com
Hi Denys,

Thank you for reaching out to us.

For us to assist you further, could you please provide the following details via Reply privately to author option?
  • CID
  • Script Name
  • Shareable link of the spreadsheet being used in the script (if any)
In case you encounter an error when using the mentioned option, you can send the requested information on this email (googleadsscr...@google.com) instead, then let us know here once sent.

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2UjvMx:ref

Denys Nykula

unread,
Jan 16, 2022, 7:20:59 PMJan 16
to Google Ads Scripts Forum
I do encounter a Groups permission error when trying to reply privately, so I have just
sent the requested details to the specified email.

Regards,
Denys

ref:_00D1U1174p._5004Q2UjvMx:ref

Google Ads Scripts Forum Advisor

unread,
Jan 16, 2022, 9:58:13 PMJan 16
to adwords...@googlegroups.com
Hi Denyx,

Thanks for providing the requested details. Harry here, I work with Teejay.

Unfortunately, I am unable to continue with troubleshooting your script as it requests to a third party API which our team do not provide assistance to. Would you be able to provide a script that does not request to the third party API but still produces the same error you are encountering so I can assist you further? On the other hand, it would seem that a certain ​BudgetOrder entity in your account does not have total adjustments / getTotalAdjustments; hence, the error: 'Missing field accountBudget.totalAdjustmentsMicros'.

Looking forward to your reply.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2UjvMx:ref

Denys Nykula

unread,
Jan 17, 2022, 7:26:30 PMJan 17
to Google Ads Scripts Forum
Sure, I edited the script to run a log statement instead of the api call.
If the field is unavailable, getTotalAdjustments should return null according to the documentation.
When instead it throws a SystemError with an Internal details label, I do believe it's a bug.

Google Ads Scripts Forum Advisor

unread,
Jan 18, 2022, 2:34:25 AMJan 18
to adwords...@googlegroups.com
Hi Denys,

Thanks for getting back. Allow me to raise this to the rest of the team for further investigation and get back to you of any progress and updates. Let me know if there's anything else I can assist you with.
Reply all
Reply to author
Forward
0 new messages