The method described below will work well with IE, Firefox, Opera, and Safari.
Most of you will probably be familiar with the famous Google AdSense heat map which shows the areas of your website or blog where you should place advertising in order to maximize your profits. Oddly enough, there is no mention of a placement in the middle of your posts.
Why?
Because by default Blogger, the blogging platform owned by Google, does not offer a way to break a post in the middle (or someplace else) so you can place an ad there. But, if you search the Net thorougly, you will find that quite a lot of webmasters have managed to put ads in that position and report a significant increase in profits.
While I cannot as yet confirm a considerable increase in profits when an ad is placed in the middle of a post, I´ll nevertheless explain in this post how to place Adsense in the middle of Blogger posts.
How to place Adsense in the middle of Blogger posts
The solution to this problem is quite simple: You only need to move the post body around the advertising code, which is easily achieved with a bunch of JavaScript and a couple of DIVs (divisions). Just follow these directions:
1. In your Blogger template: Dashboard –> Layout –> Edit HTML –> Expand Widget Templates
Find the tag <data:post.body/> and replace it with the 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>
IMPORTANT NOTICE: Do not forget to replace <!-- Your AdSense code --> with the ad code provided by Google Adsense. Also, the ad code needs to be converted before you can insert it.
2. In every blog post:
Place the special comment
<!-- adsense -->
in the exact spot you want the Adsense ads to appear.
That´s all!
Frequently Asked Questions:
1. Does this method violate Google´s Terms and Conditions?
Definitely not. Answering a direct support request Google stated this method doesn't violate any of their program policies.
2. What if I forget to put the <!-- adsense –> comment in a post?
Nothing. The advertising block will appear in the traditional position as defined in your template before you implemented this modification (in most cases just below the title).
3. What happens on Blogger home page and archive pages when several posts with the <!-- adsense --> comment appear together?
Exactly the same thing that happened before this modification: The Google Adsense service automatically inserts up to 3 AdSense blocks per page in your posts. That means only the first 3 posts (in a top-down order) on your home page or archive pages will show ads.
4. Is it possible for me to automate the insertion of AdSense in the middle of my posts without having to manually place the <!-- adsense --> comment?
Yes, it is. But you will have to replace the JavaScript code listed above with the following one:
<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 t=s.substr(0,s.length/2);
var r=t.lastIndexOf(" ");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+1);}
</script>
Notes:
You may have heard of a couple of different approaches to solve the stated problem that sound simple but, unfortunately, are not working:
1. Copying the AdSense code directly into the post.
This does not work because Blogger will warn you that it is prohibited to insert JavaScript code inside a post (or show some kind of error warning). Bypassing the error warning by flagging ‘Stop showing HTML errors for this post’ will not get you the desired result.
2. Writing a JavaScript to move the AdSense code block in the middle of your post.
This method is prohibited by the Google Adsense Terms and Conditions because you have to modify the AdSense code itself. If you do it anyway, no ads will be shown (you will get an error information stating the website or service is not available).
The method described above also works with other advertising systems, like Yahoo! Publisher Network (YPN), Microsoft adCenter, Chitika, AdBrite, and a host of others.
Thanks to Eblogger Tricks.com.
1 Comentário:
I used to get the AUTO posting to work very well in my blog till I changed the template to Metro Minimalist recently. Please see http://tinyw.in/g1L7 However it doesn't even show a marker I have put now besides the ad code. http://tinyw.in/HnRP I have only two Ads on the page now and have disabled the built in ad. Could you please take a look as this is a vital feature I would like to keep. Many thanks in advance.
Post a Comment