2006/06/09

Place Ads in Middle of Blogger Posts

Enlighten People:     


When you make a Blogger template, you can place ads in the sidebar and on top. However, the positions of the ads are static. The main point is that you cannot place an advert inside a post. Correct?
Incorrect! Using a bit of Javascript techno-wizardry you can place AdSense ads in the middle of your Blogger posts easily. I don't promise, but it should increase your CTR. Let me show you how:
  • Log in to Blogger and go to Template
  • Find the <$BlogItemBody$> tag in your template
  • Replace it with:

<p>
<ItemPage>
<div id="adsensical<$BlogItemNumber$>start"></div>

<div style="margin:5px 0 -5px 10px">
<!--PLACE YOUR AD CODE HERE-->
</div>

<div id="adsensical<$BlogItemNumber$>end">
</ItemPage>
<div id="adsensical<$BlogItemNumber$>body"><$BlogItemBody$></div>
<ItemPage>
</div>

<script language="JavaScript">
//AdSensical Place Ads in Middle of Blogger Posts
//By hackman_3vilGuy http://adsensical-adsense.blogspot.com
//hackman {AT}caller {DOT}me {DOT}uk

var topbit=document.getElementById("adsensical<$BlogItemNumber$>start");
var bottombit=document.getElementById("adsensical<$BlogItemNumber$>end");
var s=document.getElementById("adsensical<$BlogItemNumber$>body").innerHTML;
var regexIndex=s.search(/<!--adsense-->/igm);
if(regexIndex>0) {topbit.innerHTML=s.substr(0,regexIndex);bottombit.innerHTML=s.substr(regexIndex+14);}
</script>
</ItemPage>
</p>

Copy this code
  • Replace <!--PLACE YOUR AD CODE HERE--> with your real Adsense code you want to put in
  • Now in every post place <!--adsense--> somewhere in the HTML (click Edit HTML) of the post where you want the ad to appear!
That's it! If you implement this you should hopefully get a greater CTR and therefore more cash and the method is within the ToS. This only displays the ads on item pages. If you want to display them on all pages then get rid of the ItemPage tags but watch out that you only have 3 ads per page. If you forget to put the tag in, your ad will appear just before the article. Enjoy, just please don't forget to link back here.

2006/06/01

Developers - AdSense API released

Google has announced a new API for AdSense (beta of course like everything else Google). I got really excited as I am a developer and thought it would be cool. It's sort of cool but wasn't quite what I was expecting.
For a start you need a minimum of 100,000 daily page views which rules out most people.
The purpose of this API is to set up and configure AdSense ads for your visitors without them leaving your site and going to the AdSense website. From your site you can sign up new users and choose ads for them. While they are using your site to place their ads, you will receive a (currently undisclosed) revenue share of what they make. Sweet!
Using the AdSense API, you can enable users to perform a variety of AdSense functions without leaving your website, including the following:
- Create an AdSense account
- Manage an AdSense account
- Create and modify AdSense for content ad units and link units, AdSense for search boxes, and Referrals
- View detailed reports to monitor performance and earnings

The AdSense API is mainly geared at web hosting, wiki, blogging and web publishing sites as they can be portals for the people using those sites to put AdSense in their content and make money. It can be accessed by SOAP so can be accessed by most modern programming languages like Java and C#. I haven't checked the terms and conditions but you should be able to make this into a desktop application.
Hopefully it will become more open and I will be able to give it a go.

lala moulati ana9a maghribia