เปิดใช้การวัดผลแบบเปิด
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
IMA SDK สําหรับ HTML5 มี Open Measurement (OM) SDK ซึ่งเป็นมาตรฐานอุตสาหกรรมที่พัฒนาโดย Interactive Advertising Bureau (IAB) เพื่อเปิดใช้การวัดการมองเห็นโฆษณาและการยืนยันของบุคคลที่สาม เมื่อใช้ IMA SDK สําหรับ HTML5 ทาง OM SDK ที่รวมอยู่จะแยกวิเคราะห์แท็ก <AdVerifications>
ภายในแท็กโฆษณา VAST โดยอัตโนมัติ และส่งข้อมูลการมองเห็นโฆษณาไปยังผู้ให้บริการการวัดที่ระบุโดยใช้ OMID API คุณเลือกที่จะตั้งกฎโหมดการเข้าถึงสำหรับคำขอแต่ละรายการเพื่อควบคุมเนื้อหาที่สคริปต์การยืนยันเข้าถึงได้
IMA SDK รองรับ OM SDK v1.4
ข้อกำหนดเบื้องต้น
หากใช้ VAST 4.1 ขึ้นไป คุณต้องกําหนดค่าโฆษณาให้ระบุการยืนยันโดยใช้ <AdVerifications>
หากใช้ VAST เวอร์ชันก่อนหน้า โฆษณาต้องใช้
<Extension type="AdVerifications">
หากโฆษณาได้รับการเข้าชมผ่าน Ad Manager ให้กําหนดค่าผู้ให้บริการด้านการมองเห็นโฆษณาสําหรับเครือข่าย Ad Manager และมอบหมายผู้ให้บริการด้านการมองเห็นโฆษณานั้นให้กับรายการโฆษณา ดูข้อมูลเพิ่มเติมได้ที่หัวข้อกําหนดค่าผู้ให้บริการด้านการมองเห็นโฆษณาสําหรับเครือข่าย Ad Manager
โหมดการเข้าถึง
OM SDK รองรับการเรียกใช้สคริปต์การยืนยันในโหมดการเข้าถึง 4 โหมดที่แตกต่างกัน ซึ่งควบคุมระดับการเข้าถึงของสคริปต์การยืนยัน ดังนี้
FULL
: สคริปต์การยืนยันมีสิทธิ์เข้าถึงครีเอทีฟโฆษณาและหน้าผู้เผยแพร่โฆษณาโดยตรง
CREATIVE
: สคริปต์การยืนยันและครีเอทีฟโฆษณาจะอยู่ในแซนด์บ็อกซ์จากหน้าผู้เผยแพร่โฆษณา แต่สคริปต์มีสิทธิ์เข้าถึงครีเอทีฟโฆษณาโดยตรง
LIMITED
: สคริปต์การยืนยันอยู่ในแซนด์บ็อกซ์และไม่สามารถเข้าถึงครีเอทีฟโฆษณาหรือหน้าผู้เผยแพร่โฆษณา และไม่สามารถยืนยันได้โดยตรงว่าอยู่ในโดเมนของผู้เผยแพร่โฆษณาใด
ผู้ให้บริการการมองเห็นโฆษณาบางรายอาจไม่รองรับโหมดการเข้าถึงบางโหมด โปรดติดต่อผู้ให้บริการการมองเห็นเพื่อยืนยันว่ารองรับโหมดใดบ้าง ก่อนหน้านี้ IMA รองรับโหมดการเข้าถึง DOMAIN
ซึ่งตอนนี้จะเปลี่ยนเป็นโหมด LIMITED
โดยค่าเริ่มต้น
ตั้งกฎโหมดการเข้าถึงสำหรับคำขอ
คุณต้องตั้งค่ากฎโหมดการเข้าถึงที่ระดับ
StreamRequest
หากต้องการตั้งค่าโหมดการเข้าถึงที่แตกต่างกันสำหรับผู้ให้บริการสคริปต์การยืนยันที่แตกต่างกัน ให้ส่งพจนานุกรมที่แมปOmidVerificationVendor
แต่ละรายการกับโหมดการเข้าถึงรายการใดรายการหนึ่งตามที่ระบุไว้ข้างต้น ช่อง OmidVerificationVendor.OTHER
ใช้เพื่อตั้งค่าโหมดการเข้าถึงเริ่มต้นสำหรับผู้ให้บริการทั้งหมดที่ไม่ได้ระบุไว้ในพจนานุกรมอย่างชัดเจน หากไม่ได้ระบุกฎโหมดการเข้าถึง สคริปต์การยืนยันจะทำงานในโหมดการเข้าถึง LIMITED
สำหรับผู้ให้บริการ
ดูตัวอย่างต่อไปนี้ซึ่งตั้งค่า GOOGLE
เป็น
google.ima.dai.api.OmidAccessMode.FULL
ผู้ให้บริการรายอื่นๆ ทั้งหมด รวมถึงผู้ให้บริการที่ระบุไว้ในOmidVerificationVendor
จะตั้งค่าตามวิธีตั้งค่า OmidVerificationVendor.OTHER
โดยค่าเริ่มต้น
request.omidAccessModeRules = {};
request.omidAccessModeRules[google.ima.dai.api.OmidVerificationVendor.GOOGLE]
= google.ima.dai.api.OmidAccessMode.FULL;
request.omidAccessModeRules[google.ima.dai.api.OmidVerificationVendor.OTHER]
= google.ima.dai.api.OmidAccessMode.LIMITED;
หากต้องการใช้โหมดการเข้าถึง CREATIVE
คุณต้องทําตามทั้ง 2 ขั้นตอนต่อไปนี้
วางโปรแกรมเล่นวิดีโอใน iframe ที่ปลอดภัยซึ่งแยกออกจากส่วนอื่นๆ ของเว็บไซต์
ตั้งค่า OmidAccessMode
ของพาร์ทเนอร์ด้านการแสดงผลโฆษณาเป็น FULL
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThe IMA SDK for HTML5 utilizes the Open Measurement (OM) SDK for third-party viewability and verification measurement, automatically sending data to specified vendors.\u003c/p\u003e\n"],["\u003cp\u003eAds must be configured to use \u003ccode\u003e<AdVerifications>\u003c/code\u003e tags within VAST for the OM SDK to function correctly.\u003c/p\u003e\n"],["\u003cp\u003eFour access modes (FULL, CREATIVE, DOMAIN, LIMITED) control the level of access verification scripts have to creative content and publisher pages.\u003c/p\u003e\n"],["\u003cp\u003eAccess mode rules are set at the \u003ccode\u003eStreamRequest\u003c/code\u003e level and can be customized for different verification vendors.\u003c/p\u003e\n"],["\u003cp\u003eImplementing \u003ccode\u003eCREATIVE\u003c/code\u003e access mode requires sandboxing the video player in a secure iframe and setting the \u003ccode\u003eOmidAccessMode\u003c/code\u003e to \u003ccode\u003eFULL\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["The IMA SDK for HTML5 includes the\n[Open Measurement (OM) SDK](//iabtechlab.com/standards/open-measurement-sdk/),\nan industry standard developed by the\n[Interactive Advertising Bureau (IAB)](//www.iab.com/) to enable third-party\nviewability and verification measurement. When using the IMA SDK for HTML5, the\nincluded OM SDK automatically parses the `\u003cAdVerifications\u003e` tag within VAST ad\ntags and sends viewability data to the specified measurement vendors using the\nOMID API. You can optionally set access mode rules for each request to control\nwhat content the verification script can access.\n\nThe IMA SDK supports OM SDK v1.4.\n\nPrerequisites\n\n- If using VAST 4.1 or higher, ads must be configured to supply verification\n using `\u003cAdVerifications\u003e`. If using previous VAST versions, ads must use\n `\u003cExtension type=\"AdVerifications\"\u003e`.\n\n- If your ads are trafficked through Ad Manager, configure a viewability\n provider for your Ad Manager network and assign that viewability provider to\n your line item. For more information, see\n [Configure a viewability provider for your Ad Manager network](//support.google.com/admanager/answer/9025968#configure-a-viewability-provider).\n\nAccess modes\n\nThe OM SDK supports running verification scripts in four different access modes\nwhich controls how much the verification script can access:\n\n- `FULL`: The verification script has direct access to the creative and the\n publisher page.\n\n- `CREATIVE`: The verification script and creative are sandboxed from the\n publisher page. However, the script has direct access to the creative.\n\n- `LIMITED`: The verification script is sandboxed and cannot access the creative\n or publisher page, and cannot directly confirm what publisher domain it is on.\n\nSome viewability providers might not support all access modes. Contact your\nviewability providers to verify which modes are supported. Previously, IMA\nsupported a `DOMAIN` access mode, which now defaults to `LIMITED` mode.\n\nSet the access mode rules for a request\n\n\u003cbr /\u003e\n\nAccess mode rules must be set at the\n[`StreamRequest`](/interactive-media-ads/docs/sdks/html5/dai/reference/js/StreamRequest#omidAccessModeRules)\nlevel. To set different access modes for different verification script\nproviders, pass a dictionary that maps each\n[`OmidVerificationVendor`](/interactive-media-ads/docs/sdks/html5/dai/reference/js/global#OmidVerificationVendor)\nto one of the access modes listed above. The `OmidVerificationVendor.OTHER`\nfield is used to set the default access mode for all vendors not explicitly\nincluded in the dictionary. If no access mode rules are specified, verification\nscripts run in `LIMITED` access mode for vendors.\n\nSee the following example which sets `GOOGLE` to\n`google.ima.dai.api.OmidAccessMode.FULL`. All other providers, including those\nlisted in\n[`OmidVerificationVendor`](/interactive-media-ads/docs/sdks/html5/dai/reference/js/global#OmidVerificationVendor),\ndefault to how `OmidVerificationVendor.OTHER` is set. \n\n request.omidAccessModeRules = {};\n request.omidAccessModeRules[google.ima.dai.api.OmidVerificationVendor.GOOGLE]\n = google.ima.dai.api.OmidAccessMode.FULL;\n request.omidAccessModeRules[google.ima.dai.api.OmidVerificationVendor.OTHER]\n = google.ima.dai.api.OmidAccessMode.LIMITED;\n\nTo implement `CREATIVE` access mode, you must follow both of the following\nsteps:\n\n1. Sandbox your video player in a secure iframe, isolated from the rest of your\n site.\n\n2. Set the `OmidAccessMode` for your viewability partner to `FULL`."]]