How to parse Adsense code to add within the Blogger template

You want to add Adsense code to your Blogger template at certain locations such as just below the title, after all, the research you have done shows that this is a good place where people are more likely to click your ads. However, the template in the new Blogger does not easily allow this. Fear not, many people have done the research on the structure of the new template and come up with a solution for this. You will find many articles on how to do this, with some of them working and others not easily understandable.
I was hunting for articles on how to do this, and came up with some articles where this is detailed. In the last post, I referred an article that detailed how to do this, and here is another article on the same issue; the difference being that this article tries to explain the changes in the adsense code in greater clarity, explaining the need of why this change needs to be done. Read this article (link) for more details:

If you try to insert any Google AdSense, AdBrite, AdEngage and any other JavaScript based ad code, or client-side components such as counter, tracker, form, snippet, effect, date and time, etc which is JavaScript based, an error message may be returned (an XML message).
The problem is caused by incorrect dynamic interpretation of Blogger XML template when it generates the HTML webpage for the blog page that is requested, probably due to the fact that the AdSense ad code or other code is not a valid XML, coupled with the fact that some ASCII characters have special meaning and reserved functions, confusing Blogger blogging engine. The resolution to the JavaScript based coding does not work in Blogger HTML template error can be solved by replacing special characters or symbols in the script to HTML code.

The article explains how to escape the characters so that the ads from different ad networks such as Adsense, Adbrite, Adengage, in fact, most ad networks that rely on JavaScript based code for serving ads will work. Once you go through the article, you can easily escape the special characters and make the code work.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>