How to Reduce Adsense JavaScript Count?

Hello friends, in this post, I will share a few tips for optimizing the Adsense javaScript codes you add to your blogger Blogspot pages to generate income. Thus, your blog will open faster and you will reduce the number of queries.

How to Reduce Adsense JavaScript Count?

You know that you have the right to add up to 3 Adsense ad codes for each page on Blogger sites. Therefore, assuming that you have added an average of 5 Adsense codes on your blog, you will have added a total of 5 javaScript codes. By following the steps below, you can run all your Adsense codes with just 1 javaScript code with a few tips you will apply on your blog.


How to Reduce Adsense JavaScript Count?

1- Log in to your Blogger account and use the Theme > Open your blog's template editor (template codes) page by following the Edit HTML path. The following Adsense javaScript code in your blog </body> Add one line above code and save.

Adsense Javascript Code
<script type='text/javascript'>
//<![CDATA[
(function() { var name = document.createElement('script'); ad.type = 'text/javascript'; ad.async = true; ad.src = 'https://pagead2.googlesyndication.com/pagead/ js/adsbygoogle.js'; var sc = document.getElementsByTagName('script')[0]; sc.parentNode.insertBefore(name, sc); })();
//]]>
</script>

2- After adding the above code, remove the javaScript codes in the Adsense codes you have added to your blog. Similar codes you get from your Adsense account are as follows.

Adsense Javascript Code Removal
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js "></script>
<!-- Adsense -->
<ins class="adsbygoogle"
style="display:inline-block"
data-ad-client="ca-pub-0000000000000000"
data-ad-slot="0000000000"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

By removing the javaScript codes specified in the code above, add your Adsense codes to your blog like the sample code below.

Adsense Ad Code
<ins class="adsbygoogle"
style="display:inline-block"
data-ad-client="ca-pub-0000000000000000"
data-ad-slot="0000000000"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Also, add your page-level ad code one line above the </head> code.

Adsense Page Level Ad Code
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: &quot;ca-pub-0000000000000000",
    enable_page_level_ads: true
  });
</script>

Thus, you have enabled all Adsense ad codes on your blog to work with a single JavaScript code. You have not only reduced the number of JavaScripts, but you have also reduced the number of queries of your blog, allowing the blog pages to open faster.
 I recommend all bloggers to make these edits on their Blogspot page and I think it will be very useful for your blog.
Next Post Previous Post
No Comment
Add Comment
comment url