Monday

How To Place AdSense Ad Below Post Title & Post Body

Posted By: Arin Dey - September 05, 2011
One of the most popular Ad Network on the web is Google AdSense. Most of the Blogger users use it. There is no specific way or trick where should we put the Ads for maximum exposure. Bloggers are putting the ads in places around the header or above the posts or below the post titles. From Blogger Layout view you can easily add AdSense in your sidebar as a gadget. Since Blogger doesn't allow us to place the ads below post titles (see Google AdSense Ad Placement). But placing Ad units below post titles has proven to be one of the most successful money making place in a web page. So let’s go for this AdSense setup and follow the below how-to steps to add your AdSense ads below post titles or below post.
google adsense
Note: Assuming that we are using the new AdSense interface.

Here we go with the steps:

Before we start take a backup of your existing Template before making any changes.

1. Log in to your Google Adsense at https://www.google.com/adsense/
2. Click on My ads tab and open Ad units from the left side by expanding Content link.
3. Now Click new ad unit to create a new ad.
4. Select the size, type and color of your ad. For best results chose either 336x280 large or 300x250 medium rectangle.

adsense code setup

5. According to Blog topic give some memorable name.
6. Fill up the required information, click save and get code button at the bottom of the page.
7. A pop-up window will appear with the ad code. Copy that code.

collect adsense code

8. Now it’s time to paste the code in blogger page but before pasting the ad code in Blogger, we must make it compatible with Blogger format.

Go to Hacktrix (http://www.hacktrix.com/adsense-code-converter/) and paste the ad code in the top box and convert (parse) it. You'll find the converted (parsed) ad code in the bottom box there. Copy the converted ad code.
9. Now open your Blogger account and go to Template (as per new Blogger interface) then Edit HTML tab and check Expand Widget Templates option.

10. Press Ctrl + F to find
<data:post.body/>
               You'll see some code like the following:
<div class='post-body entry-content'><data:post.body/><div style='clear: both;'/></div>
11. Now paste the converted (parsed) ad code just before the above code (for below post title) and paste beneath that if you want them to appear below post body. The result would look something like this:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxxxxx";
/* Advertisement */
google_ad_slot = "xxxxxxxxxx";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<div class='post-body entry-content'>
<data:post.body/>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
12. Click the Preview button to see the preview page. You might not see ads below post titles instantly because sometimes AdSense ads take some time to display. 

13. Save your template by clicking the Save template button. 

14. See your webpage. It’s ready with AdSense Ads.

Note : Make Ads Appear Only on Post Pages

Viewers don't like to see more ads on a single page. So, we can hide the ads under post titles on main page. These ads will appear only when users will click the post title and go to the post page. Follow the steps above but after step 8 you have the converted ad code. Ad some more code in that converted code so that it should look like below:

<b:if cond='data:blog.pageType == "item"'><script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxxxxx";
/* Advertisement */
google_ad_slot = "xxxxxxxxxx";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></b:if>
Just an addition to the previous code by adding “if” condition to make the ads appear only on post pages. After that, follow the rest of the steps.

Please review the policies of Google AdSense before using any code on your blogs. They keep changing their TOS.

Copyright © 2010-2023 Poketors | The content of this website is copyrighted and may not be reproduced on other websites.| Email us at : admin@poketors.com.