DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
HomeRegisterMembershipsGetting StartedDomain Tools Domain EbooksSEO Software Domain Resellers Advertise

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Article Library > Library > Web Design
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 07-16-2005, 02:25 AM   #1 (permalink)
Account Terminated
No Avatar
 
Last Online: 08-19-2005 09:43 AM
iTrader: (1)
Join Date: Jul 2005
Posts: 134
DNF$: 475


Displaying Google Adsense in Blogs

This article is from http://www.goarticles.com
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.

Last edited by blindchild; 07-16-2005 at 02:26 AM.. Reason: typo
blindchild is offline   Reply With Quote
Sponsored Ads
Old 10-01-2005, 02:02 AM   #2 (permalink)
Gold Lifetime Member
No Avatar
 
Last Online: 01-03-2008 04:24 AM
iTrader: (1)
Join Date: Sep 2005
Posts: 79
DNF$: 1,482
Location: Pakistan,Lahore


Re: Displaying Google Adsense in Blogs

nice thing i will try it
mubashirnisar is offline   Reply With Quote
Old 10-01-2005, 11:06 PM   #3 (permalink)
DNF Addict
 
Duncan's Avatar
 
Name: Andy Laws
Last Online: Today 05:32 AM
iTrader: (82)
Join Date: Oct 2004
Posts: 3,759
DNF$: 1,186
Location: North Carolina
Country:


Re: Displaying Google Adsense in Blogs

?
__________________
TopicTown.com - Earn $0.02 per post - register today!
Duncan is offline   Reply With Quote
Old 10-13-2005, 07:06 AM   #4 (permalink)
Platinum Lifetime Member
 
myblueshoes's Avatar
 
Last Online: 02-05-2009 01:24 AM
iTrader: (0)
Join Date: Jun 2004
Posts: 177
DNF$: 411
Location: Raton, New Mexico USA


Re: Displaying Google Adsense in Blogs

This is a really nice trick I admit. So I will give you one too. Please read my sales page:
"How to make money with your blogs" here:
http://www.myblueshoes.com/rss2blog/

Hope this helps!
myblueshoes is offline   Reply With Quote
Old 01-16-2006, 11:55 AM   #5 (permalink)
Platinum Lifetime Member
No Avatar
 
Name: SAM
Last Online: 02-20-2008 02:29 PM
iTrader: (6)
Join Date: Dec 2005
Posts: 354
DNF$: 567
Location: NEW YORK
Country:


Re: Displaying Google Adsense in Blogs

is it leagl? i don't want google cancel my adsense account,
AHKIPSLIPKNOT666 is offline   Reply With Quote
Old 01-16-2006, 03:18 PM   #6 (permalink)
Platinum Lifetime Member
 
myblueshoes's Avatar
 
Last Online: 02-05-2009 01:24 AM
iTrader: (0)
Join Date: Jun 2004
Posts: 177
DNF$: 411
Location: Raton, New Mexico USA


Re: Displaying Google Adsense in Blogs

Yes it is. Many of us are using it with much success.
myblueshoes is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:02 PM.
Copyright @2001-2009 DNForum.com