Putting Google Adsense ads inside your Posts

Posted By Darren Rowse 16th of April 2005 Adsense

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”;
//–></script>
<div style=”float:right;margin-left:7px;margin-right:10″>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
</div

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.

Exit mobile version