How to insert Google Adsense ads before or after each post in the new version of Blogger? - HashOut
This blog has moved. We welcome you to our new home at http://hashout.org

How to insert Google Adsense ads before or after each post in the new version of Blogger?

If Ad revenue is crucial to your blog then the best place to display your ads is within the main contents of your website or blog as that is what the visitors came looking for. Secondly, it should be "above the fold", i.e. on the visible portion of the page when the page is first loaded as most users don't even scroll down to read the entire post.

In this post I will show how to insert ads after each post title and before the post body (content) in the new version of Blogger. You do not have to insert the code manually into each of the posts. All you have to do is insert the code once into the template. The AdSense server will then automatically display the first three AdSense ad units on the page and there won't be any violation of the TOS too!

Here are the steps:

Note: Before you proceed with any template modifications, it is always a good idea to take a backup copy of your template so that you are safe just in case you or the Blogger server goofs up.


  1. Sign in to the new Blogger
  2. Click on Layout under the Manage: section of one of your blogs. Or click Template if you are already on Posting or Settings tab
  3. Click Edit HTML
  4. Click Download Full Template in order to make a backup of your template on your hard-disk drive.
  5. Click to check the Expand Widget Templates checkbox
  6. Now search for the following line in your template:

    <p><data:post.body/></p>

    and insert the AdSense 336 x 280 Large Rectangle code just before the line as shown below:

    <script type="text/javascript">&lt;!--
    google_ad_client = "pub-YOURPUBLISHERIDHERE";
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
    google_ad_type = "text_image";
    google_ad_channel = "";
    //--></script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <p><data:post.body/></p>

    Replace YOURPUBLISHERIDHERE with your AdSense publisher ID. To find out your publisher id, sign in to your Google AdSense account, click My Account tab and check AdSense for Content under Property info section.
  7. Hit SAVE TEMPLATE.
  8. You're done! Now take a look at your blog.

If you enjoyed this post then Bookmark or Subscribe to HashOut for FREE!

Read more on , , , ,

2 Comments:

  1. Shypy said...

    Great stuff.
    You have assembled all the blogger hacks that an amateur would want to know in a nice collection.

    I love the design too, it's very well done. You have another reader :)

    Btw, congrats on being featured on problogger today. I expect you to expect loads of traffic to flow in.

    Here are some things i would want to know, which hopefully will also give you some topics for future posts.

    1. How Could we add the "If you enjoyed this post then Bookmark or Subscribe to RSS" at the end of each post. Is it just another page element?

    2. Your post about creating expandable posts for archives seems to be affecting the main page to. I s there a method with which we can only compress those posts that are in the archive?

    3. Do i need to learn CSS if i want to really play around with my template like you did? Please elaborate on this.

    Thanks
    shypys[at]gmail.com

  2. RKC said...

    Really nice blog there. I must say your blogger hacks really helped me. Thanks!