How to include google adsense in your facebook application

Adding google adsense to a facebook application has been a rather taboo subject for the last few years that you have been able to develop applications fully. It is now however becoming easier. Although still a taboo subject as to whether google will allow its ads to be displayed using an iframe and wether displaying google ads in this manor violates googles terms of service. Using these sort of ads on your application may run you the risk of having your adsense account closed or suspended at any time, but so far so good for those that i know.

My eCPM with Google varies from $ 0.50 – 0.75 (eCPM). That is reliable, since it’s been like that over a 6 month period.

Google does require you to have a website you own, that it will find acceptable to put Google ads on, that it is Google bots can view it, and it adheres to their policies so only having a Facebook App won’t work for getting you in the door.
You need to have something more than a Facebook App like your company or personal website to point Google at registration, then you are free to use the ads anywhere you want, including your Facebook App.
If you don’t, write up some basic html/php based website with a few pages, and it should be enough to keep Google happy.

Warning:
You run the risk of having the account suspended potentially, since Gooogle Adsense TOS does not permit the use of iframes to display their ads. so you take my advice at your own risk.

I recommend at most 2 ads per page.

Now to the ‘how to do it’ part:

Step 1:

Your first step is to create a page called ‘google_code.htm’ – This is going to be the actual ads page, you will need to add some keywords, targeted references and at the very least a paragraphs worth of content and of course your google ad box code itself.
An example of this can be seen below.

[sourcecode language='html']


keywords
keywords
Content – Atleast a Paragraph
keywords
keywords

keywords

keywords

keywords

keywords

keywords

keywords
[/sourcecode]

Step 2: The middle page

The next step is to create another page called ‘google_frame.htm’ this page has a frame which displays the google_code.htm actual ads page. (I think its a good idea to put some more keywords here too).

[sourcecode='html']

keywords
keywords
Content – Atleast a Paragraph
keywords
keywords

keywords

keywords

keywords

keywords

keywords

keywords
[/sourcecode]

Now for the final step

Okay now on your canvas page or on any page that you use for your facebook application you can now simply include the code below.

[sourcecode='html']

id=”games-header” name=”games-header”
marginwidth=”10″ marginheight=”10″ scrolling=”no” frameborder=”0″
height=”105″ width=”740″ />
[/sourcecode]

Now you should have your very own targeted google ads in your facebook application. It may also be good to make some pages that google can crawl from your google_code.htm etc pages.
Make links to some other pages which will contain some content this will help the relevance of your ads.


Blog written by Dave

I am one of the Directors of Bytewire and I like to blog about lots of different and interesting stuff surrounding the website design and development world.


One comment so far

  1. Yanto
    March 7, 2010 at 4:59 am

    Do we use the same way for other advertising, such as Adbrite?


Leave your thoughts

You may use these HTML tags and attributes in your comments.