Displaying Google Adsense in Blogs

By George Manty | Open Tips
Google® Adsense® can be a great tool for making money. Blogs are also becoming a great tool for making money. Many people know that the most profitable position to place Google® Adsense® ads is inline with your article text. The dilemna many of us face is that the Google® Adsense® Terms of Service only allow 3 ad blocks per page. The reason this is a problem for bloggers is that most blogs show more than three posts on the main page or in the archives section of the site. When this is the case you can't post an article Google® Adsense® in the article.

While setting up my wife and her friend's new site ( www.naturalfamilynews.com ), I came up with a trick using JavaScript to fix that problem. The code I wrote works perfectly in WordPress, but you should be able to adapt it to any blog that uses templates.

Step 1. In the head section of the template (between the <head> and </head> tags), you insert the following JavaScript code:

<script> var temp=0; </script>

Step 2. Go to the template used to display your post (in WordPress the main template). Then insert the following code inside the display area for the post:

<script> if (temp>2) document.write("<div style='visibility:hidden;height=1px;font-size:0;display:none'>"); </script>

Step 3 Insert your Google® Adsense® code directly following the </script> tag that you inserted in Step 2 above.

Step 4 Insert the following code after the </script> tag from the Google® Adsense® code you inserted in step 3 :

<script> if (temp>2) document.write("</div>"); temp++; </script>

Step 5. Save your changes and test it out.

What this does is create a new DIV section in your code that is hidden if it appears more than three times on the page. So only three ads will appear on any page. If you use Google® Adsense® in other places in your blog, then you will need to adjust the number "temp" in the first step up to display less inline ads. For instance, only two inline ads will appear if you change the code to:

<script> var temp=1; </script>

Only one inline ad will appear if you change it to:

<script> var temp=2; </script>

I hope this code helps you to make money online. Feel free to let others know about this trick, just be sure to let them know where you heard about it.

About the Author:

<hr> Displaying Google® Adsense® in Blogs by George Manty This article can be reproduced in whole or in part,providing this byline is included along with a link to http://www.canimakebigmoneyonline.com/ <hr>

About this site:

Open Tips website is developed using SEO Web Design by Binh Nguyen to provide free tips and advices from well known experts.

What's next?

Do you like "Displaying Google Adsense in Blogs"?

Link to this page:

  • Step 1: Copy the following HTML code (Click on the box and press Ctrl+C):
  • Step 2: Paste the copied code to your web page's HTML (Ctrl+V) to where you want to place the link.
  • Step 3: When viewing on a web browser it should look like this: Displaying Google Adsense in Blogs.

Share it: Digg Digg del.icio.us del.icio.us FURL FURL Reddit Reddit Yahoo!Yahoo! Favorites Favorites

Featured Tips for Blogging

How to Boost Traffic to Your Blog:Keyword Research

How to use keyword research as traffic building method? If you are serious to make money from blog, you must think about keyword before you write. And use that keyword repeatedly (more frequently...

An Appeal To The Bloggers!

Blogging is smart an art. Blog sites are the nicest portals which do aid people to unfurl their inundating mind streams, in umpteen aspects and share their ideas and experiences. It satiates several...

24 Tips and Strategies on How Everyone Can Blog Right andGet

By the end of 2004 blogs had established themselves as a key part of online culture. "Blog readership shoots up 58% in 2004 6 million Americans get news and information fed to them through RSS...

Should You Get A Blog?

A blog is a type of website. It allows the website owner to easily write messages that get posted to the site automatically, often in a journal or diary-like style. A particularly appealing thing...

20 Ways to Explode your Blog‘s Profitability and Traffic

1. Book Reviews on Amazon - Write a review on a book at Amazon.com. Be sure to select a popular book and make sure it is related to your niche. You put information about your blog, on your about me...

Back to top