您在 AdSense 帐号中生成的广告代码是完全异步的。它有助于改善网络延迟,为网站访问者提供更好的用户体验。如果您需要生成同步广告代码,例如您使用的是 Google Ad Manager 或其他不支持异步广告代码的广告服务器,则需要修改广告单元代码。
注意:您只能为固定尺寸的广告单元生成同步广告代码。
要修改现有广告单元代码,请进行以下代码更新:
异步广告单元代码:
<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>
注意:我们不建议您在同一网页上混合使用异步和同步广告代码。