Để 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.
Tại sao tôi không nhận lại được quảng cáo cho tất cả các định dạng?
Các thẻ quảng cáo thử nghiệm được thiết lập để luôn trả về quảng cáo cho các yêu cầu hợp lệ. Đây là nhằm tạo điều kiện tích hợp cũng như giúp thử nghiệm cách trình phát của bạn yêu cầu và hiển thị quảng cáo. Tuy nhiên, không phải lúc nào quảng cáo cũng có sẵn ở mọi cho trang web, tài khoản hoặc đơn vị quảng cáo của mình. Nếu quá trình tích hợp của bạn đang hoạt động đúng cách cho thẻ thử nghiệm nhưng không phù hợp với thẻ của chính bạn, thì nguyên nhân có thể là một trong như sau:
Bạn đang phân phối video có định dạng không được hỗ trợ đến môi trường của mình. Ví dụ: bạn chỉ phân phát quảng cáo HTML5 đến iOS hoặc Android.
Nếu bạn đang sử dụng Ad Manager, mã nhà xuất bản của bạn có thể không có quảng cáo nào được nhắm mục tiêu đến tại thời điểm này. Ngoài ra, hãy đảm bảo rằng bạn đã phê duyệt các quảng cáo có liên quan và mẫu quảng cáo trong Ad Manager.
Nếu bạn đang sử dụng AdSense, tiêu chí nhắm mục tiêu cho trang web hoặc trang thử nghiệm của bạn có thể không có quảng cáo nào đang hoạt động. Nguyên nhân phổ biến nhất là việc sử dụng các trang web riêng tư, chưa được thu thập dữ liệu.
Nếu bạn đang sử dụng Quản lý đối tác mạng Ad Exchange và descriptionURL chưa được đặt hoặc không thuộc sở hữu hoặc điều hành danh sách quản lý miền, quảng cáo sẽ không phân phát tới danh sách này.
Kiểm tra ngưỡng minCPM được xác định trong Video Ad Exchange. Đáp CPM khá cao có thể khiến tỷ lệ đáp ứng rất thấp. Để khắc phục vấn đề này, hãy thử xóa minCPM hoặc xóa thông số đơn vị quảng cáo khỏi yêu cầu quảng cáo (tức là tên vị trí) để xác minh xem điều này có ảnh hưởng đến tỷ lệ lấp đầy hay không.
Một descriptionUrl tốt trông như thế nào?
Để có hiệu quả nhất, nội dung của trang mà descriptionUrl điểm đến không được là một tập hợp các từ hoặc cụm từ mà thay vào đó 1-3 đoạn mô tả chính xác về nội dung và vai trò của bạn trong việc cung cấp nội dung đó. Một phương pháp đã thành công trước đây là ghép lại với nhau descriptionUrl nội dung trang một cách linh động từ các khối được xác định trước. Ví dụ: một vài câu về nội dung, một vài câu về sản phẩm/dịch vụ của trang web, rồi một vài đoạn mã được xác định trước được liên kết với mỗi Kênh AdSense (như "Giải trí" hoặc "Thể thao"). Kết quả là mỗi phần nội dung có descriptionUrl khác biệt hợp lý liên quan đến tệp này cung cấp cả thông tin chung (như từ mô tả thể loại) lẫn dưới dạng thông tin cụ thể (trực tiếp là nội dung).
HTML siêu dữ liệu này phải đơn giản, ví dụ:
<html> <head> <title>Domain.com - Your tag line here!</title> </head> <body> <h1>Descriptions</h1> <h2>About this Content</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. ...</p> <h2>About Domain.com</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. ...</p> </body> </html>
Tại sao tôi gặp lỗi "Phản hồi quảng cáo không chứa loại quảng cáo hợp lệ"?
Lỗi này thường xuất hiện vì không có quảng cáo nào được nhắm mục tiêu đến publisherId cụ thể (trong khoảng thời gian nhất định). Điều kiện này có thể thay đổi trong ngày hoặc qua vài ngày khi chiến dịch bắt đầu và kết thúc. Bạn nên kiểm tra để đảm bảo rằng quảng cáo mà bạn muốn nhắm mục tiêu chưa hết hạn và tiêu chí nhắm mục tiêu quảng cáo đều chính xác. Miễn là quảng cáo được yêu cầu, nhận và hiển thị đúng cách bằng cách sử dụng publisherId thử nghiệm, bạn có thể chắc chắn rằng những quảng cáo này được xử lý đúng cách bằng cách sử dụng publisherId trực tiếp khi quảng cáo sẵn có.
Bạn có thẻ quảng cáo video Ad Manager mà tôi có thể sử dụng để thử nghiệm không?
Tôi có nên đặt adSlotWidth và adSlotHeight thành cùng một không có giá trị dưới dạng sz trong thẻ quảng cáo Ad Manager của tôi không?
Không cần thiết. adSlotWidth và adSlotHeight phải được đặt thành chiều rộng/chiều cao của trình phát hoặc khu vực mà bạn muốn quảng cáo của mình xuất hiện điền. Các tham số này được AdSense sử dụng để xác định những quảng cáo có sẵn để phù hợp vào không gian đó. Cặp khoá/giá trị sz trong thẻ quảng cáo Ad Manager của bạn là tham số nhắm mục tiêu và không nhất thiết ảnh hưởng đến quảng cáo được phân phối (xem thêm thông tin bên dưới).
Thẻ quảng cáo thử nghiệm trông tuyệt vời, nhưng khi tôi chuyển thẻ này bằng thẻ quảng cáo của mình, không có quảng cáo nào xuất hiện.
Kiểm tra để đảm bảo rằng có gì đó được quản lý tới thẻ quảng cáo của bạn đang yêu cầu. Cách dễ nhất để tìm hiểu là theo dõi lưu lượng truy cập HTTP. Nếu một Hình ảnh 1x1 pixelgray.gif được trả về trong khối neo HTML, thì bạn cần kiểm tra việc nhắm mục tiêu trong Ad Manager.
Tôi muốn yêu cầu quảng cáo sử dụng cùng một thẻ nhiều lần, nhưng tôi chỉ nhận được quảng cáo cho lần đầu tiên của bạn. Làm cách nào để khắc phục lỗi này?
Khi yêu cầu quảng cáo nhiều lần, bạn cần cho máy chủ quảng cáo biết đây là những yêu cầu hợp lệ chứ không phải những yêu cầu trùng lặp do vô tình. SDK thực hiện việc này cho bạn bằng 2 lệnh gọi API nhanh:
Gọi destroy() trên thực thể AdsManager. Thao tác này sẽ ngăn mọi quảng cáo sau video phát khi bạn thực hiện lệnh gọi bên dưới đến contentComplete(). Bạn sẽ nhận được một AdsManager mới khi bạn đưa ra yêu cầu tiếp theo.
Gọi cho contentComplete() trên AdsLoader của bạn thực thể. Thao tác này sẽ đặt lại SDK để yêu cầu quảng cáo mới trông không giống như một bản sao của quảng cáo trước đó.
Sau khi thực hiện hai cuộc gọi trên, bạn có thể gọi requestAds() trên bản sao AdsLoader của bạn để có một tập hợp quảng cáo khác phát cho video mới.
Làm thế nào để yêu cầu quảng cáo AdSense lớp phủ và quảng cáo toàn thời gian bằng SDK IMA?
Để yêu cầu quảng cáo AdSense bằng SDK, trước tiên bạn cần có được một tài khoản AdSense thẻ quảng cáo. Bạn có thể tìm hiểu thêm về điều này trên trang AdSense cho trang Video. Sau khi có thẻ, bạn cần làm theo các bước sau các bước để tạo yêu cầu quảng cáo lớp phủ hoặc yêu cầu quảng cáo toàn thời gian:
Quảng cáo lớp phủ
Trong AdsRequest, hãy đặt ViewModes thành NORMAL
Trong thẻ quảng cáo, hãy thêm thông số overlay=1.
Quảng cáo toàn thời gian
Trong AdsRequest, hãy đặt ViewModes thành FULLSCREEN
Trong thẻ quảng cáo, hãy thêm thông số overlay=0.
Tôi nhận được "URL nhấp chuột không hợp lệ" lỗi khi nhấp vào quảng cáo của mình. Đâu có thể là nguyên nhân?
Nguyên nhân phổ biến nhất gây ra lỗi này là lượt nhấp được thoát không đúng cách URL. Nếu bạn thấy lỗi này, hãy kiểm tra để đảm bảo rằng bạn nhấp chuột URL được thoát đúng cách trong phản hồi VAST của bạn.
Tại sao tôi thấy "Tài liệu VAST trống" lỗi?
Lỗi này xảy ra khi thẻ quảng cáo trả về một tài liệu VAST trống, cho biết rằng rằng quảng cáo không được phân phát đúng cách. Trao đổi với người quản lý tài khoản của bạn hoặc đại diện máy chủ quảng cáo để biết lý do tại sao thẻ quảng cáo của bạn không hoạt động.
Tôi có thể thay đổi kích thước/văn bản của hộp Bỏ qua quảng cáo hoặc các thành phần giao diện người dùng khác không?
SDK IMA không hỗ trợ việc thay đổi bố cục, kích thước hoặc nội dung của các phần tử trên giao diện người dùng. Để biết thêm thông tin về các thành phần trên giao diện người dùng, hãy xem AdsManager.uiElements.
SDK HTML5 có hỗ trợ các chế độ điều khiển video gốc không?
Không, SDK HTML5 không hỗ trợ điều khiển gốc.
Tôi thấy thông báo "Không thực thi được "phát" trên 'HTMLMediaElement': API chỉ có thể được khởi chạy bằng một cử chỉ của người dùng" trong quá trình triển khai HTML5 của tôi. Làm cách nào để khắc phục lỗi này?
Trên thiết bị di động, bạn phải gọi adDisplayContainer.initialize() do một hành động của người dùng (chẳng hạn như một lượt nhấn). Nếu bạn khi gặp lỗi này, rất có thể bạn đang gọi nó trong ngữ cảnh không do người dùng khởi tạo. Xin lưu ý rằng phải là kết quả trực tiếp từ hành động của người dùng. Ví dụ: nếu bạn trả lời một "nhấn" bằng cách phát một video rồi sử dụng nút "phát" của trình phát video sự kiện cần gọi initialize(), SDK sẽ trả về lỗi này. Bạn phải gọi initialize() bằng kết quả của chính sự kiện nhấn.
Làm cách nào để xử lý trọng tâm của bàn phím đối với các lượt nhấp vào quảng cáo?
Nếu sử dụng các nút điều khiển bằng bàn phím cho trình phát, bạn có thể thấy rằng các nút điều khiển này sẽ không hoạt động nữa sau khi nhấp vào adDisplayContainer. Điều này là do khi người dùng nhấp vào một quảng cáo tiêu điểm bàn phím được chuyển sang iframe IMA. Để tập trung vào trình phát nội dung bằng bàn phím, vui lòng tận dụng CLICK để chuyển tiêu điểm bàn phím trở lại vùng chứa mong muốn. Hãy xem đoạn mã sau đây cho chi tiết khác:
adsManager.addEventListener( google.ima.AdEvent.Type.CLICK, function(){ window.focus(); // Or another method to return focus to the desired container. });
[[["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-08-17 UTC."],[[["\u003cp\u003eThe IMA HTML5 SDK facilitates ad integration and testing, but live ads depend on factors like ad targeting, formats, and publisher settings.\u003c/p\u003e\n"],["\u003cp\u003eIf your ad tag isn't working, review your Ad Manager targeting, ensure your descriptionUrl is properly set up, and check for any errors in your VAST response.\u003c/p\u003e\n"],["\u003cp\u003eFor repeated ad requests, use \u003ccode\u003edestroy()\u003c/code\u003e on the AdsManager and \u003ccode\u003econtentComplete()\u003c/code\u003e on the AdsLoader to avoid duplicate requests.\u003c/p\u003e\n"],["\u003cp\u003eNative video controls are not supported with the HTML5 SDK, and on mobile devices, \u003ccode\u003eadDisplayContainer.initialize()\u003c/code\u003e must be called directly as a result of a user action.\u003c/p\u003e\n"],["\u003cp\u003eKeyboard focus can be managed by utilizing the CLICK event and transferring it back to the content player.\u003c/p\u003e\n"]]],[],null,["- [Why am I not getting ads back for all formats?](#1)\n- [What does a good descriptionUrl look like?](#2)\n- [Why am I receiving the error \"Ad response does not contain a valid ad type\"?](#3)\n- [Do you have an Ad Manager video ad tag that I can use for testing?](#4)\n- [Should I set the adSlotWidth and adSlotHeight to the same values\n as the sz in my Ad Manager ad tag?](#5)\n- [The demo ad tag looks great, but when I switch it with my ad tag,\n no ad appears.](#7)\n- [I want to request ads using the same tag more than once, but I\n only get ads for my first request. How do I fix this?](#8)\n- [How do I request overlay and full slot AdSense ads using the IMA\n SDK?](#9)\n- [I'm getting an \"Invalid clickthrough URL\" error when I click on my\n ad. What could be the cause?](#10)\n- [Why do I see a \"VAST Document Empty\" error?](#12)\n- [Can I change the size/text of the \"Skip Ad\" box or other UI elements?](#13)\n- [Are native video controls supported with the HTML5 SDK?](#15)\n- [I'm seeing \"Failed to execute 'play' on 'HTMLMediaElement': API can only be\n initiated by a user gesture\" in my HTML5 implementation. How do I fix this?](#17)\n- [How do I handle keyboard focus on ad clicks?](#19)\n\n*** ** * ** ***\n\nWhy am I not getting ads back for all formats?\n:\n The test ad tags are set up to always return ads for valid requests. This is\n meant to facilitate integration and make it easier to test how your player\n requests and renders ads. However, ads are not always available in every\n format for your site, account, or ad unit. If your integration is working\n properly for the test tag but not for your own tag, the cause may be one of\n the following:\n\n - You're serving videos of an unsupported format to your environment. For example, you're serving only HTML5 ads to iOS or Android.\n - If you're using Ad Manager, your publisher ID may not have any ads targeted to it at this time. Also, ensure that you have approved the relevant ads and creatives in Ad Manager.\n - If you're using AdSense, the targeting criteria for your site or test page may not have any active advertisements. The most common cause is the use of private, uncrawled websites.\n - If you're using Ad Exchange Network Partner Management and `descriptionURL` is not set or is not on the owned or operated domains management list, ads do not serve to this.\n - Check the *minCPM* thresholds defined in Ad Exchange Video. A fairly high CPM may result in very low fill rates. To correct this, try either removing the minCPM or removing the ad unit parameter from the ad request (i.e., slotname) to verify whether this is affecting the fill rate.\n\nWhat does a good `descriptionUrl` look like?\n:\n To be most effective, the content of the page that `descriptionUrl`\n points to shouldn't be a collection of words or phrases but rather\n 1-3 paragraphs actually describing the content and your role in providing it.\n One method that has been successful in the past is to stitch together\n `descriptionUrl` page content dynamically from predefined blocks.\n For example, a few sentences about the content, a few sentences about your\n site's offering, and then a few predefined snippets associated with each\n AdSense channel (like \"Entertainment\" or \"Sports\"). As a result, each piece of\n content has a reasonably distinct `descriptionUrl` associated with\n it that provides both general information (such as genre descriptors) as well\n as specific information (content about the content directly).\n\n This metadata HTML should be simple, for example:\n\n ```text\n \u003chtml\u003e\n \u003chead\u003e\n \u003ctitle\u003eDomain.com - Your tag line here!\u003c/title\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eDescriptions\u003c/h1\u003e\n \u003ch2\u003eAbout this Content\u003c/h2\u003e\n \u003cp\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit. ...\u003c/p\u003e\n \u003ch2\u003eAbout Domain.com\u003c/h2\u003e\n \u003cp\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit. ...\u003c/p\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n \n ```\n\nWhy am I receiving the error \"Ad response does not contain a valid ad type\"?\n: This error generally appears because no ads have been targeted to the\n specific `publisherId` (for the given time period). This condition\n may vary throughout the day, or over several days as campaigns begin and end.\n You should check that the ad you wish to target has not expired and that the\n ad targeting criteria are correct.\n As long as ads are properly requested, received, and rendered using\n the test `publisherId`, you can be sure that these ads are\n properly handled using your live `publisherId` when the ads are\n available.\n\nDo you have an Ad Manager video ad tag that I can use for testing?\n: Sample tags are available on the [sample tags](/interactive-media-ads/docs/sdks/html5/tags) page.\n\nShould I set the `adSlotWidth` and `adSlotHeight` to the same\nvalues as the `sz` in my Ad Manager ad tag?\n: Not necessarily. The `adSlotWidth` and `adSlotHeight`\n must be set to the width/height of the player or area you want your ads to\n fill. They are used by AdSense to determine which ads are available to fit\n into that space. The `sz` key/value pair in your Ad Manager ad tag is\n a targeting parameter and does not necessarily affect the creative served\n (more information below).\n\nThe demo ad tag looks great, but when I switch it with my ad tag, no ad appears.\n:\n Check to ensure that something is trafficked to the ad tag you are\n requesting. The easiest way to find out is to watch the HTTP traffic. If a\n **1x1 pixel grey.gif** image is returned within an HTML anchor block,\n then you need to check your targeting in Ad Manager.\n\nI want to request ads using the same tag more than once, but I only get ads for my first\nrequest. How do I fix this?\n:\n When you request ads more than once, you need to let the ad server know\n that these are legitimate requests, and not accidental duplicates. The SDK\n does this for you with two quick API calls:\n\n 1. Call `destroy()` on your `AdsManager` instance. This prevents any post-rolls from playing when you make the below call to `contentComplete()`. You get a new `AdsManager` when you make your next request.\n 2. Call `contentComplete()` on your `AdsLoader` instance. This resets the SDK so the new ad request doesn't look like a duplicate of the previous one.\n\n\n After making the two calls above, you can call `requestAds()` on\n your `AdsLoader` instance to get another set of ads to play for your\n new video.\n\nHow do I request overlay and full slot AdSense ads using the IMA SDK?\n\n: To request AdSense ads using the SDK, you need to first obtain an AdSense\n ad tag. You can learn more about that on the [AdSense\n for Video page](//support.google.com/adsense/answer/1705822). Once you have your tag, you need to take the following\n steps to make either an overlay or a full slot ad request:\n\n **Overlay ads**\n\n 1. In your `AdsRequest`, set your ViewModes to `NORMAL`.\n 2. In your ad tag, add the parameter `overlay=1`.\n\n **Full slot ads**\n\n 1. In your `AdsRequest`, set your ViewModes to `FULLSCREEN`.\n 2. In your ad tag, add the parameter `overlay=0`.\n\nI'm getting an \"Invalid clickthrough URL\" error when I click on my ad. What could be the cause?\n:\n The most common cause for this error is an improperly escaped clickthrough\n URL. If you're seeing this error, check to make sure that your clickthrough\n URL is properly escaped in your VAST response.\n\nWhy do I see a \"VAST Document Empty\" error?\n: This error occurs when the ad tag returns an empty VAST document, indicating\n that the ad was not served properly. Talk to your account manager\n or ad server representative to see why your ad tag is not working.\n\nCan I change the size/text of the **Skip Ad** box or other UI elements?\n: The IMA SDKs do not support changing the layout, size, or content of UI elements.\n For more details on UI elements, see `AdsManager.uiElements`.\n\nAre native video controls supported with the HTML5 SDK?\n:\n No, the HTML5 SDK does not support native controls.\n\nI'm seeing \"Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated\nby a user gesture\" in my HTML5 implementation. How do I fix this?\n:\n On mobile devices, you must call `adDisplayContainer.initialize()`\n as the result of a user action (such as a tap). If you're\n seeing this error, you're most likely calling it on a non-user-initiated context. Note that it\n must be the **direct** result of a user action. For example, if you respond to a\n \"tap\" event by playing a video, and then use the video player's \"play\" event to call\n `initialize()`, the SDK returns this error. You must call `initialize()` as\n the result of the tap event itself.\n\nHow do I handle keyboard focus on ad clicks?\n:\n If you use keyboard controls for your player you may notice that they will no longer work\n following clicks on the `adDisplayContainer`. This is because, once an ad is clicked\n keyboard focus is switched to the IMA iframe. To keep keyboard focus on the content player, please\n utilize the\n [CLICK](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent)\n event to transfer keyboard focus back to the desired container. See the following code snippet for\n more details: \n\n ```text\n adsManager.addEventListener(\n google.ima.AdEvent.Type.CLICK,\n function(){\n window.focus();\n // Or another method to return focus to the desired container.\n });\n \n ```"]]