Put Your Adsense In The Middle of The Post



In the famous Google AdSense heat map are reported the most profitable areas where to put advertising for your site or blog.
There is no mention of a placement in the middle of your posts. Why?
Because by default Blogger, the blogging platform offered by Google, doesn’t offer a way to break a post in the middle and put there an ad.
But, if you search very carefully on the Net, you’ll find that several webmasters tried to put ads in that position and report a significant increase in profits.

This site doesn’t confirm an increase in profits when an ad is in the middle of a post, but explains how to put AdSense in the middle of a Blogger post.


There is a simple way to solve this problem: move post body around the advertising code, just with a bunch of JavaScript and a couple of DIVs. In 2 easy steps:

Ok Let's Go

In your Blogger template:


Find the tag <$BlogItemBody$> and replace it with following code:

<div id="prv<$BlogItemNumber$>"></div>

<div style="clear:both;margin:10px 0">

<!-- Your AdSense code -->


<div id="fst<$BlogItemNumber$>">



<script type="text/javascript">
var obj0=document.getElementById("prv<$BlogItemNumber$>");
var obj1=document.getElementById("fst<$BlogItemNumber$>");
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);}


Find the tag <data:post.body/> (you must check Expand Widget Templates in Blogger console) and replace it with following code:

<div expr:id='"aim1" + data:post.id'></div>

<div style="clear:both; margin:10px 0">

<!-- Your AdSense code here -->


<div expr:id='"aim2" + data:post.id'>



<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);}

Note that you must replace <!-- Your AdSense code --> with block code provided by Google.

In every blog post:

Put a special code when writing a post

<!-- adsense -->

in the exact point you want to appear AdSense advertising.
Done!Digg my article

Related articles :

  • How To Identify LCPC/MFA Junk Ads
  • 5 Tips To Increase Income
  • AdSense in Blogger Post Body
  • Optimize Adsense ads on your Blog to Increase Your Profits
  • Top 10 Google AdSense Mistakes
  • Increase Adsense CTR With Background Image


    13 comments to "Put Your Adsense In The Middle of The Post"

    Lotus Flower said...
    March 22, 2008 at 12:42 AM

    Thanks a lot for all the very useful information.


    DJYano said...
    March 22, 2008 at 12:58 PM

    No problem, visit my blog more

    Anwar Yassin said...
    March 24, 2008 at 5:41 PM

    DJyano. How did you put adsense script at the top n the botom of your post ?

    DJYano said...
    March 24, 2008 at 10:18 PM

    Maybe you interested on this anwar yassin


    Taylor said...
    May 23, 2008 at 2:35 PM

    Exactly what I keep finding for this solution. IT WORKS, BUT Is it against any policies?

    please get back at me with an answer if you get the chance. ttomp13@gmail.com

    Anonymous said...
    October 20, 2008 at 11:08 PM

    Please is there any easy way to put adsebse ads in the middle of my blog

    DJYano said...
    October 20, 2008 at 11:21 PM

    This is the simplest way my friend, you are using blogspot. This is the only method i know.

    I will update you if i can find a simpler way, just subscribe to my rss feeds for my latest updates.

    Anonymous said...
    October 21, 2008 at 6:52 AM

    That is good info. I will use it in my blog

    DJYano said...
    October 21, 2008 at 2:18 PM

    Hi Anonymous,

    Why don't you use your real name or nick? Let people know you.

    Josh said...
    November 18, 2008 at 3:06 PM

    I think this is exactly what I am looking for, but I'm having a hard time getting it to work.

    After a bit of effort I was able to get an ad to show, but not only does it show on every single post (I don't want that if possible) but it shows it at the top of the posts, not where I put the special adsense code insert.

    Also, blogger didn't like the line "data:post।body"...it made me change it to "data:post.body". Just a note.

    AsukaC said...
    December 20, 2008 at 5:17 PM

    Thanks for sharing the info. As Josh says it works but I also wanted to hide an ad in the default position if I don't put in "<!-- adsense -->" phrase. Hide or Show alternative is better I suppose. I try to customise the code now. Anyway thanks for the hint.

    Lucy said...
    February 1, 2009 at 9:04 AM

    Thanks for the info! Did you find that putting the ad in the middle worked in bringing in more clicks/revenue? A follow-up would be great! good luck to ya.

    DJYano said...
    February 1, 2009 at 11:28 AM

    Yes Lucy, i earned more by this. But i have to remove this because this code has conflicts with my template.

    Post a Comment