AdSense ads on Blogger


 To lazy load AdSense ads on your Blogger site, you'll need to modify your blog's HTML and add a bit of JavaScript. Here's a step-by-step guide:

1. Add AdSense Code Normally
   - First, ensure you've added your AdSense ad units to your Blogger site normally.
   - Go to **Layout** in the Blogger dashboard.
   - Add a **HTML/JavaScript** gadget where you want the ads to appear and insert your AdSense code.

 

replace the `data-ad-client` and `data-ad-slot` with your actual AdSense details.


 4. Save and Test
   - After saving your changes, test your site to make sure the ads load correctly as you scroll.
 
5. Optimisation (Optional)
   - Consider optimising the threshold or root margin in the `IntersectionObserver` to control when ads start loading (e.g., start loading ads just before they enter the viewport).

This should help you lazy load AdSense ads on your Blogger site, improving performance and user experience.

Post a Comment

0 Comments