Problem
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.
Solution
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:
FOR OLD BLOGGER
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>
<div id="fst<$BlogItemNumber$>">
<$BlogItemBody$>
</div>
<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);}
</script>
FOR NEW BLOGGER
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>
<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>
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!
Related articles :
3.18.2008
Put Your Adsense In The Middle of The Post
Subscribe to:
Post Comments (Atom)
Comments
13 comments to "Put Your Adsense In The Middle of The Post"
March 22, 2008 at 12:42 AM
Thanks a lot for all the very useful information.
Cheers!
March 22, 2008 at 12:58 PM
No problem, visit my blog more
March 24, 2008 at 5:41 PM
DJyano. How did you put adsense script at the top n the botom of your post ?
March 24, 2008 at 10:18 PM
Maybe you interested on this anwar yassin
http://djyano.blogspot.com/2008/03/adsense-code-in-blogger-post-body.html
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
October 20, 2008 at 11:08 PM
Please is there any easy way to put adsebse ads in the middle of my blog
posts
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.
October 21, 2008 at 6:52 AM
That is good info. I will use it in my blog
October 21, 2008 at 2:18 PM
Hi Anonymous,
Why don't you use your real name or nick? Let people know you.
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.
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.
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.
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