This website uses cookies to customize ads and analyze traffic. If you continue browsing, we'll consider you accept their utilization. More information.
Blog

How to create a budget depletion alert in Adwords

SEM -

This script will send to you an alert each time a daily budget goes depleted in any campaign of your Google Adwords account. This is a very powerful tool, since it will allow you to act inmediately by increasing the daily budget and/or reducing your CPCs. To create this alert, follow these steps:

1. Go into your Google Adwords account, and then go to Campaigns > Bulk operations > Scripts > + Script

2. Copy and paste this code:

function main() {
    var text_email = "";
    var campaignsIterator = AdWordsApp.campaigns().forDateRange("TODAY").get();
    while (campaignsIterator.hasNext()) {
      var campaign = campaignsIterator.next();
      var stats = campaign.getStatsFor("TODAY");
      var name = campaign.getName();
      var cost = stats.getCost(); 
      var budget = campaign.getBudget(); 
      if (cost >= budget) {
        var text_email = text_email+"<tr><td style='text-align:right;'>"+name+"</td>
<td style='font-weight:strong'>Gasto: "+cost+"</td></tr>";
      }
    }
    var table = "<table>"+text_email+"</table>";
    if (text_email!="") {
      MailApp.sendEmail({
        to: 'youremail@gmail.com',
        subject: 'Depleted Budget Alert',
        htmlBody: text_email,
      })
      Logger.log(text_email);
    }
}

3. Program the script to be run each hour. When a daily budget goes depleted, an email will arrive to you with the subject "Depleted Budget Alert", with all the details of that campaign.


Related Posts

Send Comment
Name
E-mail
Comment