AdSense アカウントで生成した広告コードは完全に非同期です。非同期だと、ウェブページの読み込み時間が短縮され、サイト訪問者のユーザー エクスペリエンスが向上します。たとえば、Google アド マネージャーなど非同期の広告コードに対応していない広告サーバーを使用しているため、同期広告コードを生成する必要がある場合は、広告ユニットのコードに変更を加える必要があります。
注: 同期広告コードは固定サイズの広告ユニットでのみ生成できます。
広告ユニットの既存のコードは次のように修正します。
広告ユニットの非同期コード:
<script async src="https://pagead2.googlesyndication.com/
pagead/js/adsbygoogle.js"></script>
<!-- leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
pagead/js/adsbygoogle.js"></script>
<!-- leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
広告ユニットの同期コード:
<script type="text/javascript">
google_ad_client = "ca-pub-xxxxxxxxxxxxxxxx";
google_ad_slot = "1234567890";
google_ad_width = 728;
google_ad_height = 90;
</script>
<!-- leaderboard -->
<script type="text/javascript"
src="https://pagead2.googlesyndication.com/
pagead/show_ads.js">
</script>
google_ad_client = "ca-pub-xxxxxxxxxxxxxxxx";
google_ad_slot = "1234567890";
google_ad_width = 728;
google_ad_height = 90;
</script>
<!-- leaderboard -->
<script type="text/javascript"
src="https://pagead2.googlesyndication.com/
pagead/show_ads.js">
</script>
注: 非同期と同期の広告コードを同じウェブページで使用することはおすすめできません。