Thursday, April 30, 2009

How to embed Adsense code within post (after post title and before post body) for the blogger blog ?


First you need to get Adsense for Content code from Adsense. (Click here to know how to get Adsense for content code)

This code will be similar to (This is not exact code it may be different for differ user and different options selected)

<script type="text/javascript"&gt;<!--
google_ad_client = "pub-XXXXXXXXXXXXXXX
X";
google_ad_width = 468;

google_ad_height = 60;
google_ad_format =
"468x60_as";
google_ad_type = "text_image";

google_ad_channel = "";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

This process requires editing of HTML template of your blog and little bit modification in script code of Adsense code. If you are not aware about scripting or HTML then also you don’t need to worry about it. You can apply following simple steps and everything is done

Normally Google Adsense terms and conditions does not allow you to modify its code. But following modification will not harm you since when this code is used in your blog, and when we look at the source of the blog page it will look exactly same as above code.

In the above code replace all & symbol with &

Replace all < symbol with <

Replace all > symbol with >

Replace all “ symbol with "

Hence the above code will look like

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-XXXXXXXXXXXXXXXX&quot;;
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = &quot;468x60_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel = &quot;&quot;;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;

Now following changes you need to do at your blog's HTML template

1) Login to blogger.com and you will see Dashboard

2) Click on Layout / Template link for your blog

3) Now you are at Layout -> Page Elements. Here click on Edit HTML link. This will take you to the HTML template of the blog.

4) Here the first thing you need to do is take a back of your HTML template. Hence you can restore it later if you wanted to undo changes (Click here to know how to backup and restore HTML template for blogger’s blog)

5) After taking back up select check box for Expand Widget Templates

6) Now you need to look for the following code

<p><data:post.body/></p>

7) Now between <p> and <data:post.body/> write following code

<div style=’float: left;’>

</div>

8) And the code will look like

<p>

<div style=’float: left;’>

</div>

<data:post.body/></p>

9) After this you can copy and paste modified Google Adsense code between <div style=’float: left;’> and </div>

10) After pasting the Google Adsense code it will look like

<p>

<div style=’float: left;’>

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-XXXXXXXXXXXXXXXX&quot;;
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = &quot;468x60_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel = &quot;&quot;;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;

</div>

<data:post.body/></p>


11)


Now click to PREVIEW button to verify the changes are correct or not. If everything is alright then click on SAVE button to save the HTML template or click on CLEAR EDITS or DISCARD EDITS to undo all the changes and redo above steps again carefully to rectify the mistake

12) After you have saved the HTML template still if you are willing to revert back to original template. You can restore the backed up template file at step 4 ( follow the instruction to restore the backed up template)

Related Articles

How to have Add a Gadget option for Blog Post section of the blogger’s blog and how to make Blog Post gadget / widget moveable?

How to have Add a Gadget option for Header section of the blogger’s blog and how to make Header gadget / widget moveable?

How to add / Change Header image of blogger’s blog?

How should I restore my blog’s logo after changing to custom template?

How should I change my blog’s logo?

Change the order of the blog post archive

How to enable / disable adsense ads for the blog post widget ?

My blog is lost or forgot username / password of blogger blog

How to change scroll bar color and look and feel for a blog or website / web page?

Blogger Link list with the scroll bar support - link list with large set of links

How to change value of Older Post / Newer Post / Home for the blogger's blog

Enable / Disable receiving comments alert on email for blogger blog

How to make comments for blogger's blog moderated and How to moderate comments ?

Share |

No comments yet

Topics

 
Embed Wave to Blogger