Get More from Your Google LSA Text Us at (628) 228-6704
0 like 0 dislike
738 views
by Marketing Guru (8.5k points)

1 Answer

0 like 0 dislike
by Marketing Guru (9.0k points)

Google Ads doesn’t let you directly assign different budgets per weekday in the standard interface but you can do it with Google Ads Scripts.

Here’s how it works:

  • Write (or copy-paste) a script that checks what day it is.

  • The script then updates your campaign’s daily budget based on a budget map you define (e.g., $150 Mon–Thu, $175 Fri, $100 Sat–Sun).

  • Schedule the script to run once daily (e.g., 7 AM).

/**

 * Sets daily budgets by weekday for campaigns labeled "BUDGET_SCHEDULE".

 * Schedule: Daily (run once each morning, e.g., 07:00)

 */

function main() {

  var tz = AdsApp.currentAccount().getTimeZone();

  var day = Utilities.formatDate(new Date(), tz, 'EEE'); // Mon, Tue, ...

  var labelName = 'BUDGET_SCHEDULE';

  // Define your weekday budget map (in account currency)

  var budgetByDay = {

    'Mon': 150,  // higher volume days

    'Tue': 150,

    'Wed': 150,

    'Thu': 175,  // competitive day

    'Fri': 175,

    'Sat': 100,  // lower volume

    'Sun': 100

  };

  var todayBudget = budgetByDay[day];

  if (todayBudget == null) {

    Logger.log('No budget defined for ' + day + '. Exiting.');

    return;

  }

  ensureLabel_(labelName);

  var it = AdsApp.campaigns()

    .withCondition("LabelNames CONTAINS_ANY ['" + labelName + "']")

    .withCondition("ServingStatus != ENDED")

    .get();

  var updated = 0, skippedShared = 0;

  while (it.hasNext()) {

    var c = it.next();

    var b = c.getBudget();

    if (b.isExplicitlyShared()) {

      // OPTIONAL: update shared budgets by name instead (see helper)

      skippedShared++;

      continue;

    }

    if (Math.abs(b.getAmount() - todayBudget) > 0.0001) {

      b.setAmount(todayBudget);

      updated++;

    }

  }

  Logger.log('Updated ' + updated + ' campaign budget(s) to ' + todayBudget + '. Skipped shared: ' + skippedShared);

  // OPTIONAL: If you use shared budgets, uncomment and map names → amounts.

  // updateSharedBudgets_({

  //   'Brand_Shared': todayBudget,

  //   'PMax_Shared': todayBudget * 1.2

  // });

}

function ensureLabel_(name) {

  if (!AdsApp.labels().withCondition("Name = '" + name + "'").get().hasNext()) {

    AdsApp.createLabel(name);

  }

}

// OPTIONAL: Update shared budgets by name map (name → amount)

function updateSharedBudgets_(nameToAmount) {

  var it = AdsApp.budgets().get();

  var touched = 0;

  while (it.hasNext()) {

    var bud = it.next();

    var name = bud.getName();

    if (nameToAmount.hasOwnProperty(name)) {

      var amt = nameToAmount[name];

      if (Math.abs(bud.getAmount() - amt) > 0.0001) {

        bud.setAmount(amt);

        touched++;

        Logger.log('Shared budget "' + name + '" set to ' + amt);

      }

    }

  }

  Logger.log('Shared budgets updated: ' + touched);

}

Steps to use:

  1. Add a label like BUDGET_SCHEDULE to campaigns you want controlled.

  2. Go to Tools & Settings → Bulk Actions → Scripts → +.

  3. Paste the code, authorize, save.

  4. Schedule it to run daily.

Pro Tip: If you use shared budgets, you’ll need to adjust the script slightly to target the shared budget names.

Join a specialized Q&A site for digital marketing experts focused on ad platforms like Google, Facebook, YouTube, LinkedIn, Bing, Quora, and more. Connect with peers to share strategies on client retention beyond acquisition. Discuss and solve technical, managerial, or general challenges to improve your ad campaigns and client relationships.

Register to unlock your digital marketing potential!
Get More from Your Google LSA
Text Us at (628) 228-6704
...