Google

Saturday, May 10, 2008

Insert Adsense in your blog


Have you ever tried to make the AdSense code directly into your Blogger XML template and get this error? Your template can not be processed as it is not well-formed. Make sure all XML elements are closed. XML error: The processing instruction target matching "[xX][mM][lL]" is not permitted. So you have a solution for the insertion of the AdSense code using blogger widgets.



But that means you can not widgets in each post, the best places to place your ads. Do not worry, there is a way of placing AdSense code directly into your XML templates. Since Blogger started using XML everything is more strict and standardized. The above message simple: the AdSense code is not standized XML and we should resolve all 1replace html character, such as '<' with '>' '"' with '"'. For example:

would be 1
<script type="text/javascript"><!-google_ad_client
= "pub-XXXXXXXXXXXXXXX"; google_ad_width = 336; google_ad_height = 280;
google_ad_format = "336x280_as"; google_ad_type = "text_image";
google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg
= "FFFFFF"; google_color_link = "000000"; google_color_text = "000000";
google_color_url = "000000"; //--></script>
<script type="text/javascript"
1src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

You can use your text editor to replace all the HTML, but Blogcrowds also has an HTML parsed that takes care of everything for you. Now with the code you can paste it anywhere in your HTML code with no error at all. Here are some tips for where in the XML Template you should paste the parsed HTML code. I used a barebone Minima template so it should be similar in all templates. Find the normal text and then add the bolded code are added by me:

0 comments: