Để thảo luận và đưa ra ý kiến phản hồi về các sản phẩm của chúng tôi, hãy tham gia kênh Discord chính thức của Ad Manager trong máy chủ Cộng đồng quảng cáo và đo lường của Google.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
SDK IMA cho HTML5 có chứa SDK Đo lường mở (OM), một tiêu chuẩn ngành do Cục Quảng cáo tương tác (IAB) phát triển để cho phép đo lường khả năng xem và xác minh của bên thứ ba. Khi sử dụng SDK IMA cho HTML5, SDK OM đi kèm sẽ tự động phân tích cú pháp thẻ <AdVerifications> trong thẻ quảng cáo VAST và gửi dữ liệu về khả năng xem cho các nhà cung cấp dịch vụ đo lường được chỉ định bằng cách sử dụng API OMID. Bạn có thể tuỳ ý đặt các quy tắc về chế độ truy cập cho từng yêu cầu để kiểm soát nội dung mà tập lệnh xác minh có thể truy cập.
SDK IMA hỗ trợ SDK OM phiên bản 1.4.
Điều kiện tiên quyết
Nếu sử dụng VAST 4.1 trở lên, bạn phải định cấu hình quảng cáo để cung cấp thông tin xác minh bằng <AdVerifications>. Nếu sử dụng các phiên bản VAST trước đây, quảng cáo phải sử dụng <Extension type="AdVerifications">.
Nếu quảng cáo của bạn được phân phối thông qua Ad Manager, hãy định cấu hình một nhà cung cấp khả năng xem cho mạng Ad Manager và chỉ định nhà cung cấp khả năng xem đó cho mục hàng của bạn. Để biết thêm thông tin, hãy xem bài viết Định cấu hình nhà cung cấp khả năng xem cho mạng Ad Manager.
Chế độ truy cập
OM SDK hỗ trợ chạy các tập lệnh xác minh ở 4 chế độ truy cập khác nhau. Các chế độ này kiểm soát mức độ truy cập của tập lệnh xác minh:
FULL: Tập lệnh xác minh có quyền truy cập trực tiếp vào mẫu quảng cáo và trang của nhà xuất bản.
CREATIVE: Tập lệnh xác minh và mẫu quảng cáo được đưa vào hộp cát từ trang của nhà xuất bản. Tuy nhiên, tập lệnh có quyền truy cập trực tiếp vào mẫu quảng cáo.
LIMITED: Tập lệnh xác minh được đưa vào hộp cát và không thể truy cập vào mẫu quảng cáo hoặc trang của nhà xuất bản, đồng thời không thể xác nhận trực tiếp miền của nhà xuất bản mà tập lệnh đang hoạt động.
Một số nhà cung cấp chỉ số khả năng xem có thể không hỗ trợ tất cả các chế độ truy cập. Hãy liên hệ với nhà cung cấp khả năng xem của bạn để xác minh những chế độ được hỗ trợ. Trước đây, IMA hỗ trợ chế độ truy cập DOMAIN, nhưng hiện tại chế độ này mặc định là chế độ LIMITED.
Đặt các quy tắc về chế độ truy cập cho một yêu cầu
Bạn phải đặt các quy tắc về chế độ truy cập ở cấp AdsRequest. Để thiết lập các chế độ truy cập khác nhau cho các nhà cung cấp tập lệnh xác minh khác nhau, hãy truyền một từ điển ánh xạ từng OmidVerificationVendor đến một trong các chế độ truy cập được liệt kê ở trên. Trường OmidVerificationVendor.OTHER được dùng để đặt chế độ truy cập mặc định cho tất cả các nhà cung cấp không được đưa vào từ điển một cách rõ ràng. Nếu không có quy tắc nào về chế độ truy cập được chỉ định, thì các tập lệnh xác minh sẽ chạy ở chế độ truy cập LIMITED cho nhà cung cấp.
Hãy xem ví dụ sau đây đặt GOOGLE thành google.ima.OmidAccessMode.FULL. Tất cả các nhà cung cấp khác (kể cả những nhà cung cấp có trong OmidVerificationVendor) đều được đặt theo mặc định là cách OmidVerificationVendor.OTHER được thiết lập.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-05 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 supply verification using \u003ccode\u003e<AdVerifications>\u003c/code\u003e (VAST 4.1+) or \u003ccode\u003e<Extension type="AdVerifications">\u003c/code\u003e (previous VAST versions).\u003c/p\u003e\n"],["\u003cp\u003eFour access modes (FULL, CREATIVE, DOMAIN, LIMITED) control verification script access to the creative and publisher page, impacting the level of data access.\u003c/p\u003e\n"],["\u003cp\u003eAccess mode rules are set at the \u003ccode\u003eAdsRequest\u003c/code\u003e level, allowing customized access for different verification vendors, with \u003ccode\u003eLIMITED\u003c/code\u003e as the default.\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,["# Enable Open Measurement\n\nThe 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\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------------\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\nAccess mode rules must be set at the [`AdsRequest`](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRequest#omidAccessModeRules) level. To set different access modes for different verification script providers, pass a dictionary that maps each [`OmidVerificationVendor`](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima#.OmidVerificationVendor) to one of the access modes listed above. The `OmidVerificationVendor.OTHER` field is used to set the default access mode for all vendors not explicitly included in the dictionary. If no access mode rules are specified, verification scripts run in `LIMITED` access mode for vendors.\n\n\u003cbr /\u003e\n\nSee the following example which sets `GOOGLE` to\n`google.ima.OmidAccessMode.FULL`. All other providers, including those\nlisted in\n[`OmidVerificationVendor`](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima#.OmidVerificationVendor),\ndefault to how `OmidVerificationVendor.OTHER` is set. \n\n request.omidAccessModeRules = {};\n request.omidAccessModeRules[google.ima.OmidVerificationVendor.GOOGLE]\n = google.ima.OmidAccessMode.FULL;\n request.omidAccessModeRules[google.ima.OmidVerificationVendor.OTHER]\n = google.ima.OmidAccessMode.LIMITED;\n\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`."]]