Zamówienia budżetowe
Pobierz podstawowy limit wydatków zamówienia budżetowego
function getBaseSpendingLimit() {
const budgetOrderIterator = AdsApp.budgetOrders().get();
for (const budgetOrder of budgetOrderIterator) {
let limitText = "";
if (budgetOrder.getSpendingLimit() == null) {
limitText = "unlimited";
} else if (budgetOrder.getTotalAdjustments() == null) {
limitText = budgetOrder.getSpendingLimit();
} else {
limitText = budgetOrder.getSpendingLimit() -
budgetOrder.getTotalAdjustments();
}
console.log("Budget Order [" + budgetOrder.getName() +
"] base spending limit: " + limitText);
}
}
Pobierz aktywne zamówienie budżetowe
function getActiveBudgetOrder() {
// There will only be one active budget order at any given time.
const budgetOrderIterator = AdsApp.budgetOrders()
.withCondition('account_budget.status = "ACTIVE"')
.get();
for (const budgetOrder of budgetOrderIterator) {
const budgetOrder = budgetOrderIterator.next();
console.log(`Budget Order [${budgetOrder.getName()}] is currently active.`);
}
}
Pobierz wszystkie zamówienia budżetowe
function getAllBudgetOrders() {
const budgetOrderIterator = AdsApp.budgetOrders().get();
return budgetOrderIterator;
}
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-11 UTC.
[null,null,["Ostatnia aktualizacja: 2024-09-11 UTC."],[[["This script provides functions to retrieve budget order information from Google Ads, including the base spending limit, active budget order, and all budget orders."],["`getBaseSpendingLimit()` calculates and logs the base spending limit of each budget order, considering total adjustments."],["`getActiveBudgetOrder()` identifies and logs the currently active budget order within the Google Ads account."],["`getAllBudgetOrders()` retrieves and returns an iterator containing all budget orders associated with the account."]]],[]]