Follow us on Google News & Join Telegram Discussion Join Now Follow Us!

How to Optimise Your Blog Speed? - Lazy Loading AdSense Code: How to Add it to Your Blog

Know How to Improve Your Blog Speed. Good Website Speed Gives you better Ranking in Search Result. Optimize Your Blog Speed with Lazy Load AdSense.

Lazy Loading AdSense Code: How to Add it to Your Blog.


AdSense is a great source of side income for bloggers, but you need to have a lot of visitors to your blog in order for it to be profitable. If your blog isn’t getting enough traffic, you may find that monetizing with AdSense is difficult. This is because AdSense is best when it’s visible on every page of your website. Loading the code in every single blog post can get pretty annoying, especially if you have a lot of posts like most blogs do. Luckily, there’s lazy loading! Lazy loading means adding code only when it’s needed. In this case, that means adding the AdSense code only where it will be seen by visitors. In this article, we’ll explore how to lazy load AdSense on your blog so that you can make the most profit without annoying your readers with unnecessary code.


Step 1:- Open Your Blogger Dashboard and click on the Theme.


Step 2:- Now, First You have to take your Website Backup.


Step 3:- Remove Your all previous Adsense Code From Your Website.


Step 4:- Copy the code below Given, and Replace the Adsense  Publisher ID with Your Publisher ID.


Step 5:- Paste the code in your website just above the closing </body> Tag.


Adsense Lazy loading Code

LazyLoad AdSense Script Code 
<script type='text/javascript'>

//<![CDATA[

var lazyadsense2 = false;

window.addEventListener("scroll", function(){

if ((document.documentElement.scrollTop != 0 && lazyadsense2 === false) || (document.body.scrollTop != 0 && lazyadsense2 === false)) {

(function() { var ad = document.createElement('script'); ad.setAttribute('data-ad-client','ca-pub-xxxxxxxxxxxxxxxx'); ad.async = true; ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'; var sc = document.getElementsByTagName('script')[0]; sc.parentNode.insertBefore(ad, sc); })();

lazyadsense2 = true;

  }

}, true);

//]]>

</script>

What is Lazy Loading?

Lazy loading is a design pattern where elements are loaded when the user needs them, rather than all at once. This can be done in a number of ways, but the most common is to have everything on a page broken down into discreet elements that only add a small portion of the page’s overall code. This means that elements don’t need to be downloaded until they’re needed, which is why this type of loading is also known as on-demand loading. Lazy loading is useful in a number of different situations, but it’s particularly helpful for bloggers who want to monetize with AdSense. The only problem is that loading all of the AdSense code on every single blog post could get annoying for readers, especially if they don’t click any of the ads.

How to Optimise Your Blog Speed? - Lazy Loading AdSense Code: How to Add it to Your Blog


How to Add Lazy Load AdSense Code in Your Blog?

Start off by logging into your AdSense account and clicking “My ads” on the left sidebar. Here, click the “New ad unit” button and select “On-page text” in the drop-down menu. Click “Create ad unit” and then “Save ad.” Next, click the “Edit” button and you’ll see a code snippet with some placeholders. Replace the word “Ad unit” with a descriptive title for your AdSense ads. This will help you recognize the ad units in your blog’s code later. You’ll also want to replace the “Ad title” and “Ad description” placeholders with your own text. Next, click “Save ad” and you’ll be redirected to the Ad unit settings. Here, you can choose how many pages the ad will show on and the type of ad. Select “In-feed” for the type and make sure to check the box beside “Assign to all pages on this domain.” This will tell AdSense to show the ad on every single blog post on your website.


Why is Lazy Loading Important for Bloggers?

Lazy loading is an important part of every blogger’s monetization strategy for a few reasons. The most obvious benefit is that it allows you to load only the ads that show on each page. This means there aren’t any extra ads that readers don’t see and it can help to reduce ad blocking. Additionally, lazy loading ads can help to reduce your bounce rate. If you are monetizing with AdSense or another type of ad and it loads on every single page, readers might get annoyed and exit your site before they even get to your actual blog posts. If the ads only load on pages where they’re relevant and aren’t just a constant annoyance, your readers are less likely to exit your site without clicking anything.


How to Optimize Lazy-Loaded Ads for Even More Profit?

As we’ve discussed, lazy loading ads can reduce your bounce rate and help readers to stay on your site longer. However, you can make even more money from your lazy-loaded ads by using Smart Bidding. Smart Bidding allows you to select your desired click-through rate (CTR) and ad position. Ad position is the order in which ads are shown on your page, so a higher position means that your ad will be shown before other ads. If you want to make the most money possible, you should set your CTR to 50% and set your ad position to “highest.” Make sure to select “Show my ads as In-feed ads” so that your ad is shown as an in-feed ad. Ad Position - Ads are displayed on your site based on a combination of factors, such as the bid amount and general ad quality. By default, AdSense shows ads at the top of your content, but you can control your ad position. Low ad position means that your ad will be shown lower down on your page, which can reduce your clickthrough rate. If you want to maximize your clickthrough rate, you should always choose “highest’ for your ad position.


What if You Have a Lot of Posts?

If you have a lot of blog posts, you may find that loading the AdSense code on every single page is too much. In this case, you can also lazy load your AdSense ads by only loading them on posts where you make money. To do this, you’ll need to log into your AdSense account and click “My ads” on the left sidebar. Next, click the “New ad unit” button and select “On-page text” in the drop-down menu. Click “Create ad unit” and then “Save ad.” Next, click “Edit” and replace the word “Ad unit” with a descriptive title for your AdSense ads. You’ll also want to replace the “Ad title” and “Ad description” placeholders with your own text. Next, click “Save ad” and you’ll be redirected to the Ad unit settings. Select “In-feed” for the type and make sure to check the box beside “Assign to pages where this ad is making money.” You can now click “Select pages” and you’ll be taken to a page where you can select which posts show the ads.


Conclusion

Lazy loading AdSense is a great way to optimize your monetization strategy and make more money without annoying your readers. It’s particularly useful for bloggers who want to monetize but don’t want to make their readers feel overwhelmed by ads. However, it can only work if you follow these steps and make sure that you’re still making the most of your posts with AdSense. Ultimately, this means that you can make more money with less code.

You have to wait 35 seconds.
Generating Code...

Getting Info...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.