2010-01-01

How to include google adsense in your facebook application

Posted by David Heward on February 11th, 2009
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.
01.<body style="background: #000000;">
02.  
03.<div style="position: relative; top: -5px; left: -5px;">
04.  
05.<script type="text/javascript"><!--
06.google_ad_client = "pub-*****************";
07./* FB-Header Ad - 728x90 */
08.google_ad_slot = "*************";
09.google_ad_width = 728;
10.google_ad_height = 90;
11.//-->
12.</script>
13.<script type="text/javascript"
15.  
16./pagead/show_ads.js">
17.</script>
18.  
19.</div>
20.  
21.<br />
22.<br />
23.<br />
24.<br />
25.  
26.<p>
27.  
28.<b>keywords</b>
29.<i>keywords</i>
30.Content - Atleast a Paragraph
31.<b>keywords</b>
32.<i>keywords</i>
33.  
34.</p>
35.  
36.<h1>keywords</h1>
37.<h2>keywords</h2>
38.<h3>keywords</h3>
39.<h4>keywords</h4>
40.<h5>keywords</h5>
41.<b>keywords</b>
42.</body>

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).
01.<html>
02.  
03.<head></head>
04.  
05.<frameset border="0" frameborder="0" framespacing="0" rows="100%,*">
06.<frame src="google_code.htm" noresize scrolling="no">
07.</frameset>
08.  
09.<br />
10.<br />
11.<br />
12.<br />
13.  
14.<p>
15.  
16.<b>keywords</b>
17.<i>keywords</i>
18.Content - Atleast a Paragraph
19.<b>keywords</b>
20.<i>keywords</i>
21.  
22.</p>
23.  
24.<h1>keywords</h1>
25.<h2>keywords</h2>
26.<h3>keywords</h3>
27.<h4>keywords</h4>
28.<h5>keywords</h5>
29.<b>keywords</b>
30.  
31.</html>

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.
1.<fb:iframe src=*server address* /includes/google_frame.htm
2.id="games-header" name="games-header"
3.marginwidth="10" marginheight="10" scrolling="no" frameborder="0"
4.height="105" width="740" />
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.

沒有留言:

張貼留言