Hello, please help me with a problem.
The script for email notification of the current account balance does not work.I need an email notification when the current account balance (not MCC) is less than 500. Can you please see what is wrong with the code?
- Google Ads account 384-537-7276
- Name of the affected script Notification
Script Code:var CONFIG = {
days: 7,
alertLimit: 30000,
email: ['vasi...@gmail.com'],
names: ['Nick', 'Nick2'],
}
function main() {
var accountName = AdWordsApp.currentAccount().getName();
var budgetNow = AdWordsApp.budgetOrders().get();
var messageHeader = CONFIG.names + ' / Заканчивается бюджет на аккаунте: ' + accountName;
var messageBody = 'Аккаунт ' + accountName + ' . Текущий остаток = ' + budgetNow +
'В аккаунте заканчиваются средства. Необходимо предупредить PM.';
if (budgetNow < CONFIG.alertLimit) {
MailApp.sendEmail(CONFIG.email, messageHeader, messageBody);
Logger.log([accountName, budgetNow]);
}
}
Hi,
Thank you for reaching out to the Google Ads Scripts support team.
I could see that you have already raised this concern on another thread with "Email notification does not work" and we have already responded there for this issue. To avoid multiple threads on the same issue, please take a look at that thread and continue the discussion on the same for further updates on the issue.
![]() |
Google Ads Scripts Team |