BlogSpot

Add Google Adsense and other JavaScript to Blogger (blogspot) Templates

Some bloggers want to add google adsense codes to blogger template, but put the codes into the blog pages by manually editing the XML-based template HTML coding interface. In fact, the java can not work.

Usually, you can add the JavaScript  codes to BlogSpot in the block.where the codes you can add to above or below the post body, header, footer, within sidebar.

Add google adsense javascript to blogspot.

Go->Layout  -> Click Add a Gadget –>click the button on the left of HTML/JavaScript.
Then, add your adbrite or google adsense codes to the form.Add google adsense javascript to blogspot

if you want add the google adsense java codes to the templates, I mean, in the xml, you should do some change.if not , you may get some error just like:

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 reference to entity “zs” must end with the ‘;’ delimiter.

 

or

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 processing instruction target matching “[xX][mM][lL]” is not allowed.

then, you can change the java code like this,

< – &lt;
> – &gt;
& = &amp;
”= &quot;

if you have do this, your java code in blogger templates  will work.

for example: put the google adsense javascript to blogspot template:

&lt;script type="text/javascript"&gt;&lt;!–
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 = "0000FF";
google_color_text = "000000";
google_color_url = "000080";
//–&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;

Don’t worry about violating AdSense TOS or other terms and conditions, as once the blog’s web pages are rendered and presented to the viewers and visitors, the code will be exactly same as the original code before any replacement.ofcource, you can double check it.

2 Comments on “Add Google Adsense and other JavaScript to Blogger (blogspot) Templates

Comments are closed.