Friday, April 29, 2011

Putting Adsense ads inside Blogger posts

This article shows you  how to place AdSense ad units right inside Posts or Pages on a Blogspot blog.

Once you have signed up for AdSense, you can easily put Adsense ads into blogs.  Blogger has options that let you place ads gadgets in the page template, without seeing any HTML code.  Ads may be placed in the sidebar(s) and in the footer of each post.

But there are limitations to this, and sometimes ads in your sidebar aren't the best approach, because readers easily become "ad-blind" and ignore them.

A Better Approach?

To make it more likely that readers will see your ads, you may want to put them into the body of your posts, as I have done underneath this paragraph.

This won't always be better than having ads in your sidebars or immediately above or below your posts - it all depends on what your blog is about, and how people read it.   But it may be worth doing to test to see which placement is better for your blog.

How to put Adsense Ads into Posts or Pages:

Blogger doesn't have any tools to support this.  So you need to put the AdSense code into your posts yourself.   While this is a bit fiddly, it does mean that you have a lot of control over where the ads go, and how they look, including the option to show image-only ads.

Follow these steps:

  1. Get the ad-code, and copy into your clipboard.  (The AdSense help page for this is here.)
  2. In the Blogger editor, write the contents of the post.
  3. In  Options (under Post Settings in the bar on the right of the Post Editor), check that "Use <br /> tags" is chosen for the Line Breaks setting.
  4. Go to the place where you want to put the ad.  Put in some "marker text" (a word that isn't used the post, eg "XXX" ).
  5. Align the marker text  the way you want the ad aligned (eg centered).
  6. Choose the "HTML" tab, and go to the marker-text.
  7. Replace the marker-text with the ad-text from step 1 (ie paste it in)
  8. If necessary, put line-breaks (<br />) before or after the ad.
  9. Publish the post, and check that it looks the way you meant it to.

Things to be aware of:

Google will only display a certain number of ad-units per page.   Even if you try to show more than this by putting the code into posts, ads will not be shown.

Also, having ads inside your posts does not mean that they will show up inside the RSS feed of your posts, or inside emailed posts created with the follow-by-email gadget or some other way:   If you use these tools, then you may want to enable AdSense for Feeds.

Related Articles:

Troubleshooting Adsense Ads in Blogger.

Putting 3rd party HTML into your Blog

Showing Image-only AdSense ads

Stop mis-use of your AdSense account

Chitika - an alternative advertising tool for bloggers

Share this Article


HTML link code:

BB (forum) link code:

Subscribe to Blogger-hints-and-tips

FeedBurner will send a confirmation message. Click the verify link in it to start your subscription.

Follow Me on Pinterest Subscribe to Blogger-HAT on Google + RSS subscription icon Follow BloggerHAT on Twitter


  1. Hi
    thanks for this info....
    but what i want is automatically display ads...
    without inserting code for individual posts

  2. Google have documented that pretty well - see:

  3. I've tried it but failed. Reasons:
    1. I don't understand what do you mean by "Blogger Editor". I presumed, Posting>New Post and also Posting>New Post>Edit HTML because only there I could find your next step i.e. Post Options.
    2. In "Post Options" there is no option of "ignore newlines".

    Thereafter, I couldn't proceed. Can you please elaborate further? Sorry but I'm new to this.

  4. SK, you're heading in the right direction. Blogger changed the value of "ignore newlines" to "Use
    tags". I've just updated the article to reflect this, and also to clarify the other points you raised.

  5. Thanks a lot, information was helpful. i love the layout and everything about this blog. it's just too beautiful.once again thanks...

  6. WOOOOOOOOOO! EXCELLENT. I've been searching the net for weeks on how to do this but they all just showed how to put adds below posts. I heaved a sigh of relief when it finally worked. Keep up the great work!

  7. Question: Is there a way to do this and have text wrap-around it like it would a photo?


  8. Yes. It worked for me. Thanks a lot.

    Prem Kumar

  9. thanx thanx thanx , you are awesome

  10. Thanks a ton.. I really wanted.. To know about this, You rock

  11. This is not working! Can you please explain more clearly? Do you have to parse the adsense code? When I add the adsense java script code directly into the HTML code of the post like you say, it just comes up as empty space.

    Appreciate the help!

  12. It works wonderful! Thank you for the info so much :-)

  13. I want to insert code in every posts automatically, how can I do that?

  14. i think google only allows 3 ads per post but as i can see you have more the 3

    1. We can only have three AdSense ads per page. But other types of advertisement (eg my direct ones from DiscountDomains24) don't count towards that total.