Google's introduction of asynchronous AdSense code to improve web latency and provide the best experience for your site visitors, enabling faster page loading.
Many blogger platform users encounter the error "Attribute name "async" associated with an element type "script" must be followed by the ' = ' character" every time they add asynchronous adsense code to their blogger template.
On this occasion I want to show you how to overcome this problem or how to add AdSense code to a blog template without any errors.
This method is safe and not a modification prohibited by Google, because what we are doing is correcting the "async" semantics for XML.
If you copy and paste your Adsense code raw into your blogger template, an error will occur, the highlight shows where the error is:
<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>
To fix it please replace it with async="async" as in the following code:
<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>
Then save your blogger template and it's time to say CONGRATULATIONS!
Netizens
Q1:
IMANTO MATABOND Dec 30 2016, 13:40:00
- thank you for the useful article..
- I want to ask again, bro... if I put an ad unit in JavaScript, does the async have to be doubled too?
- Thank you very much, bro..good information...hope you will be more successful..amen.
A:
- Hi IMANTO MATABOND, you're welcome
- no need bro, if it's already in the widget >> javascript >> just paste it there, because the widget format is already appropriate. Including if you want to paste it in a post, you don't need to edit it, just paste the original.
- you're welcome, amen.