Monday, April 21, 2008

Adsense Tips

I have written a post on how to remove adsense widget from your blogger homepage that is to just display the ads when the current page is showing either an individual post or posts under a certain label. Please click here to browse to that post. In that post, the subject matter is that the adsense unit happens to be the widget displayed on a right panel of my blog.

Last week, I tried to show the ads units after every individual post body. I followed the guidelines from "Tips for New Bloggers" to achieve my objective. I did archive the objective but with a defect that the ads do show up only after some posts. I could only view two or three ads units in the same page which contains 5 posts or more. Probably the adsense code was intelligent enough to limit the maximum number of ads units to be displayed in one page.

Thus, I decided to remove the ads if the current page shows more than one posts, meaning the ads should be displayed only in a page which contains a single post. Here, I assume that you have already followed the steps from "Tips for New Bloggers". The next thing to do is just insert conditional check in red color as follows. This check ensures that the ads unit(s) displays only when the page type is item, ie ., the individual post. The ad(s) will not be displayed on the home page or a label page.











You can view the effect of the check in this site. Click on any single post title, you will see the ads. Go to homepage or click on a label, you will not view any ads after the post body. I hope it works for you too.

No comments: