הסבר על הארכיטקטורה של ה-SDK
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בחירת פלטפורמה:
HTML5
Android
iOS
tvOS
במדריך הזה מוסבר על מחזור החיים של ה-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 מפעיל פינג של חשיפה ואירועי מעקב של VAST, לפי הצורך.
מחזור חיים
בתרשים הזה מוצג מחזור החיים המלא של IMA SDK. קריאות לבונה ולשיטה מודגשות בכחול, אירועים מודגשים באדום ותנאי שגיאה מוצגים עם מחברים אדומים וטקסט אדום.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[[["\u003cp\u003eThis guide outlines the lifecycle of the Interactive Media Ads (IMA) SDK and how it interacts with your video player and an ad server (Ad Manager, AdSense for Video, or Ad Exchange).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves the IMA SDK requesting and parsing ad responses, delivering ads to the player, and managing playback and tracking events.\u003c/p\u003e\n"],["\u003cp\u003eAd selection is handled either through Ad Manager's Ad Unit filters or via auctions in AdSense or Ad Exchange.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers integrate the IMA SDK using script tags for HTML5 or dedicated apps for various platforms including Android, iOS, and tvOS.\u003c/p\u003e\n"],["\u003cp\u003eThe guide also highlights potential error conditions within the SDK lifecycle.\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."]]