10 Jul 2011

Put adsense in middle of your posts

If you want to monetize your blog,adsense is one of the best ways to earn some decent revenue .One of the ways of increasing your revenue through adsense is to put ads in middle of posts. This ensures a higher click through rate.Another advantage with this is that you can manage more space in your blog by putting adsense ads inside your posts.

How to put adsense ads in the middle of your posts:

TIP: for all posts regarding EDITING HTML make sure that you have a downloaded copy of your template with you just in case anything goes wrong.
  • Log in and get to DESIGN tab and in turn get to EDIT HTML. Now check on expand widget templates.
  • Find <data:post.body/> by holding ctrl and pressing F.
  • Repace it with   this code:

<div expr:id='"aim1" + data:post.id'></div>
<div style="clear:both; margin:10px 0">
<!-- Your AdSense code here -->
</div>
<div expr:id='"aim2" + data:post.id'>
<data:post.body/></div>

<script type="text/javascript">
var obj0=document.getElementById("aim1<data:post.id/>");
var obj1=document.getElementById("aim2<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/x3C!-- adsense --x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>



Replace <!-- Your AdSense code here --> with your adsense code. Make sure you parse your codes here before adding them.

Now, save your template and add "<!-- adsense -->"  to all posts in the EDIT HTML section of your posts in order to see the effect.

NOTE:
The position of your ad in the post depends where you put the above code.


0 comments:

Post a Comment