为网站添加Google广告
- 登录Google AdSense并注册账号。
- 创建广告单元并获取广告代码。
- 将广告代码插入到你的网站模板中,通常是在
<body>
标签内。 - 确保你的网站符合Google的广告政策。
示例代码
<body>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2327435979273742"crossorigin="anonymous"></script>
<ins class="adsbygoogle"style="display:block"data-ad-client="ca-pub-2327435979273742"data-ad-slot="3702206121"data-ad-format="auto"data-full-width-responsive="true"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body>
效果

收益
