

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 叠加广告
<a name="overlay-ads"></a>

对于想要在不中断插播广告观看体验的情况下提高盈利能力的直播工作流程，您可以利用当前的 AWS Elemental MediaTailor 集成来指导在客户端呈现的广告格式。这种类型的广告被称为*叠加广告*。叠加广告是非线性视频广告，以 “L 波段广告”、“非线性视频广告”、“广告”、“动态叠加”、“内容内picture-in-picture 广告” 或 “框架广告” 的形式出现。

MediaTailor 检测具有分段类型的 SCTE-35 标记`id=0x38`作为带内信号，以获得叠加广告插入机会。SCTE-35 标记会导致 MediaTailor 向广告决策服务器 (ADS) 发送请求，然后广告决策服务器 (ADS) 在 VAST 响应中使用非线性广告有效载荷进行响应。 MediaTailor 解析 VAST 响应以支持叠加广告插入。 MediaTailor 不会对线性广告进行任何拼接，而是向玩家发出信号，表明有非线性叠加广告可供播放。该信号允许玩家从客户端跟踪端点获取并关联要播放的非线性广告。然后，玩家处理与这些广告相关的展示、举报和其他任务。例如，玩家的开发者可以使用供应商提供的支持叠加广告格式的设备 SDK。有关客户端跟踪集成的更多信息，请参阅。[客户端广告跟踪集成](ad-reporting-client-side-ad-tracking-integrations.md)

![\[该图片描绘了内容视频旁边显示的各种广告类型的时间表。线性广告在内容视频之前和之后播放。内容视频之前的广告称为片前广告。内容视频之后的广告称为片尾广告。非线性广告与内容视频本身的一部分重叠。非线性广告称为叠加广告。\]](http://docs.aws.amazon.com/zh_cn/mediatailor/latest/ug/images/client-side-overlays.png)


**Topics**
+ [使用叠加广告的先决条件 MediaTailor](overlay-ads-prerequisites.md)
+ [开始使用叠加式广告 MediaTailor](overlay-ads-getting-started.md)
+ [中叠加广告的日志记录和指标 MediaTailor](overlay-ads-logging-and-metrics.md)
+ [中叠加广告的计费 MediaTailor](overlay-ads-billing.md)

# 使用叠加广告的先决条件 MediaTailor
<a name="overlay-ads-prerequisites"></a>

使用叠加式广告时，需要满足以下先决条件 MediaTailor：
+ 工作流程必须是实时的，而不是视频点播 (VOD)。
+ 必须将广告决策服务器 (ADS) 响应配置为在 VAST 响应中仅返回非线性广告。 MediaTailor 为了拼接广告而忽略任何线性广告。
+ 清单必须使用分段类型的 SCTE-35 时间信号消息`id=0x38`才能调用叠加广告功能。
+ 流媒体提供商必须控制客户端设备应用程序，并与 MediaTailor 客户端跟踪 API 集成。

# 开始使用叠加式广告 MediaTailor
<a name="overlay-ads-getting-started"></a>

本节介绍如何开始使用的叠加广告功能。 MediaTailor您将设置 SCTE-35 信令、配置广告决策服务器 (ADS) 响应并设置会话级控制。

**Topics**
+ [启用叠加广告](overlay-ads-getting-started-enabling.md)
+ [使用客户端元数据跟踪叠加广告](overlay-ads-client-side-tracking-metadata.md)

# 启用叠加广告
<a name="overlay-ads-getting-started-enabling"></a>

MediaTailor 默认情况下，对叠加广告的支持处于启用状态。清单中特定的 SCTE-35 广告标记类型会触发叠加广告的插入。由于某些玩家可能不支持叠加广告的客户端渲染，因此您可以在会话级别禁用该功能。

**要使用 HLS 或 DASH 播放前缀禁用叠加广告支持，请执行以下操作：**
+ 在播放器中，根据您的协议，使用以下格式之一的请求初始化新的 MediaTailor 播放会话：
  + 示例：HLS 格式

    ```
    GET mediatailorURL/v1/master/hashed-account-id/origin-id/asset-id?aws.overlayAvails=off
    ```
  + 示例：DASH 格式

    ```
    GET mediatailorURL/v1/master/hashed-account-id/origin-id/asset-id?aws.overlayAvails=off
    ```

**要使用会话初始化前缀禁用叠加广告支持，请执行以下操作：**
+ 在播放器上，为会话初始化请求构造一个 JSON 消息正文，以 MediaTailor：
  + 要禁用广告叠加层支持，请添加一个值为的`overlays`对象作为顶级键。`off`默认`overlays`值为`on`。
  + （可选）提供 MediaTailor 随后传递给`adsParams`对象内的 ADS 的任何参数。这些参数对应于 MediaTailor 配置的 ADS 模板 URL 中的 `[player_params.param]` 设置。

**Example HLS：**  

```
POST master.m3u8
    {
       "adsParams": {
           "deviceType": "ipad"
       },
       "overlayAvails": "off"
    }
```

**Example DASH：**  

```
POST manifest.mpd
    {
        "adsParams": {
           "deviceType": "androidmobile"
       },
       "overlayAvails": "off"
    }
```

# 清单信号
<a name="overlay-ads-manifest-signaling"></a>

MediaTailor 当它在清单中看到特定的 SCTE-35 标记时，就会触发叠加广告支持。所需的信号是拼接命令类型 6 或时间信号，即提供商叠加广告开始信号。此信号的分段类型 ID 为 `0x38`

以下示例显示了 JSON 对象中的 `0x38` SCTE-35 标记。

```
{
  "tableId": 252,
  "selectionSyntaxIndicator": false,
  "privateIndicator": false,
  "sectionLength": 53,
  "protocolVersion": 0,
  "encryptedPacket": false,
  "encryptedAlgorithm": 0,
  "ptsAdjustment": 0,
  "cwIndex": 0,
  "tier": 4095,
  "spliceCommandLength": 5,
  "spliceCommandType": 6,
  "spliceCommand": {
    "specified": true,
    "pts": 1800392
  },
  "descriptorLoopLength": 31,
  "descriptors": [
    {
      "spliceDescriptorTag": 2,
      "descriptorLength": 29,
      "indentifier": "CUEI",
      "segmentationEventId": 158389361,
      "segmentationEventCancelIndicator": false,
      "programSegmentationFlag": true,
      "segmentationDurationFlag": true,
      "deliveryNotRestrictedFlag": false,
      "webDeliveryAllowedFlag": true,
      "noRegionalBlackoutFlag": true,
      "archiveAllowedFlag": true,
      "deviceResctrictions": 3,
      "segmentationDuration": 1350000,
      "segmentationUpidType": 9,
      "segmentationUpidLength": 7,
      "segmentationUpid": {
        "0": 111,
        "1": 118,
        "2": 101,
        "3": 114,
        "4": 108,
        "5": 97,
        "6": 121
      },
      "segmentationTypeId": 56,
      "segmentNum": 1,
      "segmentsExpected": 0
    }
  ],
  "crc": 2510422713
}
```

以下示例显示了以二进制（基数 32 /十六进制）值表示的 SCTE-35 信号：

```
0xfc303500000000000000fff00506fe001b78c8001f021d435545490970d4717fdf00000dbba009076f7665726c6179380100000084226c4f
```

以下示例显示了 HLS 和 DASH 清单中的 SCTE-35 标记。

**Example : HLS 清单**  

```
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:419
#EXT-X-DISCONTINUITY-SEQUENCE:3
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:09.231Z
#EXTINF:6.02,
https://aws.cloudfront.net/media/asset1/index1_00007.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=NONE
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:15.251Z
#EXTINF:6.0,
https://aws.cloudfront.net/media/asset1/index1_00001.ts
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:21.251Z
#EXTINF:4.0,
https://aws.cloudfront.net/media/asset1/index1_00002.ts
#EXT-X-DISCONTINUITY
#EXT-X-DATERANGE:ID="1692073825251-30-1",START-DATE="2023-08-15T04:30:25.251Z",DURATION=10.0,PLANNED-DURATION=10.0,SCTE35-OUT=0xfc303500000000000000fff00506fe001b78c8001f021d435545490970d4717fdf00000dbba009076f7665726c6179380100000084226c4f
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:25.251Z
#EXTINF:2.0,
https://aws.cloudfront.net/media/asset1/index1_00003.ts
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:27.251Z
#EXTINF:6.0,
https://aws.cloudfront.net/media/asset1/index1_00004.ts
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:33.251Z
#EXTINF:2.0,
https://aws.cloudfront.net/media/asset1/index1_00005.ts
#EXT-X-DISCONTINUITY
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:35.251Z
#EXTINF:4.0,
https://aws.cloudfront.net/media/asset1/index1_00006.ts
#EXT-X-PROGRAM-DATE-TIME:2023-08-15T04:30:39.251Z
#EXTINF:6.02,
https://aws.cloudfront.net/media/asset1/index1_00007.ts
```

**Example : DASH 清单**  

```
<?xml version="1.0"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2013:xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" availabilityStartTime="2023-08-15T16:34:05.911Z" minBufferTime="PT30S" minimumUpdatePeriod="PT2S" profiles="urn:mpeg:dash:profile:isoff-live:2011" publishTime="2023-08-15T16:34:17.950Z" suggestedPresentationDelay="PT20S" timeShiftBufferDepth="PT1M30S" type="dynamic" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd">
  <Period xmlns="urn:mpeg:dash:schema:mpd:2011" id="1692117245944_1" start="PT0.033S">
    <BaseURL>https://aws.cloudfront.net/out/v1/abc/123/def/</BaseURL>
    <EventStream schemeIdUri="urn:scte:scte35:2013:xml" timescale="90000">
      <Event duration="900000">
        <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="0" tier="4095">
          <scte35:TimeSignal>
            <scte35:SpliceTime ptsTime="0"/>
          </scte35:TimeSignal>
          <scte35:SegmentationDescriptor segmentNum="0" segmentationDuration="900000" segmentationEventCancelIndicator="false" segmentationEventId="1" segmentationTypeId="56" segmentsExpected="0" subSegmentNum="0" subSegmentsExpected="0">
            <scte35:SegmentationUpid segmentationUpidFormat="hexBinary" segmentationUpidType="14">63736f7665726c6179</scte35:SegmentationUpid>
          </scte35:SegmentationDescriptor>
        </scte35:SpliceInfoSection>
      </Event>
    </EventStream>
    <AdaptationSet bitstreamSwitching="true" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
      <Representation bandwidth="3000000" codecs="avc1.4D4028" frameRate="30/1" height="1080" id="1" width="1920">
        <SegmentTemplate initialization="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_video_1_0_init.mp4" media="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_video_1_0_$Number$.mp4" presentationTimeOffset="0" startNumber="1" timescale="30000">
          <SegmentTimeline>
            <S d="60000" r="6" t="1000"/>
            <S d="30000" t="421000"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation bandwidth="2499968" codecs="avc1.4D4028" frameRate="30/1" height="1080" id="2" width="1920">
        <SegmentTemplate initialization="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_video_2_0_init.mp4" media="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_video_2_0_$Number$.mp4" presentationTimeOffset="0" startNumber="1" timescale="30000">
          <SegmentTimeline>
            <S d="60000" r="6" t="1000"/>
            <S d="30000" t="421000"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation bandwidth="2200000" codecs="avc1.4D401F" frameRate="30/1" height="720" id="3" width="1280">
        <SegmentTemplate initialization="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_video_3_0_init.mp4" media="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_video_3_0_$Number$.mp4" presentationTimeOffset="0" startNumber="1" timescale="30000">
          <SegmentTimeline>
            <S d="60000" r="6" t="1000"/>
            <S d="30000" t="421000"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <AdaptationSet lang="eng" mimeType="audio/mp4" segmentAlignment="0">
      <Label>Alternate Audio</Label>
      <Representation audioSamplingRate="48000" bandwidth="128000" codecs="mp4a.40.2" id="9">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
        <SegmentTemplate initialization="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_audio_9_0_init.mp4" media="../cf684d31ec9e451ca98d2349989f6c0a/855c733eed20493ab3cc1100750bcf0b/index_audio_9_0_$Number$.mp4" presentationTimeOffset="0" startNumber="1" timescale="48000">
          <SegmentTimeline>
            <S d="98304" t="0"/>
            <S d="96256" t="98304"/>
            <S d="95232" t="194560"/>
            <S d="96256" r="2" t="289792"/>
            <S d="95232" t="578560"/>
            <S d="46080" t="673792"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>
```

# 广告决策服务器 (ADS) 响应
<a name="overlay-ads-ads-response"></a>

ADS 响应必须包含一个有效的追踪事件。至少，跟踪事件可以是`Impression`跟踪事件。跟踪事件应至少包含一个`NonLinear`广告。此广告是叠加广告，采用静态、HTML 或 iFrame 资源的形式。

```
<vmap AdBreak breaktype="linear" breakId="csoverlay"
```

如果 VAST 响应是带有 `breakType` of 的 VMAP`nonlinear`，则可用元数据位于`nonLinearAvails`根对象内。如果 VAST 响应是带有 VMAP 的 VMA `breakType` P`linear`，或者是没有 VMAP 的普通 VAST 响应，则可用元数据位于`avails`根对象内。

以下 VAST 响应是一个封装的 VMAP 响应，其`breakType``linear`值为。

除了封装的 VMAP 响应外， MediaTailor 还支持`breakType`值为的封装 VMAP 响应和普通的 VAST 响应。`nonlinear`

```
<?xml version="1.0" encoding="utf-8"?>
<vmap:VMAP xmlns:vmap="http://www.iab.net/vmap-1.0" version="1.0">
  <vmap:AdBreak breakType="linear" breakId="csoverlay">
    <vmap:AdSource allowMultipleAds="true" followRedirects="true" id="1">
      <vmap:VASTAdData>
        <VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:noNamespaceSchemaLocation="vast.xsd">
          <Ad sequence="1">
            <InLine>
              <AdSystem>2.0</AdSystem>
              <AdTitle>2</AdTitle>
              <Impression><![CDATA[https://adserver.com/beacon=impression]]></Impression>
              <Creatives>
                <Creative>
                  <NonLinearAds>
                    <NonLinear width="640" height="360" id="18">
                      <StaticResource creativeType="text/js_ref"><![CDATA[https://client-side-ads.com/tags/static/ctv-generic/overlay001.json?iv_geo_country%3DUS%26]]></StaticResource>
                    </NonLinear>
                  </NonLinearAds>
                </Creative>
              </Creatives>
            </InLine>
          </Ad>
        </VAST>
      </vmap:VASTAdData>
    </vmap:AdSource>
    <vmap:TrackingEvents>
      <vmap:Tracking event="breakStart"><![CDATA[https://adserver.com/beacon=breakstartimpression]]></vmap:Tracking>
      <vmap:Tracking event="breakEnd"><![CDATA[https://adserver.com/beacon=breakendimpression]]></vmap:Tracking>
    </vmap:TrackingEvents>
  </vmap:AdBreak>
</vmap:VMAP>
```

**Example 1: DASH 清单来源到 MediaTailor**  

```
<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2013:xml" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" id="201" type="dynamic" publishTime="2022-11-07T19:59:05+00:00" minimumUpdatePeriod="PT2S" availabilityStartTime="2022-11-07T06:57:11.250000+00:00" minBufferTime="PT10S" suggestedPresentationDelay="PT20.000S" timeShiftBufferDepth="PT58.999S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
  <Period start="PT46827.601S" id="0" duration="PT88.321S">
  ...
  </Period>
  <Period start="PT46915.922S" id="45" duration="PT6.006S">
    <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2014:xml+bin">
    <Event duration="540000" id="144">
        <scte35:Signal>
            <scte35:Binary>SCTE35-binary</scte35:Binary>
        </scte35:Signal>
    </Event>
    </EventStream>
    ... 
  </Period>
  <Period start="PT46921.928S" id="49"> 
  ...
  </Period>
</MPD>
```

**Example 2：包含广告 ID 装饰的 MediaTailor 个性化 DASH 清单**  

```
<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2013:xml" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" id="201" type="dynamic" publishTime="2022-11-07T19:59:05+00:00" minimumUpdatePeriod="PT2S" availabilityStartTime="2022-11-07T06:57:11.250000+00:00" minBufferTime="PT10S" suggestedPresentationDelay="PT20.000S" timeShiftBufferDepth="PT58.999S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
  <Period start="PT46827.601S" id="0" duration="PT88.321S">
  ...
  </Period>
  <Period start="PT46915.922S" id="45" duration="PT6.006S">
  <EventStream schemeIdUri="urn:sva:advertising-wg:ad-id-signaling" timescale="90000">
    <Event presentationTime="13500000" duration="1351350">
    <![CDATA[{"version": 1,"identifiers": [{"scheme": "urn:smpte:ul:060E2B34.01040101.01200900.00000000","value": "adId","ad_position": "adId", "ad_type":"overlay","creative_id": "creativeId","tracking_uri": "trackingUri"}]}]]></Event>
  </EventStream>
  ...
  </Period>
  <Period start="PT46921.928S" id="49"> 
  ...
  </Period>
</MPD>
```

# 使用客户端元数据跟踪叠加广告
<a name="overlay-ads-client-side-tracking-metadata"></a>

MediaTailor 将叠加广告置于可`nonLinearAdsList`用的范围内。 MediaTailor 客户端跟踪 API 有两个根对象，名为`avails`和。`nonLinearAvails`如果 VAST 响应是带有 `breakType` of 的 VMAP`nonlinear`，则可用元数据位于`nonLinearAvails`根对象内。如果 VAST 响应是带有 VMAP 的 VMA `breakType` P`linear`，或者是没有 VMAP 的普通 VAST 响应，则可用元数据位于`avails`根对象内。

有关客户端跟踪的更多信息，请参阅[客户端广告跟踪](ad-reporting-client-side.md)。

以下示例显示了`breakType`值为的普通 VAST 响应或 VMAP 响应。`linear`

```
{
  "avails": [
    {
      "adBreakTrackingEvents": [
        {
          "beaconUrls": [
            "https://adserver.com/beacon=breakstartimpression"
          ],
          "eventType": "breakStart"
        },
        {
          "beaconUrls": [
            "https://adserver.com/beacon=breakendimpression"
          ],
          "eventType": "breakEnd"
        }
      ],
      "adMarkerDuration": null,
      "ads": [],
      "availId": "828",
      "availProgramDateTime": null,
      "duration": "PT0S",
      "durationInSeconds": 0,
      "meta": null,
      "nonLinearAdsList": [
        {
          "extensions": null,
          "nonLinearAdList": [
            {
              "adId": "",
              "adParameters": null,
              "adSystem": "2.0",
              "adTitle": "2",
              "apiFramework": null,
              "clickThrough": null,
              "clickTracking": null,
              "clickTrackingId": null,
              "creativeAdId": "",
              "creativeId": "18",
              "creativeSequence": "",
              "duration": null,
              "durationInSeconds": 0,
              "expandedHeight": null,
              "expandedWidth": null,
              "height": "360",
              "htmlResource": null,
              "iFrameResource": null,
              "maintainAspectRatio": false,
              "minSuggestedDuration": null,
              "scalable": false,
              "staticResource": "https://client-side-ads.com/tags/static/ctv-generic/overlay001.json?iv_geo_country%3DUS%26",
              "staticResourceCreativeType": "text/js_ref",
              "width": "640"
            }
          ],
          "trackingEvents": [
            {
              "beaconUrls": [
                "https://adserver.com/beacon=impression"
              ],
              "duration": null,
              "durationInSeconds": 0,
              "eventId": null,
              "eventProgramDateTime": null,
              "eventType": "impression",
              "startTime": null,
              "startTimeInSeconds": 0
            }
          ]
        }
      ],
      "startTime": "PT1M46.08S",
      "startTimeInSeconds": 106.08
    }
  ],
  "dashAvailabilityStartTime": null,
  "hlsAnchorMediaSequenceNumber": null,
  "nextToken": null,
  "nonLinearAvails": []
}
```

以下示例显示了`breakType`值为的普通 VMAP 响应。`nonlinear`

```
{
  "avails": [],
  "dashAvailabilityStartTime": null,
  "hlsAnchorMediaSequenceNumber": null,
  "nextToken": null,
  "nonLinearAvails": [
    {
      "adBreakTrackingEvents": [
        {
          "beaconUrls": [
            "https://adserver.com/beacon=breakstartimpression"
          ],
          "eventType": "breakStart"
        },
        {
          "beaconUrls": [
            "https://adserver.com/beacon=breakendimpression"
          ],
          "eventType": "breakEnd"
        }
      ],
      "adMarkerDuration": null,
      "ads": [],
      "availId": "828",
      "availProgramDateTime": null,
      "duration": "PT0S",
      "durationInSeconds": 0,
      "meta": null,
      "nonLinearAdsList": [
        {
          "extensions": null,
          "nonLinearAdList": [
            {
              "adId": "",
              "adParameters": null,
              "adSystem": "2.0",
              "adTitle": "2",
              "apiFramework": null,
              "clickThrough": null,
              "clickTracking": null,
              "clickTrackingId": null,
              "creativeAdId": "",
              "creativeId": "18",
              "creativeSequence": "",
              "duration": null,
              "durationInSeconds": 0,
              "expandedHeight": null,
              "expandedWidth": null,
              "height": "360",
              "htmlResource": null,
              "iFrameResource": null,
              "maintainAspectRatio": false,
              "minSuggestedDuration": null,
              "scalable": false,
              "staticResource": "https://client-side-ads.com/tags/static/ctv-generic/overlay001.json?iv_geo_country%3DUS%26",
              "staticResourceCreativeType": "text/js_ref",
              "width": "640"
            }
          ],
          "trackingEvents": [
            {
              "beaconUrls": [
                "https://adserver.com/beacon=impression"
              ],
              "duration": null,
              "durationInSeconds": 0,
              "eventId": null,
              "eventProgramDateTime": null,
              "eventType": "impression",
              "startTime": null,
              "startTimeInSeconds": 0
            }
          ]
        }
      ],
      "startTime": "PT1M46.08S",
      "startTimeInSeconds": 106.08
    }
  ]
}
```

# 中叠加广告的日志记录和指标 MediaTailor
<a name="overlay-ads-logging-and-metrics"></a>

本节介绍中叠加广告的日志记录和指标 MediaTailor。有关设置日志记录的更多信息，请参阅[监控和标记资源 AWS Elemental MediaTailor](monitoring.md)。

**Topics**
+ [CloudWatch 日志](#overlay-ads-logging-and-metrics-cloudwatch)
+ [CloudWatch 指标](#overlay-ads-logging-and-metrics-cloudwatch-metrics)

## CloudWatch 日志
<a name="overlay-ads-logging-and-metrics-cloudwatch"></a>

CloudWatch 收集有关叠加广告的以下日志信息：
+ `VAST_RESPONSE`-显示有关非线性广告列表的信息。
+ `FILLED_PROVIDER_OVERLAY`-显示有关非线性广告的信息。

**注意**  
`RAW_ADS_RESPONSE`是一个可选事件，显示来自 ADS 的原始响应。使用此事件在试运行和测试环境中特别有用。要在配置或账户上启用此事件，请向 Support 提交 AWS 工单。

## CloudWatch 指标
<a name="overlay-ads-logging-and-metrics-cloudwatch-metrics"></a>

MediaTailor 将叠加广告指标与其他广告指标分开收集。 MediaTailor成功从 ADS 获取广告后收集这些指标。您不必通过轮询 `GetTracking` API 来收集指标。

下表描述了叠加广告的 CloudWatch 指标：


| 指标 | 说明 | 
| --- | --- | 
| AdDecisionServer.OverlayAds |  在您指定的 CloudWatch 时间段内，ADS 响应中包含的叠加广告数量。  | 
| AdDecisionServer.OverlayErrors |  在您指定的时间段内从 ADS MediaTailor 收到的非 HTTP `200` 状态码响应、空响应和超 CloudWatch 时响应的数量。  | 
| AdDecisionServer.OverlayFilled |  成功填充至少一个叠加广告的可用数量： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/mediatailor/latest/ug/overlay-ads-logging-and-metrics.html) `SampleCount`跟踪已填充的可用数量。 `Sum`跟踪成功填充的叠加层可用数量。  | 
| AdDecisionServer.OverlayMinSuggestedDuration |  在您指定的`minSuggestedDuration`时间段内从 ADS MediaTailor 收到的所有广告 CloudWatch 的时长总和（以毫秒为单位）。如果`minSuggestedDuration`未指定，则显示的持续时间为计划持续时间。  | 
| AdDecisionServer.OverlayLatency |  向 ADS 发 MediaTailor 出的请求的响应时间，以毫秒为单位。  | 
| AdDecisionServer.OverlayTimeouts |  在您指定的时间段内向 ADS 发出的超 CloudWatch 时请求数。  | 
| AdsBilled |  有关广告收费的更多信息，请参阅[中叠加广告的计费 MediaTailor](overlay-ads-billing.md)。  | 
| Avail.\$1 |  因为 MediaTailor 没有为叠加广告做任何规划，所以 CloudWatch 不显示任何`Avail.X`指标。  | 
| SkippedReason.\$1 |  因为 MediaTailor 没有为叠加广告做任何规划，所以 CloudWatch 不显示任何`SkippedReason.X`指标。  | 

# 中叠加广告的计费 MediaTailor
<a name="overlay-ads-billing"></a>

MediaTailor 根据ADS响应中的非线性广告数量向客户开具账单。此数字包括超过中断时间的非线性广告。 MediaTailor 填写空缺后，它会为其填充的广告收费。

对于预取工作流程，在检索预取时 MediaTailor 不收取广告费用，而是在该会话的消费窗口中看到兼容的广告可用时。

有关其他账单信息，请参阅[https://aws.amazon.com/mediatailor/pricing/](https://aws.amazon.com/mediatailor/pricing/)。