The introduction of the asynchronous adsense code by Google to improve web latency and better user experience for your site visitors allowing faster page speed and general site performance may have come at a cost as many bloggers are complaining getting an error that says “Attribute name “async” associated with an element type “script” must be followed by the ‘ = ‘ character” every time they tried to add the asynchronous code to their blogger template.
In this tutorial I want to show you how you can add asynchronous adsense code to Blogger template without error. By the time you finish reading this tutorial you would’ve learnt how to add asynchronous code to HTML without getting the “Attribute name “async” associated with an element type “script” must be followed by the ‘ = ‘ character” error.
Add asynchronous adsense code to Blogger:
First login to your Google Adsense account and generate an ad. Copy the asynchronous code. It looks like this;
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js</span>"></script> <!-- 336 x 280 Responsive QRS --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-731939xxxxxxxx" data-ad-slot="15265xxxxxx" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
Locate the position you want to add the adsense code to on your Blogger template.
You will receive a warning that “Attribute name “async” associated with an element type “script” must be followed by the ‘ = ‘ character.”
Edit the asynchronous code and add the “async” attribute to it like this;
<script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js</span>"></script> <!-- 336 x 280 Responsive QRS --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-731939xxxxxxxx" data-ad-slot="15265xxxxxx" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
Note the =”async” attribute in line 01 in the asynchronous adsense code.
Then save your Blogger template and there won’t be any errors any more. If you find the article “Adding asynchronous adsense code to Blogger template without error” useful, leave a comment on the post.
If you have any problems or contributions please use the comment form to share with me and i will try to assist you in any way i can. Remember to subscribe to my blog.
hi nwosu. thanks again for the post. i can see you’re really filling the gap of your 2014 blogging goals and missions. i’d like to ask please what the differences between the async and sync codes in google adsence dashboard?.How to Root Any Android Phones Manually Without PC.
In Adsense account there having the options can choose Asynchronous code for ads, that most of them don’t know how to add it here you clearly briefed in this post to add code to website.. Thanks for sharing…
Synchronous code is a type of code that will allow the complete loading of one script before the other while in asynchronous code all the scripts loads at the same time. Asynchronous codes will make your site faster and improve your user experience.
i am searching for this kind of data online form past 2 days.Here i get it.While i putting adsense code to template,it gave me error.Now i found where i mistaken.
thanks for sharing it.
Read Also : Samsung Galaxy Note 4 Vs Galaxy Note 3 Comparison
Glad you found it informative.
That’s a wonderful aid to me. I have been searching for this information for quite a very long time. Thanks for this wonderful guide
Hi friend,
Read your post, really that was amazing. In accordance with google, the advantage of the asynchronous rule is it’s mostly guaranteed to never get with respect to other areas of your site loading. This means that users is able to load this content of your pages, regardless of whether they’re having trouble loading this ads.
Thanks for posting
Please I still have issues, the ads aren’t appearing yet, its not been so helpful
What exactly is the issue you are having?
Thank you for that information. Nwosu. Nice to get a little help.
thanks a lot, i have also found a solution to this problem. you can also save it like async=”” , there’s no need to write aysnc in between quotes. One i want to clear here, i am using Chitika code not Adsense