Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Sunucu yönlendirmeli reklam ekleme (SGAI), istemci cihazlarda birleştirilmeye hazır bir reklam kapsülü manifesti sağlar. Google Ad Manager ağınızdaki kapsül sunma DAI'sini etkinleştirdiyseniz SGAI'yi kullanabilirsiniz. Kapsül Yayınlama DAI'nız etkin değilse hesap yöneticinizle iletişime geçin.
SGAI ile, reklam meta verilerini ve reklam kapsülü manifestlerini almak için bir akış oluşturmak üzere Pod yayınlama API uç noktalarını kullanırsınız.
Bir manifest değiştirme sunucunuz varsa tercih ettiğiniz spesifikasyona göre reklam kapsülü manifest URL'lerini oluşturabilir ve reklam kapsülü manifest bilgilerini içerik akışınıza taşıyan reklam işaretçileri ekleyebilirsiniz.
Alternatif olarak, yayın manifestindeki reklam işaretçilerinden farklı bir mekanizma kullanarak reklam arası planlayabilirsiniz. Bu durumlarda uygulamanız, kullanıcının akışla, uygulamayla veya push bildirimle etkileşimi gibi diğer etkinlikleri dinleyebilir. Bu etkinliklerden sonra uygulama, reklam kapsülü manifest URL'lerini oluşturabilir ve oynatıcıya reklam kapsülü manifestini yüklemeye başlamasını söyleyebilir.
Ön koşullar
Devam etmeden önce aşağıdakilere sahip olduğunuzdan emin olun:
Google Ad Manager ağınızda DAI kapsülü yayınlama etkinleştirildi.
Kapsül yayınlama manifesti türüne sahip bir canlı yayın etkinliği. Etkinliği oluşturmak için DAI için canlı yayın oluşturma başlıklı makaleyi inceleyin.
Üretim ve test akışları için EABN API'yi çağırın. Özellikle reklam ağınız programlı kampanyalara sahipse bunu yapın. Daha fazla bilgi için Programatik Doğrudan özellikleri ve yönergeleri başlıklı makaleyi inceleyin.
Akış kaydı isteği gönderme
Bir kullanıcı video oynatıcı uygulamanızda içerik akışı başlattığında, Ad Manager'da bir akış oturumu oluşturmak için hedefleme parametrelerini içeren bir akış kaydı isteği gönderirsiniz. Akış kaydı isteği gönderme hakkında ayrıntılı bilgi için Method:stream bölümüne bakın.
Ardından, istek üzerinden yanıt verilerini alırsınız.
Aşağıdaki örneklerde bir yayın kaydı isteği gönderilmektedir:
Akış kaydı isteği gönderdikten sonra reklam meta verilerini sorgulayın. Anket yapmak için, kayıt adımında reklam metadata çağırmak üzere akış yanıtında polling_frequence kullanarak bir zamanlayıcı ayarlarsınız.
Her anket için, meta verileri kullanıma sunulduğunda reklamların kısmi bir listesini alabilirsiniz.
Reklam kapsülü manifest URL'sini oluşturma
Kapsül Yayınlama API'sinin kapsül kaynağı için bir URL oluşturun. Ardından, reklam kapsülünü yüklemeye başlamak için URL'yi bir video oynatıcıya iletin.
Aşağıdaki örnekte, reklam kapsülü manifest URL'sinin yapısı gösterilmektedir:
Reklam kapsülü manifest URL parametrelerini, video oynatıcıdan veya sunucu bildiriminden alınan reklam arası bilgilerine göre hesaplayabilirsiniz. Bu parametrelerin koşulları için Yöntem: pod manifesti bölümüne bakın.
Reklam kapsülü manifestini oynatma
İstemci video oynatıcı uygulamasında, birincil video oynatıcıyla içerik akışı oynatmaya başlayın ve video oynatıcınızın oynatma ve reklam zamanlamasını gözlemlemeyle ilgili dokümanlarını inceleyin (varsa).
Reklam kapsülü manifesti URL'lerini oluşturup bunları sunucu tarafındaki manifest'e eklerseniz video oynatıcının yaklaşan reklam arası etkinliklerini gözlemleyin ve her reklam arası oynatma sırasında id3 etkinliklerine abone olduğunuzdan emin olun. Reklam arası etkinliklerini istemci tarafında planlıyorsanız oluşturma sırasında id3 etkinliklerine abone olun.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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."]]