ดูข้อมูลเกี่ยวกับสถาปัตยกรรม SDK
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คู่มือนี้จะให้ภาพรวมของวงจร SDK และการโต้ตอบ
ระหว่างวิดีโอเพลเยอร์, IMA SDK และเซิร์ฟเวอร์โฆษณา
การโต้ตอบพื้นฐาน
แผนภาพต่อไปนี้แสดงและอธิบายการโต้ตอบระหว่าง
วิดีโอเพลเยอร์, IMA SDK และเซิร์ฟเวอร์โฆษณา เซิร์ฟเวอร์โฆษณาสามารถใช้ Ad Manager, AdSense สำหรับวิดีโอ (AFV) หรือ Ad Exchange (AdX)

หน้าเว็บหรือแอปโหลด IMA SDK โดยใช้
- แท็กสคริปต์ที่ฝังสำหรับ HTML5
- แอปสำหรับ Android, Google Cast, iOS หรือ tvOS
IMA SDK ขอการตอบสนองด้วย VAST สำหรับหน่วยโฆษณาที่เฉพาะเจาะจงในเซิร์ฟเวอร์โฆษณา ระบบจะกำหนดเซิร์ฟเวอร์โฆษณาที่เรียกใช้ ซึ่งอาจเป็น Ad Manager เทียบกับ AFV หรือ AdX โดย URL ของแท็กโฆษณา
เซิร์ฟเวอร์โฆษณาจะเลือกโฆษณาที่ดีที่สุดและส่งการตอบสนองด้วย VAST ไปยัง IMA SDK
ระบบจะเลือกโฆษณาโดยใช้วิธีใดวิธีหนึ่งต่อไปนี้
- Ad Manager กรองผู้สมัครรับเลือกเป็นรายการโฆษณา
- AdSense หรือ Ad Exchange จะจัดการประมูล
IMA SDK จะแยกวิเคราะห์การตอบสนองด้วย VAST กำหนดประเภทสื่อที่ถูกต้องตามสภาพแวดล้อม และแสดงครีเอทีฟโฆษณาวิดีโอในหน้า (และโฆษณาที่แสดงร่วม หากจำเป็น) ในหน้าเว็บหรือแอป
วิดีโอเพลเยอร์จะเจรจารายละเอียดการเล่นกับ IMA SDK และเล่นโฆษณา
IMA SDK จะเริ่มการทำงานของคำสั่ง ping การแสดงผลและเหตุการณ์การติดตาม VAST ตามที่จำเป็น
อายุการใช้งาน
แผนภาพนี้แสดงวงจรการใช้งานทั้งหมดของ IMA SDK การเรียกใช้ตัวสร้างและเมธอด
จะไฮไลต์เป็นสีน้ำเงิน ส่วนเหตุการณ์จะไฮไลต์เป็นสีแดง และเงื่อนไขข้อผิดพลาด
จะแสดงด้วยตัวเชื่อมต่อสีแดงและข้อความสีแดง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThis guide explains the lifecycle of the Interactive Media Ads (IMA) SDK and how it facilitates communication between your video player, the SDK, and an ad server (Ad Manager, AdSense for Video, or Ad Exchange).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves the IMA SDK requesting ads from the ad server based on the provided ad tag URL, the ad server selecting and sending a VAST response, and the SDK parsing this response to deliver ads to the video player.\u003c/p\u003e\n"],["\u003cp\u003eThe video player then handles ad playback while the IMA SDK manages tracking events like impressions and VAST events for reporting purposes.\u003c/p\u003e\n"],["\u003cp\u003eThis guide also visually illustrates the entire IMA SDK lifecycle including constructor calls, method calls, events, and potential errors.\u003c/p\u003e\n"]]],[],null,["Select platform: [HTML5](/interactive-media-ads/docs/sdks/html5/client-side/architecture \"View this page for the HTML5 platform docs.\") [Android](/interactive-media-ads/docs/sdks/android/client-side/architecture \"View this page for the Android platform docs.\") [iOS](/interactive-media-ads/docs/sdks/ios/client-side/architecture \"View this page for the iOS platform docs.\") [tvOS](/interactive-media-ads/docs/sdks/tvos/client-side/architecture \"View this page for the tvOS platform docs.\")\n\n\u003cbr /\u003e\n\nThis guide provides an overview of the SDK lifecycle and the interactions\nbetween your video player, the IMA SDK, and an ad server.\n\nBasic interactions\n\nThe following diagram illustrates and annotates the interactions between\nyour video player, the IMA SDK, and an ad server. The ad server can use\nAd Manager, AdSense for Video (AFV), or Ad Exchange (AdX).\n\n1. The web page or app loads the IMA SDK using:\n\n - an embedded script tag for HTML5\n - an app for Android, Google Cast, iOS, or tvOS\n2. The IMA SDK requests a VAST Response for the specific Ad Unit on the ad\n server. The ad server called, which can be either Ad Manager versus AFV or\n AdX, is determined by the ad tag URL.\n\n3. The ad server selects the best ad and sends a VAST response to the IMA SDK.\n Ads are selected using one of the following methods:\n\n - Ad Manager Ad Unit filters Line Item candidates\n - AdSense or Ad Exchange runs an auction\n4. The IMA SDK parses the VAST response, determines the correct media type based\n on environment, and delivers the inline video creative (and\n companion ads if needed) to the web page or app.\n\n5. The video player negotiates the playback details with the IMA SDK and plays\n the ads.\n\n6. The IMA SDK fires an impression ping and VAST tracking events, as needed.\n\nLifecycle\n\nThis diagram shows the full lifecycle of the IMA SDK. Constructor and method\ncalls are highlighted in blue, events are highlighted in red, and error\nconditions are shown with red connectors and red text."]]