Các khái niệm cơ bản
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trang này cung cấp thông tin tổng quan
về cấu trúc của API Google Ad Manager và mô tả các khái niệm và thuật ngữ chung trong Ad Manager.
Cấu trúc API
Dưới đây là sơ đồ đơn giản về các lớp chính trong API Ad Manager và mối liên hệ giữa các lớp đó:

Đặt
- Đối tượng
Order
chứa thông tin chung về đơn đặt hàng, chẳng hạn như đơn vị tiền tệ hoặc nhân viên bán hàng, đồng thời chứa một hoặc nhiều thực thể LineItem
. Trong mã, mỗi LineItem
chứa mã nhận dạng của Order
chứa, thay vì Order
chứa danh sách đối tượng LineItem
.
LineItem
- Đối tượng
LineItem
mô tả một tập hợp các yêu cầu để hiển thị một quảng cáo, bao gồm
cách thức và thời điểm hiển thị quảng cáo, kích thước của các mẫu quảng cáo mà quảng cáo đó hiển thị và
thứ tự hiển thị quảng cáo (theo thứ tự, trọng số hoặc theo hiệu suất),
mức độ ưu tiên của các quảng cáo này và nhiều thuộc tính mô tả cấu trúc chi phí. LineItem
có một đối tượng InventoryTargeting
mô tả những đối tượng AdUnit
và Placement
mà đối tượng đó có thể nhắm đến và các đối tượng lớp con Targeting
bổ sung không bắt buộc đại diện cho tiêu chí địa lý, tuỳ chỉnh hoặc các tiêu chí khác.
LineItemCreativeAssociation
LineItemCreativeAssociation
(thường gọi là LICA) liên kết một LineItem
với một Creative
. Bạn có thể liên kết một mục hàng với nhiều mẫu quảng cáo và cũng có thể liên kết một mẫu quảng cáo với nhiều mục hàng tùy theo loại tài khoản. Khi bạn tạo LineItemCreativeAssociation
,
trước tiên, Ad Manager sẽ kiểm tra xem cả mẫu quảng cáo và mục hàng có tương thích hay không;
nếu kích thước khác nhau, ví dụ: bạn sẽ gặp lỗi khi cố gắng tạo
hoặc cập nhật mối liên kết. Đối tượng này cũng cho phép bạn ghi đè một số giá trị trong LineItem
được liên kết,
chẳng hạn như ngày bắt đầu/kết thúc hoặc kích thước (nếu bạn có mẫu quảng cáo không
phù hợp với kích thước do mục hàng chỉ định, nhưng bạn sẵn sàng để Ad Manager
điều chỉnh kích thước của mẫu quảng cáo cho phù hợp với đơn vị quảng cáo một cách nhanh chóng). LICA không hiển thị trong giao diện người dùng Ad Manager; đó là một quy ước API.
Tệp sáng tạo
Creative
đại diện cho quảng cáo thực tế. Nếu quảng cáo do Ad Manager lưu trữ,
đối tượng này sẽ chứa các byte hình ảnh thực tế, tệp flash hoặc thẻ HTML tùy chỉnh được lưu trữ
trên máy chủ của Ad Manager; nếu quảng cáo được lưu trữ trên
trang web của bên thứ ba, thì quảng cáo là URL hoặc đoạn mã HTML tạo yêu cầu
từ máy chủ của bên thứ ba.
Các lớp con Nhắm mục tiêu khoảng không quảng cáo và Nhắm mục tiêu
- Đối tượng
InventoryTargeting
liệt kê những đơn vị quảng cáo liên kết với một LineItem
cụ thể. Bạn có thể chỉ định tiêu chí nhắm mục tiêu bổ sung, không bắt buộc bằng cách sử dụng các phiên bản bổ sung của một lớp con thích hợp của Targeting
.
Vị trí đặt quảng cáo
- Đối tượng
Placement
là tập hợp một hoặc nhiều đối tượng AdUnit
.
AdUnit
AdUnit
biểu thị vị trí quảng cáo trên một hoặc nhiều trang. AdUnit
có thể là mục tiêu của đối tượng InventoryTargeting
của LineItem
hoặc đối tượng Placement
. Đối tượng AdUnit
bao gồm kích thước, mã nhận dạng và tên riêng biệt. Mã nhận dạng được dùng để xác định các đối tượng AdUnit
khác trong API; tên này được dùng làm giá trị nhận dạng duy nhất trong thẻ HTML để xác định một đối tượng AdUnit
cụ thể và được gửi lại cho Ad Manager dưới dạng một phần của yêu cầu trang.
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: 2025-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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."]]