Error parsing XML in Google Adsense code [Solved]

Error parsing async src of XML in Google Adsense code

Sometimes blogspot blogger blogs show an unexpected error when blog owner tried to integrate Google Adsense codes. You may called it "async error". I could not find the actual reason behind it. Blogger and Google Adsense both are product of Google. Adding code in blogger xhtml template should be easier and hassle free. Google should make a solution for it. But alas! We have to solve it by our self.
A regular Google Adsense (asynchronous) Code looks like this
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-00000000000000", enable_page_level_ads: true }); </script>

and the error message on Blogger/Blogspot blog looks like this-
Error parsing XML, line 161, column 1: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.

The solution is suggested on the error message itself. It said
Attribute name "async" associated with an element type "script" must be followed by the ' = ' character

It means Blogger xhtml wants an equal sign (=) after the word "async"

So, the solution is easy. Just add ="async" right after async in the first line of Google Adsense code.

The original Google Adsense code should change like this way

Original adsense code:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Chnge it to
<script async='async' src=

Error parsing XML in Google Adsense code [Solved]
Error parsing XML in Google Adsense code solved

Don't worry to do this change in Google Adsense, because it is an allowed modification of AdSense code.

No comments:

Post a Comment

Please help me to improve my English. Please Email me or comment below. Thanks...