Follow this Blog!

May 27, 2010

f Comment

Solving Google Blogger Problems With Custom Javascript!

Amazon In Google Blogger, I put my adsense javascript code somewhere in the HTML template but adsense just does not show? Why?

Solution
When you manually put Javascript code in HTML template in the admin panel you have to be careful with comment inside of it. Your Adsense code looks something like this:

<script type="text/javascript"><!--
google_ad_client = "pub-1234567890";
/* 160x600 ink, created 5/26/10 */
google_ad_slot = "0987861562";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

When you copy it and paste it in your blog's HTML template and save, Blogger would join everything within <!-- and //--> into one single line, making it a Javascript comment. That's why you don't see Adsense.

To fix it, simply remove <!-- and //-->.

An alternative is to insert the Adsense code in the individual post because Blogger leaves the formatting as it is, but it might be a hassle to do this for every post

If you have any questions let me know and I will do my best to help you!
Please leave a comment here!
One Minute Information - by Michael Wen
Find Michael on Google or Facebook
ADVERTISING WITH US - Direct your advertising requests to Michael