서버 가이드 광고 삽입 (SGAI)은 클라이언트 기기에서 병합할 준비가 된 광고 모음 매니페스트를 제공합니다. Google Ad Manager 네트워크에서 Pod Serving DAI를 사용 설정한 경우 SGAI를 사용할 수 있습니다. Pod Serving DAI가 사용 설정되어 있지 않으면 계정 관리자에게 문의하세요.
SGAI를 사용하면 광고 메타데이터 및 광고 포드 매니페스트를 검색하는 스트림을 만들 때 포드 게재 API 엔드포인트를 사용합니다.
매니페스트 조작 서버가 있는 경우 원하는 사양에 따라 광고 모음 매니페스트 URL을 생성하고 콘텐츠 스트림에 광고 모음 매니페스트 정보를 전달하는 광고 마커를 삽입할 수 있습니다.
또는 스트림 매니페스트의 광고 마커가 아닌 다른 메커니즘을 사용하여 광고 시점을 예약할 수 있습니다. 이 경우 앱은 스트림, 앱 자체 또는 푸시 알림과의 사용자 상호작용과 같은 다른 이벤트를 수신 대기할 수 있습니다. 이러한 이벤트가 발생하면 앱은 광고 모음 매니페스트 URL을 생성하고 플레이어에게 광고 모음 매니페스트 로드를 시작하도록 지시할 수 있습니다.
기본 요건
계속하기 전에 다음 사항을 확인하세요.
Google Ad Manager 네트워크에서 DAI 광고 모음 게재가 사용 설정되어 있습니다.
유형이 광고 모음 게재 매니페스트인 라이브 스트림 이벤트입니다. 이벤트를 만들려면 DAI용 라이브 스트림 설정하기를 참고하세요.
프로덕션 및 테스트 스트림의 경우, 특히 광고 네트워크에 프로그래매틱 캠페인이 있는 경우 EABN API를 호출합니다. 자세한 내용은 프로그래매틱 다이렉트 기능 및 가이드라인을 참고하세요.
스트림 등록 요청
사용자가 동영상 플레이어 앱에서 콘텐츠 스트림을 시작하면 타겟팅 매개변수를 사용하여 스트림 등록 요청을 실행하여 Ad Manager에서 스트리밍 세션을 만듭니다. 스트림 등록 요청에 관한 자세한 내용은 Method:stream을 참고하세요.
그런 다음 요청에서 응답 데이터를 수신합니다.
동영상 플레이어 또는 서버 알림에서 가져온 광고 시점 정보를 기반으로 광고 모음 매니페스트 URL 매개변수를 계산할 수 있습니다. 이러한 매개변수의 요구사항은 메서드: 포드 매니페스트를 참고하세요.
광고 포드 매니페스트 재생
클라이언트 동영상 플레이어 앱에서 기본 동영상 플레이어로 콘텐츠 스트림 재생을 시작하고 재생 및 광고 일정을 준수하는 방법에 관한 동영상 플레이어 문서를 따릅니다(해당하는 경우).
광고 모음 매니페스트 URL을 생성하고 서버 측의 매니페스트에 삽입하는 경우 동영상 플레이어의 예정된 광고 시점 이벤트를 관찰하고 각 광고 시점 재생 중에 id3 이벤트를 구독해야 합니다. 클라이언트 측에서 광고 시점 이벤트를 예약하는 경우 생성 시 id3 이벤트를 구독합니다.
노출 및 광고 이벤트 보고
동영상 플레이어가 광고 모음을 재생하고 ID3 시간 메타데이터를 발견하면 동영상 플레이어가 트리거하는 광고 이벤트를 수신하고 이를 처리하여 미디어 인증 핑을 전송합니다.
[null,null,["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eServer Guided Ad Insertion (SGAI) requires Pod Serving DAI to be enabled in your Google Ad Manager network, allowing for the creation and retrieval of ad metadata and ad pod manifests via Pod serving API endpoints.\u003c/p\u003e\n"],["\u003cp\u003eAd pod manifest URLs can be generated and inserted into your content stream using a manifest manipulation server, or alternatively, your app can trigger ad breaks based on events such as user interaction or push notifications.\u003c/p\u003e\n"],["\u003cp\u003eBefore generating ad pod manifest URLs, it's recommended to utilize the Early Ad Break Notification (EABN) API to specify ad break parameters, especially for production and test streams with programmatic campaigns.\u003c/p\u003e\n"],["\u003cp\u003eUpon a user initiating a content stream, a stream registration request with targeting parameters is required to create a streaming session on Ad Manager, which will then return response data including metadata and polling frequency.\u003c/p\u003e\n"],["\u003cp\u003eAfter making a stream registration, use the provided \u003ccode\u003epolling_frequency\u003c/code\u003e to poll for ad metadata and generate the ad pod manifest URL, which is then passed to a video player to start loading the ad pod, and remember to report impressions and ad events by listening to ad events and sending media verification pings.\u003c/p\u003e\n"]]],[],null,["# Get started with SGAI for livestream\n\nServer guided ad insertion (SGAI) provides an ad pod manifest ready for\nstitching on client devices. If you have enabled Pod Serving DAI in your Google\nAd Manager network, you have access to use SGAI. If you don't have Pod Serving\nDAI enabled, contact your account manager.\n\nWith SGAI, you use the Pod serving API endpoints for creating a stream\nretrieving ad metadata and the ad pod manifests.\n\nIf you have a manifest manipulation server, you can generate the ad pod\nmanifest URLs and insert ad markers that carry the ad pod manifest information\nin your content stream, according to your preferred specification.\n\nAlternatively, you can schedule an ad break using a different mechanism other\nthan the ad markers in the stream manifest. In these cases, your app can listen\nto other events, for example, user interaction with the stream, the app itself,\nor a push notification. After these events, the app can generate the ad\npod manifest URLs and tell the player to begin loading the ad pod manifest.\n\nPrerequisites\n-------------\n\nBefore continuing, ensure you have the following:\n\n- The DAI Pod serving enabled on your Google Ad Manager network.\n- A livestream event with type **Pod serving manifest** . To create the event, see [Set up a livestream for DAI](//support.google.com/admanager/answer/7294289).\n\n### Follow recommendations\n\nBefore you\n[generate the ad pod manifest URL](#generate-ad-pod-manifest-url), we recommend\nyou call the\n[Early Ad Break Notification (EABN) API](/ad-manager/dynamic-ad-insertion/api/eabn)\nto specify the expected duration, targeting information, and other\nparameters of each ad break.\n\nFor production and test streams, call the EABN API, especially if your ad\nnetwork has any programmatic campaigns. For more information, see\n[Features and guidelines for Programmatic Direct](//support.google.com/admanager/answer/9345607).\n\nMake a stream registration request\n----------------------------------\n\nWhen a user starts a content stream in your video player app, you make a stream\nregistration request with targeting parameters to create a streaming session\non Ad Manager. For details on making a stream registration request, see\n[Method:stream](/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#method_stream).\nAfterwards, you receive\n[response data](/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#stream)\nfrom the request.\n\nThe following examples make a stream registration request: \n\n### Plain text HTTP\n\n- Request:\n\n authority: dai.google.com\n method: POST\n path: /ssai/pods/api/v1/network/51636543/custom_asset/hls-podserving-manifest/stream\n scheme: https\n content-type: application/x-www-form-urlencoded\n\n cust_params=customID%253D1543216789%2526anotherKey%253Dvalue1%252Cvalue2\n\n- Response:\n\n {\n \"manifest_format\": \"hls\",\n \"media_verification_url\": \"https://dai.google.com/view/p/service/linear/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/loc/TUL/network/51636543/event/TFyZF0IoSpqvCLtLv8JdCw/media/\",\n \"metadata_url\": \"https://dai.google.com/linear/pods/hls/pa/event/TFyZF0IoSpqvCLtLv8JdCw/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/metadata\",\n \"polling_frequency\": 10,\n \"session_update_url\": \"https://dai.google.com/linear/v1/pa/event/TFyZF0IoSpqvCLtLv8JdCw/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/session\",\n \"stream_id\": \"24fd4e7c-95a0-42be-8874-00625139b9db:TUL\"\n }\n\n### Shell\n\n- Command line:\n\n curl \\\n -H \"Host: dai.google.com\" \\\n -H \"content-type: application/x-www-form-urlencoded\" \\\n --data-binary \"cust_params=channelID%253D1543216789%2526anotherKey%253Dvalue1%252Cvalue2\" \\\n --compressed \"https://dai.google.com/ssai/pods/api/v1/network/51636543/custom_asset/hls-podserving-manifest/stream\"\n\n- Output:\n\n {\n \"manifest_format\": \"hls\",\n \"media_verification_url\": \"https://dai.google.com/view/p/service/linear/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/loc/TUL/network/51636543/event/TFyZF0IoSpqvCLtLv8JdCw/media/\",\n \"metadata_url\": \"https://dai.google.com/linear/pods/hls/pa/event/TFyZF0IoSpqvCLtLv8JdCw/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/metadata\",\n \"pod_manifest_url\": \"https://dai.google.com/linear/pods/v1/hls/event/TFyZF0IoSpqvCLtLv8JdCw/pod/$pod-id$.m3u8?stream_id=24fd4e7c-95a0-42be-8874-00625139b9db%3ATUL\",\n \"polling_frequency\": 10,\n \"session_update_url\": \"https://dai.google.com/linear/v1/pa/event/TFyZF0IoSpqvCLtLv8JdCw/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/session\",\n \"stream_id\": \"24fd4e7c-95a0-42be-8874-00625139b9db:TUL\"\n }\n\n### Javascript\n\n- Using Fetch API:\n\n const response = await fetch(\"https://dai.google.com/ssai/pods/api/v1/network/51636543/custom_asset/hls-podserving-manifest/stream\", {\n \"headers\": {\n \"content-type\": \"application/x-www-form-urlencoded\",\n },\n \"body\": \"cust_params=channelID%3D1543216789%26anotherKey%3Dvalue1%2Cvalue2\",\n \"method\": \"POST\",\n });\n\n const stream = await response.json();\n console.log(stream);\n\n- Console log:\n\n {\n \"stream_id\": \"24fd4e7c-95a0-42be-8874-00625139b9db:TUL\",\n \"media_verification_url\": \"https://dai.google.com/view/p/service/linear/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/loc/TUL/network/51636543/event/TFyZF0IoSpqvCLtLv8JdCw/media/\",\n \"metadata_url\": \"https://dai.google.com/linear/pods/hls/pa/event/TFyZF0IoSpqvCLtLv8JdCw/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/metadata\",\n \"session_update_url\": \"https://dai.google.com/linear/v1/pa/event/TFyZF0IoSpqvCLtLv8JdCw/stream/24fd4e7c-95a0-42be-8874-00625139b9db:TUL/session\",\n \"polling_frequency\": 10,\n \"pod_manifest_url\": \"https://dai.google.com/linear/pods/v1/hls/event/TFyZF0IoSpqvCLtLv8JdCw/pod/$pod-id$.m3u8?stream_id=24fd4e7c-95a0-42be-8874-00625139b9db%3ATUL\",\n \"manifest_format\": \"hls\"\n }\n\nPoll for ad break metadata\n--------------------------\n\nAfter you make a stream registration request, poll for the ad metadata. To\npoll, you set a timer using the `polling_frequence` in the stream response at\nthe registration step to call the ad\n[metadata](/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#method_metadata).\nFor each poll, you might receive a partial list of ads with metadata as they\nbecome available.\n\nGenerate the ad pod manifest URL\n--------------------------------\n\nConstruct a URL for the\n[pod resource](/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#method_pod_manifest)\nof the Pod Serving API. Afterwards, pass the URL to a video player to start\nloading the ad pod.\n\nThe following example demonstrates the structure of the ad pod manifest URL: \n\n https://dai.google.com/linear/pods/v1/hls/network/51636543/custom_asset/pod_serving_hls_manifest_mp4/ad_break_id/ab101.m3u8?stream_id=24fd4e7c-95a0-42be-8874-00625139b9db:TUL&pd=120000\n\n| **Note:** The ad break parameters, such as `ad_break_id`, `duration`, `cust_params` and `scte35` must be the same for all clients watching the same livestream, while the stream ID is unique for each client. If you choose to generate the ad pod manifest URL on the server side and insert the generated URLs in the stream manifest, follow your manifest manipulator server documentation on sending the stream ID from the clients and generate the other ad break parameters.\n\nYou can calculate the ad pod manifest URL parameters based on the ad break\ninformation retrieved from the video player or a server notification. For\nrequirements of these parameters, see\n[Method: pod manifest](/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#method_pod_manifest).\n\nPlay the ad pod manifest\n------------------------\n\nOn the client video player app, begin content stream playback with a primary\nvideo player and follow your video player's documentation on observing the\nplayback and ad schedule, if relevant.\n\nIf you generate the ad pod manifest URLs and insert those in the manifest on the\nserver side, observe the video player's upcoming ad break events, and ensure to\nsubscribe to id3 events during each ad break playback. If you schedule the ad\nbreak events from the client side, subscribe to the id3 events on creation.\n\nReport impressions and ad events\n--------------------------------\n\nWhen a video player plays the ad pod and encounters id3 timed metadata,\n[listen to ad events](/ad-manager/dynamic-ad-insertion/api/pod-serving/live/client#listen_for_ad_events)\nthat the video player triggers and process them to\n[send media verification pings](/ad-manager/dynamic-ad-insertion/api/pod-serving/live/client#send_media_verification_pings).\n| **Important:** Don't delay the ping to the media verification URL. We recommend you ping immediately and not longer than one minute."]]