基本概念
本頁面提供 Google Ad Manager API 架構總覽,並說明 Ad Manager 中的一般概念和術語。
API 架構
以下為 Ad Manager API 主要類別的簡化圖表,以及這些類別彼此之間的關聯:

訂單
Order
物件會保留訂單的一般資訊 (例如貨幣或銷售人員),並包含一或多個 LineItem
例項。在程式碼中,每個 LineItem
都有其包含 Order
的 ID,而不是包含 LineItem
物件清單的 Order
。
LineItem
LineItem
物件說明一組顯示廣告的規定,包括廣告的顯示方式和時機、應顯示的廣告素材大小、顯示順序 (按照順序、加權或根據成效排列)、廣告的優先順序,以及許多描述費用結構的屬性。LineItem
有一個 InventoryTargeting
物件,用於說明它可以指定哪些 AdUnit
和 Placement
物件,以及可選用的額外 Targeting
子類別物件,代表地理區域、自訂或其他條件。
LineItemCreativeAssociation
LineItemCreativeAssociation
(通常稱為 LICA) 會將一個 LineItem
連結至一個 Creative
。您可以將委刊項連結到多個廣告素材,而且視您的帳戶類型而定,您可以將廣告素材連結到多個委刊項。建立 LineItemCreativeAssociation
時,Ad Manager 會先檢查廣告素材和委刊項是否相容。例如,如果大小不同,您嘗試建立或更新關聯時就會收到錯誤訊息。這個物件也能讓您覆寫相關聯 LineItem
中的某些值,例如開始/結束日期或大小 (如果廣告素材與委刊項指定的大小不同,但您想要讓 Ad Manager 即時調整廣告素材大小)。LICA 不會顯示在 Ad Manager 使用者介面中,而是採用 API 慣例。
充滿創意
Creative
代表實際廣告。如果廣告是由 Ad Manager 代管,這個物件會保留儲存在 Ad Manager 伺服器上的實際圖片位元組、Flash 檔案或自訂 HTML 標記;如果廣告素材是由第三方網站代管,廣告素材則是網址或 HTML 程式碼片段,會向第三方伺服器發出請求。
廣告空間指定目標和指定目標子類別
InventoryTargeting
物件會列出與特定 LineItem
相關聯的廣告單元。您可以使用適當 Targeting
子類別的其他執行個體,指定其他選用的指定條件。
刊登位置
Placement
物件是一或多個 AdUnit
物件的集合。
AdUnit
AdUnit
代表一或多個頁面上的廣告位置。AdUnit
可以是 LineItem
的 InventoryTargeting
物件或 Placement
物件的目標。AdUnit
物件包含大小、ID 和專屬名稱。這個 ID 可用來識別 API 內的其他 AdUnit
物件;該名稱在 HTML 標記中用來當做專屬 ID,用來識別特定 AdUnit
物件,接著做為網頁要求的一部分傳回 Ad Manager。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-22 (世界標準時間)。
[null,null,["上次更新時間:2024-08-22 (世界標準時間)。"],[[["The Google Ad Manager API uses objects like Orders, Line Items, and Creatives to structure and manage ad campaigns."],["Line Items define ad requirements, targeting criteria, and cost structures, and are linked to Creatives via LineItemCreativeAssociations."],["Creatives represent the actual ads, which can be hosted by Ad Manager or a third-party server."],["Ad Units represent ad locations on web pages and are targeted by Line Items or Placements, which are collections of Ad Units."],["Inventory Targeting specifies which Ad Units are associated with a Line Item, while Targeting subclasses allow for additional criteria like geography or custom attributes."]]],["The Google Ad Manager API's core components include `Order`, `LineItem`, `LineItemCreativeAssociation` (LICA), `Creative`, `InventoryTargeting`, `Placement`, and `AdUnit`. An `Order` contains `LineItem` instances, which define ad display requirements. A LICA links a `LineItem` to a `Creative`. `InventoryTargeting` links ad units to `LineItem`. `Placement` is a collection of `AdUnit`, representing ad locations. `Creative` is the actual ad content. AdUnits can be used to identify other adUnits.\n"]]