> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/api/zh/guang-gao-tou-fang-api/xiang-ying/ad-plac-renderers.md).

# 响应渲染器

Ad Placement API 响应 JSON 包含 [**区域**](/api/zh/guang-gao-tou-fang-api/xiang-ying/ad-plac-response.md) 数组以及 **渲染器** 和 [**用户**](/api/zh/guang-gao-tou-fang-api/xiang-ying/ad-plac-user.md) 对象。

在本页中，我们将解释 **渲染器** 对象，它可用于在您的网页上独立渲染不同的容器和广告。

## 容器渲染器

这些渲染器旨在生成各种类型的容器，您可以方便地在其中展示广告。容器渲染器的 render 函数将返回一个数组，其中包含您可用于放置广告的占位符。

至于 `区域` 对象，您可以传入在 Ad Placement 响应中收到的相同对象，不同之处在于您无需传入 **zones.type**.

### 固定容器渲染器

用于在页面上渲染一个固定位置的容器。

此脚本将暴露 `window.FixedContainerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.FixedContainerRenderer.render(zone, placeholder);` 即可在页面上渲染该容器。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                 |
| ---------- | --------------- | -- | -------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象        |
|            | `placeholder`   | 是  | 指示渲染容器位置的 HTML 元素    |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值 |

### 粘性容器渲染器

此脚本将暴露 `window.StickyContainerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.StickyContainerRenderer.render(zone, placeholder);` 即可在页面上渲染该容器。

**可用的渲染器函数：**

| 函数               | 参数名称                 | 必需 | 参数描述                 |
| ---------------- | -------------------- | -- | -------------------- |
| `render()`       | `区域`                 | 是  | 包含用于渲染信息的区域对象        |
|                  | `placeholder`        | 是  | 指示渲染容器位置的 HTML 元素    |
|                  | `cookieConsent`      | 否  | 指示用户是否同意 cookie 的布尔值 |
| `setBorder()`    | `zoneId`             | 是  | 要设置边框的区域 ID          |
|                  | `width`              | 是  | 边框的宽度                |
|                  | `color`              | 是  | 边框的颜色                |
| `removeBorder()` | `zoneId`             | 是  | 要移除边框的区域 ID          |
| `setPosition()`  | `zoneId`             | 是  | 要设置位置的区域 ID          |
|                  | `horizontalPosition` | 是  | 区域的水平位置              |
|                  | `verticalPosition`   | 是  | 区域的垂直位置              |

### 即时消息容器渲染器

用于在页面上渲染即时消息容器。

此脚本将暴露 `window.InstantMessageContainerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.InstantMessageContainerRenderer.render(zone, placeholder);` 即可在页面上渲染该容器。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                 |
| ---------- | --------------- | -- | -------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象        |
|            | `placeholder`   | 是  | 指示渲染容器位置的 HTML 元素    |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值 |

### 移动端即时消息容器渲染器

用于在页面上渲染移动端即时消息容器。

此脚本将暴露 `window.MobileInstantMessageContainerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.MobileInstantMessageContainerRenderer.render(zone, placeholder);` 即可在页面上渲染该容器。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                 |
| ---------- | --------------- | -- | -------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象        |
|            | `placeholder`   | 是  | 指示渲染容器位置的 HTML 元素    |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值 |

### 全页插页容器渲染器

用于在桌面端或移动端页面上渲染全页插页容器。

此脚本将暴露 `window.FullpageInterstitialContainerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.FullpageInterstitialContainerRenderer.render(zone, placeholder);` 即可在页面上渲染该容器。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                 |
| ---------- | --------------- | -- | -------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象        |
|            | `placeholder`   | 是  | 指示渲染容器位置的 HTML 元素    |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值 |

### 组容器渲染器

此脚本将暴露 `window.GroupContainerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.GroupContainerRenderer.render(group, placeholder);` 即可在页面上渲染该容器。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                 |
| ---------- | --------------- | -- | -------------------- |
| `render()` | `组`             | 是  | 包含用于渲染信息的组对象         |
|            | `placeholder`   | 是  | 指示渲染容器位置的 HTML 元素    |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值 |

## 内容渲染器

这些渲染器负责在容器内展示广告。其中一些是独立的，不需要容器。

### 横幅内容渲染器

此脚本将暴露 `window.BannerRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.BannerRenderer.render(zone, placeholder);` 即可渲染广告。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                   |
| ---------- | --------------- | -- | ---------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象          |
|            | `placeholder`   | 是  | 指示广告渲染位置的 HTML 元素，例如容器 |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值   |

### 原生内容渲染器

此脚本将暴露 `window.NativeRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.NativeRenderer.render(zone, placeholder);` 即可渲染广告。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                   |
| ---------- | --------------- | -- | ---------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象          |
|            | `placeholder`   | 是  | 指示广告渲染位置的 HTML 元素，例如容器 |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值   |

### Outstream 视频内容渲染器

此脚本将暴露 `window.OutstreamVideoRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.OutstreamVideoRenderer.render(zone, placeholder);` 即可渲染广告。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                   |
| ---------- | --------------- | -- | ---------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象          |
|            | `placeholder`   | 是  | 指示广告渲染位置的 HTML 元素，例如容器 |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值   |

### 页面内推送通知内容渲染器

此脚本将暴露 `window.InPagePushNotificationRenderer` 变量，您可以使用它与渲染器交互。例如，通过调用 `window.InPagePushNotificationRenderer.render(zone, placeholder);` 即可渲染广告。

**可用的渲染器函数：**

| 函数         | 参数名称            | 必需 | 参数描述                   |
| ---------- | --------------- | -- | ---------------------- |
| `render()` | `区域`            | 是  | 包含用于渲染信息的区域对象          |
|            | `placeholder`   | 是  | 指示广告渲染位置的 HTML 元素，例如容器 |
|            | `cookieConsent` | 否  | 指示用户是否同意 cookie 的布尔值   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/api/zh/guang-gao-tou-fang-api/xiang-ying/ad-plac-renderers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
