広告タグを非同期で読み込む
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
概要
この監査では、広告タグライブラリのスクリプトが非同期的に読み込まれるようにします。
デフォルトでは、JavaScript の実行は同期します。つまり、スクリプトの内容が
他のコンテンツは、そのスクリプトが完了するまで読み込めません。
ダウンロード、解析、実行されます非同期実行を有効にすると
これにより、ブラウザが他のリソースの処理を続行しながら、
指定したスクリプトがバックグラウンドで読み込まれます。これにより、ページの応答性を維持できます
重要な部分をすべて読み込むのに必要な時間が
説明します。
推奨事項
スクリプトタグの定義に async 属性を含めます。例:
AdSense
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
AdSense(自動広告)
<script async data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Google パブリッシャー タグ
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
次の広告タグ ライブラリ スクリプトがサポートされています。
広告タグ ライブラリ |
スクリプト |
AdSense |
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
pagead2.googlesyndication.com/pagead/show_ads.js
|
Google パブリッシャー タグ |
googletagservices.com/tag/js/gpt.js
securepubads.g.doubleclick.net/tag/js/gpt.js
|
Google パブリッシャー タグを使ってみる
GPT リクエスト モードと非同期レンダリング
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eThis audit verifies if ad tag library scripts are loaded asynchronously to improve page performance.\u003c/p\u003e\n"],["\u003cp\u003eAsynchronous loading allows the browser to load other content while the script loads in the background, preventing delays and improving user experience.\u003c/p\u003e\n"],["\u003cp\u003eTo enable asynchronous loading, include the \u003ccode\u003easync\u003c/code\u003e attribute within the \u003ccode\u003e<script>\u003c/code\u003e tag when implementing ad tags like AdSense and Google Publisher Tag.\u003c/p\u003e\n"],["\u003cp\u003eSynchronous loading, where the browser waits for the script to fully load before proceeding, can negatively impact page load times and overall performance.\u003c/p\u003e\n"]]],["To optimize page load times, ad tag library scripts should load asynchronously. This is achieved by including the `async` attribute within the `\u003cscript\u003e` tag. Asynchronous loading allows the browser to continue loading other page content while the script downloads and executes in the background. Supported ad tag libraries include AdSense and Google Publisher Tag, with specific script URLs like `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js` and `securepubads.g.doubleclick.net/tag/js/gpt.js` needing the `async` attribute.\n"],null,[]]