แนวคิดพื้นฐาน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หน้านี้แสดงภาพรวมสถาปัตยกรรมของ Google Ad Manager API และอธิบายแนวคิดและข้อกำหนดทั่วไปใน Ad Manager
สถาปัตยกรรม API
ต่อไปนี้เป็นแผนภาพแบบง่ายของคลาสหลักใน Ad Manager API และความเกี่ยวข้องกัน

สั่งซื้อ
- ออบเจ็กต์
Order
มีข้อมูลทั่วไปเกี่ยวกับคำสั่งซื้อ เช่น สกุลเงินหรือพนักงานขาย และมีอินสแตนซ์ LineItem
อย่างน้อย 1 รายการ ในโค้ด LineItem
แต่ละรายการจะเก็บรหัสของ Order
ที่มีอยู่ ไม่ใช่ Order
ที่มีรายการออบเจ็กต์ LineItem
LineItem
- ออบเจ็กต์
LineItem
อธิบายถึงชุดข้อกำหนดในการแสดงโฆษณา รวมถึงวิธีและเวลาที่จะแสดงโฆษณา ขนาดของครีเอทีฟโฆษณาที่จะแสดง และลำดับในการแสดงโฆษณา (ตามลำดับ ถ่วงน้ำหนัก หรือตามประสิทธิภาพ) ลำดับความสำคัญของโฆษณา และพร็อพเพอร์ตี้มากมายที่อธิบายโครงสร้างต้นทุน LineItem
มีออบเจ็กต์ InventoryTargeting
1 รายการที่อธิบายออบเจ็กต์ AdUnit
และ Placement
ที่กําหนดเป้าหมายได้ และออบเจ็กต์คลาสย่อย Targeting
เพิ่มเติมที่ไม่บังคับที่แสดงถึงภูมิศาสตร์ ที่กําหนดเอง หรือเกณฑ์อื่นๆ
LineItemCreativeAssociation
LineItemCreativeAssociation
(มักเรียกว่า LICA) ลิงก์ 1 LineItem
ไปยัง Creative
คุณลิงก์รายการโฆษณากับครีเอทีฟโฆษณาได้มากกว่า 1 รายการ และคุณอาจลิงก์ครีเอทีฟโฆษณากับรายการโฆษณาได้มากกว่า 1 รายการ ทั้งนี้ขึ้นอยู่กับประเภทบัญชีที่ใช้ เมื่อคุณสร้าง LineItemCreativeAssociation
ก่อนอื่น Ad Manager จะตรวจสอบว่าทั้งครีเอทีฟโฆษณาและรายการโฆษณาใช้งานร่วมกันได้หรือไม่ เช่น หากขนาดแตกต่างกัน คุณจะได้รับข้อผิดพลาดเมื่อพยายามสร้างหรืออัปเดตการเชื่อมโยง ออบเจ็กต์นี้ยังให้คุณลบล้างค่าบางค่าใน LineItem
ที่เชื่อมโยงได้ด้วย เช่น วันที่เริ่มต้น/สิ้นสุด หรือขนาด (หากคุณมีครีเอทีฟโฆษณาที่มีขนาดไม่พอดีกับขนาดที่รายการโฆษณาระบุไว้ แต่คุณยินดีให้ Ad Manager ปรับขนาดครีเอทีฟโฆษณาให้พอดีกับหน่วยโฆษณาได้อย่างรวดเร็ว) LICA จะไม่แสดงในอินเทอร์เฟซผู้ใช้ของ Ad Manager เนื่องจากเป็นรูปแบบ API
ครีเอทีฟโฆษณา
Creative
แสดงโฆษณาจริง หากโฆษณาโฮสต์โดย Ad Manager ออบเจ็กต์นี้จะเก็บไบต์รูปภาพ ไฟล์ Flash หรือแท็ก HTML ที่กำหนดเองจริงๆ ที่จัดเก็บไว้ในเซิร์ฟเวอร์ของ Ad Manager หากครีเอทีฟโฆษณาโฮสต์อยู่ในเว็บไซต์ของบุคคลที่สาม ครีเอทีฟโฆษณาจะเป็น URL หรือข้อมูลโค้ด HTML ที่ส่งคำขอจากเซิร์ฟเวอร์ของบุคคลที่สาม
คลาสย่อยการกำหนดเป้าหมายพื้นที่โฆษณาและการกำหนดเป้าหมาย
- ออบเจ็กต์
InventoryTargeting
แสดงรายการหน่วยโฆษณาที่เชื่อมโยงกับ LineItem
ที่เฉพาะเจาะจง คุณระบุเกณฑ์การกำหนดเป้าหมายเพิ่มเติมที่ไม่บังคับได้โดยใช้อินสแตนซ์เพิ่มเติมของคลาสย่อย Targeting
ที่เหมาะสม
ตำแหน่งโฆษณา
- ออบเจ็กต์
Placement
คือคอลเล็กชันของออบเจ็กต์ AdUnit
อย่างน้อย 1 รายการ
AdUnit
AdUnit
หมายถึงตำแหน่งของโฆษณาในหน้าเว็บอย่างน้อย 1 หน้า AdUnit
อาจเป็นเป้าหมายของออบเจ็กต์ InventoryTargeting
ของ LineItem
หรือออบเจ็กต์ Placement
ก็ได้ ออบเจ็กต์ AdUnit
มีขนาด รหัส และชื่อที่ไม่ซ้ำกัน รหัสนี้ใช้สำหรับระบุออบเจ็กต์ AdUnit
อื่นๆ ภายใน API ชื่อนี้จะใช้เป็นตัวระบุที่ไม่ซ้ำกันในแท็ก HTML เพื่อระบุออบเจ็กต์ AdUnit
ที่เจาะจง และส่งกลับไปยัง Ad Manager โดยเป็นส่วนหนึ่งของคำขอหน้าเว็บ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[null,null,["อัปเดตล่าสุด 2025-08-21 UTC"],[[["\u003cp\u003eThe Google Ad Manager API uses objects like Orders, Line Items, and Creatives to structure and manage ad campaigns.\u003c/p\u003e\n"],["\u003cp\u003eLine Items define ad requirements, targeting criteria, and cost structures, and are linked to Creatives via LineItemCreativeAssociations.\u003c/p\u003e\n"],["\u003cp\u003eCreatives represent the actual ads, which can be hosted by Ad Manager or a third-party server.\u003c/p\u003e\n"],["\u003cp\u003eAd Units represent ad locations on web pages and are targeted by Line Items or Placements, which are collections of Ad Units.\u003c/p\u003e\n"],["\u003cp\u003eInventory Targeting specifies which Ad Units are associated with a Line Item, while Targeting subclasses allow for additional criteria like geography or custom attributes.\u003c/p\u003e\n"]]],["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"],null,["# Basic Concepts\n\nThis page provides an overview\nof the architecture of the Google Ad Manager API and describes general concepts and terms in Ad Manager.\n\nAPI Architecture\n----------------\n\nHere is a simplified diagram of the main classes in the Ad Manager API, and how they relate to each other:\n\nOrder\n-----\n\n: An [Order](/ad-manager/api/reference/latest/OrderService.Order) object holds general information about the order such as the currency or salesperson, and contains one or more `LineItem` instances. In code, each `LineItem` holds the ID of its containing `Order`, rather than the `Order` holding a list of `LineItem` objects.\n\nLineItem\n--------\n\n: A [LineItem](/ad-manager/api/reference/latest/LineItemService.LineItem) object describes a set of requirements for an ad to show, including how\n and when the ads should be shown, the sizes of the creatives it should show and\n the order in which to show them (in order, weighted, or according to their performance),\n the priority of these ads, and many properties describing the cost structure. A\n `LineItem` has one `InventoryTargeting` object that describes which `AdUnit` and `Placement` objects it can target, and optional additional `Targeting` subclass objects that represent geographical, custom, or other criteria.\n\nLineItemCreativeAssociation\n---------------------------\n\n: A [LineItemCreativeAssociation](/ad-manager/api/reference/latest/LineItemCreativeAssociationService.LineItemCreativeAssociation) (often called a LICA) links one `LineItem` to\n one `Creative`. Line items can be linked to more than one creative, and depending on your account type, you might be able to link a creative to more than one line item. When you create a `LineItemCreativeAssociation`,\n Ad Manager first checks whether both the creative and the line item are compatible;\n if the sizes differ, for instance, you'll get an error when you try to create\n or update the association. This object also lets you override some values in the associated `LineItem`,\n such as start/end dates, or size (if you have a creative that doesn't\n quite fit the size specified by the line item, but you are willing to let Ad Manager\n adjust the size of the creative to fit the ad unit on the fly). LICAs are not exposed in the Ad Manager user interface; they are an API convention.\n\nCreative\n--------\n\n: A [Creative](/ad-manager/api/reference/latest/CreativeService.Creative) represents the actual ad. If the ad is hosted by Ad Manager,\n this object holds the actual image bytes, flash files, or custom HTML tags stored\n on Ad Manager's servers; if the creative is hosted on a\n third-party site, the creative is a URL or HTML snippet that makes the\n request from the third-party server.\n\nInventoryTargeting and Targeting subclasses\n-------------------------------------------\n\n: The [InventoryTargeting](/ad-manager/api/reference/latest/LineItemService.InventoryTargeting) object lists which ad units are associated with a specific `LineItem`. You can specify additional, optional targeting criteria using additional instances of an appropriate subclass of [`Targeting`](/ad-manager/api/reference/latest/LineItemService.Targeting).\n\nPlacement\n---------\n\n: A [Placement](/ad-manager/api/reference/latest/PlacementService.Placement) object is a collection of one or more `AdUnit` objects.\n\nAdUnit\n------\n\n: An [AdUnit](/ad-manager/api/reference/latest/InventoryService.AdUnit) represents an ad location on one or more pages. An `AdUnit` can be a target of either a `LineItem`'s `InventoryTargeting` object or a `Placement` object. An `AdUnit` object includes a size, an ID, and a unique name. The ID is used to identify other `AdUnit` objects within the API; the name is used as a unique identifier in the HTML tags to identify a specific `AdUnit` object, and is sent back to Ad Manager as part of the page request."]]