[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[],[],null,["# Ad metadata\n\nThis guide describes the supported ad metadata feature of the\nVideo Stitcher API. Ad metadata is extracted from a VAST ad in an ad tag\nresponse, containing ad tracking events and companion ads. The ad tag url is\nconfigured in the session creation request. For more information, see\n[Manage a live session](/video-stitcher/docs/how-to/managing-live-sessions) and\n[Manage a VOD session](/video-stitcher/docs/how-to/managing-vod-sessions).\n\nBefore you begin\n----------------\n\nMake sure you are familiar with the introductory concepts and terminology in the\nVideo Stitcher API. For more information, see the technical\n[overview](/video-stitcher/docs/concepts/overview).\n\nIntroduction\n------------\n\nAd metadata contains ad tracking events and companion ads associated with a\nstitched ad. An ad tracking event contains a callback ping used to track the VAST ad\nand viewer interaction. A companion ad is an ad to supplement the parent VAST\nad. In client-side tracking mode, you are responsible to trigger events based on\nthe viewer's behavior.\n\nServer-side ad tracking\n-----------------------\n\nIn server-side tracking mode, each ad segment URI is wrapped in a\nredirect URI and the Video Stitcher API will handle the processing of progress\nevents whenever the player requests those segments. However, activity events,\nsuch as `pause`, are not handled by the Video Stitcher API.\n\nClient-side ad tracking\n-----------------------\n\nIn client-side tracking mode, the client is responsible for triggering the\nevents. For more details, see the [event documentation](/video-stitcher/docs/reference/rest/v1/Event).\n\nProgress events are events that should be triggered when the specified time has\nelapsed during the ad. For example, event `Start` should be triggered at the\nbeginning of the ad. For more details about progress events, see the\n[progress event object](/video-stitcher/docs/reference/rest/v1/ProgressEvent).\n\nActivity events are events that should be triggered when a viewer conducts a\nspecific activity. For example, event `pause` should be triggered when the\nviewer pauses the ad video. For more details about activity events, see the\n[activity event object](/video-stitcher/docs/reference/rest/v1/Event).\n\n### VOD client-side ad tracking\n\nAn interstitials object is returned in the response of a VOD session create\nrequest. For instruction on how to create a VOD session, see how to\n[create a VOD session](/video-stitcher/docs/how-to/managing-vod-sessions#create-session).\n\nInterstitials contains the metadata for each inserted ad. When client ad\ntracking mode is enabled, the client is responsible for triggering tracking\nevents when necessary. For more details, see the\n[interstitials object](/video-stitcher/docs/reference/rest/v1/Interstitials).\n\n### Live client-side ad tracking\n\nThe Video Stitcher API continuously inserts ads into a livestream; ad\nmetadata information is generated whenever a new ad is inserted.\n\nFor HLS, the `AdMetadataURI` to fetch ad metadata can be found in the\n`#EXT-X-DATERANGE` tag.\n\nFor DASH, the `AdMetadataURI` to fetch ad metadata can be found in the\n`\u003cEventStream\u003e` element for each `\u003cPeriod\u003e` element.\n\nFor more details, see [how to handle live client-side tracking](/video-stitcher/docs/how-to/managing-live-sessions#handle-client-side-ad-tracking).\n\nCompanion ads\n-------------\n\nCompanion ads are supplemental ads that may appear along with inserted linear\nads. For more details, see the [companion ads object](/video-stitcher/docs/reference/rest/v1/CompanionAds).\n\nWhat's next\n-----------\n\n- Learn how to complete specific [Video Stitcher API tasks](/video-stitcher/docs/how-to)."]]