How do I add Google AdSense code to my website manually?
Asked on Aug 28, 2025
Answer
To manually add Google AdSense code to your website, you'll need to insert the ad code snippet provided by AdSense into your site's HTML. Google AdSense is a platform that allows website owners to earn money by displaying targeted ads on their sites.
<!-- BEGIN COPY / PASTE -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
data-ad-slot="YYYYYYYYYY"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- END COPY / PASTE -->Additional Comment:
- Replace "ca-pub-XXXXXXXXXXXXXXXX" with your actual AdSense publisher ID.
- Replace "YYYYYYYYYY" with your specific ad slot ID.
- Ensure the ad code is placed within the body section of your HTML where you want the ad to appear.
- Test your website to ensure ads are displaying correctly and do not interfere with user experience.
- Check your AdSense account for any policy violations or issues if ads do not appear.
Recommended Links: