基本概念
本页简要介绍了 Google Ad Manager API 的架构,并介绍了 Ad Manager 中的一般概念和术语。
API 架构
以下图表简单地介绍了 Ad Manager API 中的主要类,以及各个类之间的关系:

订单
Order
对象包含有关订单的一般信息(如货币或销售人员),并且包含一个或多个 LineItem
实例。在代码中,每个 LineItem
保留其所属 Order
的 ID,而不是 Order
保留 LineItem
对象列表。
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 托管,则此对象包含实际的图片字节、Flash 文件或存储在 Ad Manager 服务器上的自定义 HTML 代码;如果广告素材托管在第三方网站上,则此广告素材是从第三方服务器发送请求的网址或 HTML 代码段。
Inventory 定位和定位子类
InventoryTargeting
对象会列出与特定 LineItem
相关联的广告单元。您可以使用相应 Targeting
子类的其他实例来指定其他可选的定位条件。
展示位置
Placement
对象是一个或多个 AdUnit
对象的集合。
AdUnit
AdUnit
表示一个或多个页面上的广告位置。AdUnit
可以是 LineItem
的 InventoryTargeting
对象的目标,也可以是 Placement
对象的目标。AdUnit
对象包含尺寸、ID 和唯一名称。ID 用于标识 API 中的其他 AdUnit
对象;名称用作 HTML 代码中的唯一标识符,以标识特定的 AdUnit
对象,并作为网页请求的一部分发送回 Ad Manager。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[null,null,["最后更新时间 (UTC):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"]]