タグはフレームごとに 1 回だけ読み込む
概要
この監査では、同じ広告タグライブラリ スクリプトを複数回読み込むフレームがないことを確認します。同じスクリプトを複数回含めることは必要なく、ページ パフォーマンスの低下につながる可能性があります。
推奨事項
重複する広告タグライブラリのスクリプトを削除してください。場合によっては、重複するスクリプトが 2 つの異なる場所から知らずに読み込まれる可能性があります。ネットワーク トラフィックを確認し、フレームごとにリクエストをグループ化して、重複する各スクリプトの送信元を調べます。
スクリプトが重複しているソースを特定する
Chrome DevTools の [Network] タブを使用して、重複するスクリプトを読み込もうとしているフレームを特定します。
Control+Shift+J
または Command+Option+J
(Mac)を押して DevTools を開きます。
- [ネットワーク] タブに移動します。
- まだ表示されていない場合は、[フィルタ
] をクリックしてフィルタバーを開き、[JS] を選択します。
- ネットワーク設定
を開き、[フレームでグループ化] を選択します。
- ページを再読み込みして、ネットワーク トラフィックを取得します。
![Chrome DevTools の [Network] タブのスクリーンショット](https://developers.google.cn/publisher-ads-audits/reference/audits/images/duplicate-scripts-devtools.png?hl=ja)
次の広告タグ ライブラリ スクリプトがサポートされています。
ライブラリ |
スクリプト |
AdSense |
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
pagead2.googlesyndication.com/pagead/js/show_ads.js
|
Google パブリッシャー タグ |
googletagservices.com/tag/js/gpt.js
securepubads.g.doubleclick.net/tag/js/gpt.js
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-06-26 UTC。
[null,null,["最終更新日 2024-06-26 UTC。"],[[["This audit helps improve website performance by ensuring ad tag library scripts are only loaded once per frame."],["Loading duplicate scripts can slow down page load times and negatively impact user experience."],["Chrome DevTools' Network tab, with grouping by frame enabled, can be used to identify the source of duplicate ad tag scripts."],["AdSense and Google Publisher Tag have specific scripts that should be monitored to ensure single loading instances."]]],["The audit identifies duplicate ad tag library scripts, which negatively impact page performance. To resolve this, users should remove the redundant scripts. Utilize Chrome DevTools' Network tab, filtering for JS and grouping requests by frame, to find where duplicates originate. Supported libraries include AdSense (with scripts `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js` and `show_ads.js`) and Google Publisher Tag (`googletagservices.com/tag/js/gpt.js` and `securepubads.g.doubleclick.net/tag/js/gpt.js`). The goal is ensuring each script loads only once.\n"]]