คำสั่งซื้อตามงบประมาณ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ดึงข้อมูลวงเงินใช้จ่ายฐานของคำสั่งซื้อตามงบประมาณ
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); } } ดึงข้อมูลคำสั่งซื้อตามงบประมาณที่ใช้งานอยู่
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.`); } } ดึงข้อมูลคำสั่งซื้อตามงบประมาณทั้งหมด
function getAllBudgetOrders() { const budgetOrderIterator = AdsApp.budgetOrders().get(); return budgetOrderIterator; } เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-28 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-28 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."]]],[]]