Give me 31 Days and I’ll Give You a Better Blog… Guaranteed

Check out 31 Days to Build a Better Blog

Give me 31 Days and I’ll Give You a Better Blog

Check it out

A Practical Podcast… to Help You Build a Better Blog

The ProBlogger Podcast

A Practical Podcast…

FREE Problogging tips delivered to your inbox  

Putting Google Adsense ads inside your Posts

Posted By Darren Rowse 16th of April 2005 Adsense 0 Comments

Duncan wrote a helpful post on How to place Google Adsense ads next to your text – like he says in his post – one of the best positions I’ve found for Adsense ads is within or as near as possible to your content.

Whether you use this approach will of course depend upon the overall purposes of your blog (for instance I don’t do it as much here at ProBlogger – but do it more at Digital Photography Blog).

Duncan posts the code that he uses to get his ads into his text – I use a slightly different approach (add a “<” to the start of this code and a “>” to the end (and change the channel and publisher code to your own)…

script type=”text/javascript”><!–
google_ad_client = “pub-XXXXXXXXXXX”;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = “300x250_as”;
google_ad_channel =”XXXXXXXXX”;
google_color_border = “FFFFFF”;
google_color_bg = “FFFFFF”;
google_color_link = “A40323”;
google_color_url = “999999”;
google_color_text = “000000”;
google_ad_type = “text”;
<div style=”float:right;margin-left:7px;margin-right:10″>
<script type=”text/javascript”

This is the code for the 300 x 250 pixel ad on this page. I place it after the title tag and before the body tag on the individual page (I’m using MT on that blog).

The disadvantage of this approach is that it can crowd your post a little, especially if you also place photos in your post at the top of the page – its worth playing around with it to see where it works best on your blog before doing it.

Feel free to use and adapt the code above and let me know how you go with it.

About Darren Rowse
Darren Rowse is the founder and editor of ProBlogger Blog Tips and Digital Photography School. Learn more about him here and connect with him on Twitter, Facebook, Google+ and LinkedIn.
  • Pingback: » AdSense - In The Right Place()

  • Vic

    I’ve increased my CTR quite a bit by employing that technique (and others as well), and I use a format that doesn’t crowd things too much.


  • PC

    But are you not fiddling with the Adsense code and TOS by inserting div tags between the code?

  • I had originally done this also on my blog when I first started, but it showed for every post on my main page, far exceeding Adsense’s policy of a maximum of 3 ads per page. So I stopped that.

    Getting to know blogger after a while, I realized that I can add tags that will allow me to show the ads only on the item page.

    Now, on my main page, I have 3 ads and 1 Ad-Link. When an item page is currently shown, one of those 3 ads doesn’t show and instead shows within the post.

    Hopefully this will help increase click-throughs.

  • Tom

    Does anyone have any thoughts or tips on how to properly integrate the 350 X 250 pixel google ad block within WordPress 1.5 ?

    I think the proper way to do it is to place Darren’s code above within your SINGLE.PHP file which should reside in the directory of your themes folder (the one you are using).

    I have been having waaaay too much fun hacking away with the new wordpress 1.5. This should be illegal to have this much fun. hehe.

  • Good point Leonivek – this is not a strategy you can as easily do on a Blogger blog as it doesn’t have an individual archive like WP or MT does.

    You’re right Tom in suggesting that the above strategy is what you do with WP – put it on your individual entry (some call it a single entry) template not your ‘main’ one or you’ll end up with the ads on every post which both doesn’t look good and is against Adsense’s rules.

  • I started to use that because it does not mess so much with other things but have the problem that I quote quite often (see for example here but it messes up with my blockquotes.

    Also, if you can work a bit with your code, you can choose to display such add based on the date of the entry.

    I use this on my main blog: Only entries older than 2 days have this inline advertisement. I think this is okay for bloggers so search engine users see it, but not the normal blogreaders. :)

  • Great advice. When we started to implement this on all of our sites, we tripled our $$$.
    Don’t hesitate to show the ads, they are part of the landscape now and it’s almost like people have to click on that little blue link.

  • So that is how you do it! A-ha!