Monday, April 13, 2009

Adding Adsense code in the Blogger posts

Many of us wonder how can we insert the adsense code inside the blog posts well you don't have to wonder coz solution is there just read this tutorial and you can add your adsense code in your blog posts.

Before we go further i want you to save a copy of your template, if anything goes wrong you can always revert back to your previous settings:-

So, as we know the blogger doesn't accept the java script in the posts so for that we have to change the adsense code a little bit, don't worry it is 100% legal, we just have to replace the
<--or-->, "or" tags as blogger don't accept these tags inside blog posts, so We have to replace this < with this &lt; and this > with this &gt; and these "" with this &quot;

So your code

<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxx";
google_alternate_color = "ffffff";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel ="xxxxxxxxxx";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


After Modifying Will Look Like This:-


&lt;script type=&quot;text/javascript"&gt;&lt;!--
google_ad_client = &quot;pub-xxxxxxxxxx&quot;;
google_alternate_color = &quot;ffffff&quot;;
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = &quot;160x600_as&quot;;
google_ad_channel =&quot;xxxxxxxxxx&quot;;
google_ad_type = &quot;text_image&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;0000FF&quot;;
google_color_url = &quot;666666&quot;;
google_color_text = &quot;333333&quot;;
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;


You can modify it manually or you can use a parse to do it for you automatically just paste the code press enter and you code is ready.

You can use http://www.blogcrowds.com/resources/parse_html.php to parse your code.


1. Show Adsense after the Post


Just open your downloaded template in Notepad and find the following code

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

Now insert your code just after <data:post.body/>.

So you Adsense code will look like this.

<p><data:post.body/>your Modified Adsense Code Here</p>

2. Show Adsense before the Post


Look for the code given below, in your template.

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

Now insert the Modified Adsense code just before <data:post.body/>.

Now you code will look like this.

<p>Modified Adsense Code Here<data:post.body/></p>





3. Show Adsense Ads between the Title And the blog Post



Look for the code.

<div class='post-header-line-1'/> . Add the Modified Adsense code below this line.


4. Show Ads in Post Footer


Look for the code. <div class='post-footer'> Add Your Modified Adsense code above this line.

It will Look Like This:-


<div>Your Modified Adsense Code Here</div>

<div class='post-footer'>

You Can Play it with on more places as if you want it in the left side or right side put the code in Div tag and use left or right float..........

You can share your experience with me.........

0 comments: