Refinance now before rates go up! Get multiple rate quotes at GetMyLender.com.

Adding Asynchronous Adsense Code To Blogger Template Without Error

In this tutorial, we will see how we can add asynchronous adsense code to Blogger template without error. Whenever we add adsense code in the template of blogger, asynchronous adsense code is essential because it improves web latency. As well as it gives better user experience for your site visitors allowing faster page speed and general site performance.

Let us consider that you have Google Adsense account, you login to your account. And your are tried to generate ad code. While generating ads code, Google will ask you to generate synchronous or asynchronous code for ads. We always choose asynchronous code option for better web latency and faster page speed. You will get adsense code with script attribute async.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script> <!-- Head_LeaderBoard --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="XXXXXXXXXXX" data-ad-slot="XXXXXXXX"> </ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

Now, you copy that code and paste in the template of blogger and tried to save template. But while adding this asynchronous adsense code to blogger template, it always give following error/warning : “Attribute name “async” associated with an element type “script” must be followed by the ‘ = ‘ character”. Every time you tried to add the asynchronous code to your blogger template, it will give error.

Edit the asynchronous code and add the “async” to async attribute. So your adsense code will be look like :

<script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script> <!-- Head_LeaderBoard --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="XXXXXXXXXXX" data-ad-slot="XXXXXXXX"> </ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

Note that, =”async” attribute in line number 1 in the asynchronous adsense code. Then save your Blogger template. You will not get such type of error/warning.

Conclusion :

I hope that this article would have helped you in understanding to add Asynchronous Adsense Code to Blogger Template Without Error. Please share your knowledge if you know more about this attribute. Your feedback and constructive contributions are always welcome.


No comments:

Post a Comment