Tránh các tài nguyên chặn hiển thị
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.
Tổng quan
Quá trình kiểm tra này xác định các tài nguyên (cụ thể là tập lệnh và biểu định kiểu) đang làm trì hoãn quá trình tải thư viện thẻ quảng cáo. Đây là những tài nguyên được yêu cầu và nhận trước khi thư viện thẻ quảng cáo bắt đầu tải. Việc giảm
số lượng tài nguyên được yêu cầu trước khi tải thẻ sẽ tăng tốc độ tải quảng cáo.
Đề xuất
Thông tin chi tiết của quá trình kiểm tra này có danh sách tất cả tập lệnh và biểu định kiểu đang trì hoãn việc tải thẻ. Mục tiêu là giảm số mục trong danh sách này về càng gần 0 nhất có thể. Một số mẹo để thực hiện việc này bao gồm:
- Tải thư viện thẻ quảng cáo sớm hơn trong
<head>
của trang.
- Đặt trực tiếp tập lệnh và biểu định kiểu quan trọng đối với chức năng cốt lõi vào cùng trong HTML của bạn.
- Đánh dấu các tập lệnh không quan trọng bằng thuộc tính
async
hoặc defer
.
- Tách kiểu thành các tệp khác nhau bằng truy vấn nội dung nghe nhìn và sử dụng thuộc tính
media
để chỉ tải khi cần.
Các tập lệnh thư viện thẻ quảng cáo sau đây được hỗ trợ:
Thư viện |
(Các) tập lệnh |
AdSense |
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
pagead2.googlesyndication.com/pagead/show_ads.js
|
Thẻ nhà xuất bản của Google |
googletagservices.com/tag/js/gpt.js
securepubads.g.doubleclick.net/tag/js/gpt.js
|
Tài nguyên chặn hiển thị
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eThis audit helps identify scripts and stylesheets that slow down the loading of ad tags by being requested before them.\u003c/p\u003e\n"],["\u003cp\u003eReducing the number of these resources loaded prior to ad tags can significantly improve ad loading speed.\u003c/p\u003e\n"],["\u003cp\u003eOptimization strategies include loading ad tags earlier, inlining critical resources, using \u003ccode\u003easync\u003c/code\u003e or \u003ccode\u003edefer\u003c/code\u003e for non-critical scripts, and separating stylesheets by media query.\u003c/p\u003e\n"],["\u003cp\u003eSupported ad tag libraries include AdSense and Google Publisher Tag, with specific script URLs for identification.\u003c/p\u003e\n"]]],["The audit identifies scripts and stylesheets that delay ad tag library loading. To improve ad loading speed, reduce the number of resources requested before tag loading. Key actions include loading ad tag libraries earlier, inlining critical scripts/stylesheets, marking non-critical scripts with `async` or `defer`, and using the `media` attribute for conditional stylesheet loading. Supported ad tag libraries include AdSense and Google Publisher Tag, each with specific script URLs. The goal is to have minimal or zero items on this list.\n"],null,["# Avoid render-blocking resources\n\nOverview\n--------\n\nThis audit identifies resources (specifically scripts and stylesheets) which are\ndelaying the loading of ad tag libraries. These are resources that were\nrequested and received before ad tag libraries began loading. Reducing the\nnumber of resources requested prior to tag load will speed up ad loading.\n\nRecommendations\n---------------\n\nThe details of this audit contain a list of all scripts and stylesheets that are\ndelaying tag load. The goal is to reduce the number of entries in this list as\nclose to 0 as possible. Some tips for doing this include:\n\n- Loading ad tag libraries earlier in the `\u003chead\u003e` of the page.\n- Inlining scripts and stylesheets critical to core functionality directly into your HTML.\n- Marking non-critical scripts with the `async` or `defer` attributes.\n- Separating styles into different files by media query and using the `media` attribute to load them only when needed.\n\nMore information\n----------------\n\nThe following ad tag library scripts are supported:\n\n| Library | Script(s) |\n|----------------------|-------------------------------------------------------------------------------------------------------------|\n| AdSense | `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js` `pagead2.googlesyndication.com/pagead/show_ads.js` |\n| Google Publisher Tag | `googletagservices.com/tag/js/gpt.js` `securepubads.g.doubleclick.net/tag/js/gpt.js` |\n\n[Rendering Blocking Resources](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources) \n[View audit source](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/lighthouse-plugin-publisher-ads/audits/ad-render-blocking-resources.js) [Improve this article](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/docs/audits/ad-render-blocking-resources.md) [Report an issue](https://github.com/googleads/publisher-ads-lighthouse-plugin/issues/new?labels=documentation&template=documentation-feedback.md&title=Documentation+feedback%3A+ad-render-blocking-resources.md)\n\n\u003cbr /\u003e"]]