There are mainly three ways to insert your Google AdSense Ad Code into BlogSpot .com blogs viz. a) Clicking on the “Earnings” tab in your blog dashboard; b) Through AdSense widgets; and c) Adding ad code directly into HTML/JavaScript Gadgets, posts, pages and templates.
As we know that the Google AdSense is fully integrated with Blogger. But, I surprised why my AdSense Ad units code was not showing the Advertisement within my own Google AdSense approved blogger blog itself.
Whenever I tried to insert the ad code directly into blogger template, it results either blank space or showing XML (Extensible Markup Language) and HTML error message like:
When try to Preview Template:
“Could not load template preview: Error parsing XML, line 835, column 15: Attribute name “async” associated with an element type “script” must be followed by the ‘ = ‘ character.”
When try to Save Template:
“Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The content of elements must consist of well-formed character data or markup.”
After scratching my mind half an hour, I come to know the fact that we can’t directly insert Google AdSense Ads code inside the blogger templates through EDIT HTML feature in blogger blog. We have to change the code using a simple trick by just replacing only the three special characters into string text formats:
The left angle bracket (<) replace with (<)
The right angle bracket (>) replace with (>)
The double-quote character (“) replace with (")
You may however use our one click HTML/JavaScript parser encoder tool to get rid of errors while changing AdSense code for your blog.