PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Placing Google Adsense on your forum 
Description: Basic info on adsense and how-to place the ads
Author: roddy
Date: Sun Nov 09, 2003 4:46 pm
Type: HowTo
Keywords: google adsense, advertising
Category: Miscellanea
I made a post about this a while ago, and since then I've had a few private messages asking exactly how I'd got the ads onto my forum and so on, so I thought I'd make a new post to explain it. I'm not going write up a full MOD or anything (I lack both time and ability), but I'll try and explain what I did clearly.

First off, what is Adsense?
It's an easy way to make an income from your website. You don't need to chase advertisers, you just place some javascript on your pages. Google then reads your page, sees what it's about (say pizza) and then places ads for pizza delivery services on your page.

Why's it good?
The ads are targeted according to the topic of the page. That means they are more likely to be of interest to those reading the page, and they're more likely to click - and you get paid when they click. I've had ads for cleaning services in Houston, civil union ceremonies in Virginia and 4WD tours of Tibet, depending on the discussion. This is all automatic.

They're entirely text, which means they load quickly and don't flash, blink or pop-up.

These two factors mean that members tend not to object. Comments on my ads have ranged from 'I don't mind them' to 'I really like them'. Nobody has complained or said they are intrusive or annoying.

How's it work?
1.You put some javascript on your page.
2.Someone looks at your page.
3.Javascript says to Google's Adsense server 'gimmie some ads'.
4.Adsense server says 'Can't! Don't know what the page is about. Hang on'
5.User sees page without ads, or with public service announcements
6.Adsense server sends a bot to read the page
7.Server looks at bot's findings and notices the word pizza appears 20 times, and the word Washington appears 6 times.
8.Server makes mental note that this page is about pizza in Washington.
9.Someone else looks at page
10.Javascript says to Google's Adsense server 'gimmie some ads'.
11.Server says 'Sure. That page is about washington and pizza - here's some ads about pizza delivery services in Washington'
12.User thinks 'hey, just what i was looking for' and clicks on an ad.
13.You get paid a little bit.
14. Repeat from #9

Where do I sign up?
First thing you need to do is sign up and be accepted by the adsense program
You should get an answer within 24 hours. If your forum is empty, discusses objectional content, or is occupied solely by your family and friends,you won't get accepted. Adsense targets ads according to content, and therefore you need decent content. I don't know what constitutes decent content, but if your forum consists of a lot of idle chatter and not much information, you may not get accepted.

You also need to be the owner of the domain. If your url ends with /~randomuser or it's a subdomain, you won't be accepted.

How do I put the ads on?
If you are accepted then you get access to the page which lets you produce a piece of javascript. You can choose from a range of colours and layouts. I chose a 728*90 layout in subSilver colours. That layout displays 4 ads and as it's horizontal and takes up the whole width of the screen at 800*600 resolution it's the easiest to integrate into the HTML. You could use a different layout, but fitting it into the HTML could be trickier.

When I got the code I pasted it into templates/subsilver/overall_footer.tpl
(taking great care not to remove the link to phpBB.com Exclamation ). This gave me four ads on the bottom of EVERY forum page. Use overall_header.tpl if you want them at the top of every page.

After reading the Google Terms of Service a bit more closely, I realised I shouldn't really be doing that. You're not meant to display the ads on search pages, for one. Also, userlists and profiles would have very little content on which the ads could be based. I decided to play it safe and remove the ads from all pages apart from the index, forum and topic pages. This is slightly more complicated. If you want to do it the easy way, do what I do above - but bear in mind you run the risk of getting kicked off the program (probably a small risk)

I took the javascript out of overallfooter.tpl and put it into three files
templates/subsilver/index_body.tpl, viewforum_body.tpl and viewtopic_body.tpl. This means the ads only appear on the index page, forum page and the actual meaty topic page. If I want to change anything, I have to change three files instead of one, but I rarely need to change anything.

As for where you put it exactly, that's up to you. If you want to put it at the top, you might get more clicks, but people might find it more intrusive.

I'm not going to go into the HTML aspect of it - just put it in a table cell that spans the entire width of the screen. If you can't do that, search google for 'very very basic html tutorials' (I'm not trying to be mean, but I'm not going to go through the basics step by step and you'll enjoy the learning experience. Really. Try weballey.net for a basic if outdated intro)

That's it really.

What else should I know?
You'll find you get only public service ads at first (and you don't get paid if anyone clicks on them). After a while you should get targeted ads if there is enough content on the page. Remember that forums will naturally have a high percentage of new pages / funny urls with lots of ?f=4&highlight=weeee which will cause the PSA's to turn up - it's a good idea to make use of the alternate ads feature so you can at least display something of your own choosing. You can read about the alternate ads feature on the adsense site.

One thing to be aware of is that Google operates very clever fraud detection systems, and forbids encouraging users to click on ads. You cannot say 'support us by clicking here'. More awkwardly, they would probably frown upon users discussing the ads - that would increase clicks, which would increase cost to advertisers, which would annoy advertisers. Also, that sudden increase in clicks could cause Google to suspect someone is trying to cheat them out of a few dollars. I have an 'about the ads' topic on my forum which specifies that any comments or complaints should come to me by PM only.

How much will I make?
It all depends on how competitive and lucrative your field is and how many click-throughs you get. If you have a site where 20,000 people discuss who the best litigation lawyers in the US are, you'll probably do pretty well. If you're discussing which brand of pencil is best with 50 others, don't go booking any holidays.

The terms of the program mean I can't tell you how much I make (and it's none of your business anyway) but I will tell you that the adsense program has a reputation for turning small hobby sites into second-income earners. How long that will last is anyones guess - and remember that even the smallest of sites needs significant traffic.

Roddy

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.