Displaying Google Adsense in Blogs

Home > Blogging Information > Displaying Google Adsense in Blogs

by: George Manty

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 MantyThis article can be reproduced in whole or in part,providing this byline is included along with a link tohttp://www.canimakebigmoneyonline.com/ <hr>

 


Find More related topics below.

  • 'Bad Blogs Have Got To Go, Blogging Could Be Really Cool If
  • 6 Things to post on your blog when you're running out of ide
  • 7 Questions To Ask Yourself BEFORE Starting A Business Blog
  • 7 Tips for Choosing the Right Blog Software for Your New Blo
  • 7 Tips for Successful Blogging
  • 10 Ways You Can Use Blogs RIGHT NOW
  • 12 Reasons Why You Need A Blog
  • 13 Steps to Successful Blogging
  • 24 Tips and Strategies on How Everyone Can Blog Right andGet
  • 40,000 new blogs are started daily - how your web hosting bu
  • Are You a Blogger?
  • Avoid "Bad" Manners While Blogging
  • A Blog Isn't Just For Christmas
  • A Person Is Known By the Blog He Keeps
  • Blogging's Future: Up, Up and Away?
  • Blogging- Vent, Sell, Promote and Earn Cash
  • Blogging Advice - Give Your Readers What They Want
  • Blogging and Pinging- Powerful Backdoor Into Major Search En
  • Blogging Can Be A Collective Experience That Turns Faceless
  • Blogging can improve your search engine ranking
  • Blogging can run your entire web site
  • Blogging Can Turn Faceless Strangers into Close Friends
  • Blogging Communities Turn Faceless Strangers into Close Frie
  • Blogging Explained in Simple Terms
  • Blogging for Business
  • Blogging For Business - Great Reasons For Every Business To
  • Blogging for Dollars
  • Blogging for Profits
  • Blogging for Profits - Finding the Gold hidden inside your w
  • Blogging For Profit; The Simple Success Strategies Of A 19 Y
  • Blogging on Ecademy will boost your web site
  • Blogging: Just How Much of a Phenomenon?
  • Blogging: The best Introduction to Internet Publishing
  • Blogging - what's it all about?
  • Blogosphere Networking
  • BLOGS! What They Are... And WHY They're Becoming A POWER
  • Blogs, like all forms of writing, are an art form.
  • Blogs and RSS Boost Your Online Business, Rankings, Traffic
  • Blogs And Your Work From Home Internet Business
  • Blogs Aren't Just About Expounding Your Ideas To Others...
  • Blogs Are About Getting to Know Yourself Better
  • Blogs are an Art Form that Takes Practice to do Well
  • Blogs are an art form that take knowledge and practice to do
  • Blogs for Dogs: Create Web Domains for Dogs, Cats and Other
  • Blogs for Kids
  • Blogs: The New E-Tool
  • Blogs: Today's Internet Diary and Marketing Tool
  • Blogs: Why Publish Journals on the Net?
  • Blog Construction
  • Blog directories are they worth it
  • Blog It And They Will Come.
  • Blog Marketing: Guerrillas stalk the Internet
  • Blog Problems
  • Blog Your Business
  • Blood Test for Your Blog
  • Brief History of Blogs
  • Can Blogging Increase Web Traffic?
  • Choosing The Blog Software That's Right For You
  • Choosing The Right Blog-Tools
  • Communal Blogging - Who Will Win?
  • Communication problem and what the problem with Blog and Rss
  • Comparing Free Blogging Software
  • Content, Keywords and Blogs I Provoke you to learn More!
  • Corporate Blogging: 7 Best Practices
  • Creating An Effective Corporate Blog
  • Creating Effective Corporate Blogs
  • Details of Getting a Blog
  • Do You Need Help Adding RSS Feeds To Your Blogger?
  • Driving Free Traffic To Your Blog
  • Earn Money Blogging
  • Gathered statistical data announces that Blogs will dominate
  • Gettign a Blog on the Internet
  • Getting a Blog on the Internet
  • Hollander Consultants Plunges into Blogging
  • How To Boost Traffic To Your Blog:How to write a better blog
  • How to Boost Traffic to Your Blog:Keyword Research
  • How to Boost Traffic to Your Blog:Tips to Get Inbound Links
  • How To Boost Traffic To Your Blog: SEO for Bloggers
  • How to Build a Niche Site With a Blog
  • How to Cash In on Blogs
  • How To Create Your Own Blog Using Blogger
  • How To Generate Solid Web Profits Through the Blog Revolutio
  • How to Get a Blog on the Internet
  • How to Get Started Blogging in 5 Minutes or Less
  • How To Get Your BLOGS "Site Feed" Listed In Yahoo! a
  • How To Make Money From Your Blog Content
  • How to Make Money With Your Blog?
  • How to Profit from your Home Business Blog
  • How To Set Up A Blog
  • How to Use A Blog for Free Traffic
  • If an RSS feed is the Yahoo backdoor, is a Blog Google's?
  • Interactive Content - Blogs, Forums and Feedback - what does
  • It Makes Sense to Add AdSense to Your Blog
  • Jump on Blogging and RSS Feeds or be Left Behind!
  • Make Money Blogging
  • Make Money Blogging Using These Nine Powerful Strategies
  • Making Money With Your Blog
  • Marketing Revolution with Blogs and RSS
  • MrThe Biggest Reason To Start A Blog...(and it's not what yo
  • News Blogs
  • News Blogs: Escape TV News, Newspapers and Radios
  • Nobody Reading Your Blog
  • Reasons Why You Should Have A Weblogger Installed On Your We
  • RSS Directory Submission: The Key To Blog Promotion
  • RSS for Bloggers
  • Search Engine Marketing With Blogs
  • Search Engine Optimization For Blogs
  • Shorten Your Blogging-RSS Learning and Submission Curve
  • Should Bloggers be Helping Google Fix Their PageRank System?
  • Should Your Website Host A Weblog?
  • Should You Create a Website or Blog for Your Special Event?
  • Should You Get A Blog?
  • Should You Use a Free or Paid Blogging Service 1
  • Small Business: To Blog or Not To Blog
  • Starting Your Own Blog
  • The Biggest Reason To Start A Blog...(and it's not what you
  • The Buzz about Blogs
  • The Fearful, Ignorant Guy Has Got A Blog On The Internet. It
  • The Future Of Next Generation Weblogs
  • The Future of RSS is Not Blogs
  • The Huge Marketing Potential Of A Simple Blog
  • The Monetization Method of Make Money Blogging
  • The Power of the BLOG
  • The Problems with Blogs
  • The Real Bloggers Must Come From Another Planet. I Can't Fin
  • The Right Blog Software Can Make A Blog Stand Out from the C
  • The Secrets of Corporate Blogging
  • This fearful, ignorant guy has got a blog on the Internet. I
  • Top 10 Places to Find the Most Popular B
  • Top 10 Tips for Blogging
  • Top 10 ways to get people online to read your Business Blog
  • To Blog or Not to Blog...
  • Use Blogs and RSS Feeds to get your New Sites and Pages Inde
  • Use Blogs to increase traffic to your web site
  • Webhosting for blogging - free or paid service
  • Web Blogs, Defined, Explained and Understood
  • Web Blogs Defined, Explained and Understood
  • What Are Blogs?
  • What Are Blogs?
  • What Blog Can Make Money?
  • What Every Blogger Needs To Know About Their Target Audience
  • What Is A Blog?
  • What Is A Blog? - A Beginner's Guide to Understanding Blogs
  • What is Blogger.com?
  • Why Blog?
  • Why Wordpress is now my Blog of Choice
  •  

    Search - Ask Knowall
    Third Party Ads
    Site Stats
    7 visitors online.