Ngân sách đặt hàng
Truy lục giới hạn chi tiêu cơ bản của ngân sách đặt hàng
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);
}
}
Truy lục ngân sách đặt hàng đang hoạt động
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.`);
}
}
Truy lục tất cả ngân sách đặt hàng
function getAllBudgetOrders() {
const budgetOrderIterator = AdsApp.budgetOrders().get();
return budgetOrderIterator;
}
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-09-11 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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."]]],[]]