Must add fan box in your facebook app or site
Posted by mahmud ahsan on October 3, 2009
Facebook
Suppose you’ve a facebook page or you are a developer of facebook app. Now you really want that many users become fan of your app or page.
Now here I’m describing how will you inform people about your app and show them the path to become fan.
For page Owner:
If you have facebook page and your own site, you can easily integrate fan box in your site. So the viewers of your site be informed about your facebook page and will become fan. So if you visit your facebook page and you’re an admin, then you’ll see below option at top left side of your page
If you click ‘Add Fan Box to your site’ you’ll surely visit in this link: http://www.facebook.com/facebook-widgets/fanbox.php?page_id=xxxxxxxxx (where page_id = your page id)
Here select and customize the options and you’ll get a javascript code, now add that code into your site. You’ll see fan box in your site like this:
So viewers of your site will inform about this facebook page, and will get interest to become fan.
For application developer:
The process is same for application fan box as I described above. But If you want to add fan box in your facebook application, then you’ve to done it in different way.
- first get javascript code as the process I described earlier
- now copy that code and paste in a new file suppose fan.html in your application’s server path (callback url). suppose if your application calls http://domain1.com/myfb/index.php then your fan.html should be select like http://domain1.com/myfb/fan.html
- now in your facebook app’s canvas page add a iframe and show the path like below
<fb:iframe src="http://domain1.com/myfb/fan.html" width="250" height="70" scrolling="no" frameborder="0" />
please update width and height according to fan box.
So why you should add fan box in your app’s canvas page?
Because, your app’s users will see an easy way to visit the app’s page and can become fan of your app just one click!
For more info please visit: http://wiki.developers.facebook.com/index.php/Fan_Box
Related Posts
Comments (11)









i would like to intergrate to wordpress website.
@e galindo, its very easy to integrate in wordpress theme. If you use your own hosting then you can easily add widget from wordpress and need to paste the code (from fb add fan page) to here.
Otherewise you’ll need to copy that code in theme page’s code. I don’t know if there are any plugin for it or not. But its very easy to add.
I followed your instruction and got the error:
FBML Error (line 2): unknown tag “fb:fan”
http://apps.facebook.com/mobwarshelper/index.php
http://apps.facebook.com/mobwarshelper/fan.html
How to fix it?
@Batigol, please visit the page of your application. Click Add Fan box to your site, then select the options, you’ll get some code, now add that on your page, it should be working. Because I integrated fan box in many applications. visit http://apps.facebook.com/word-day/ to see. thanks
I’d like to add the FB fan page widget to my myspace, but it doesn’t support javascript or iframe. seems like i need to create a myspace app to do it… any suggestions?
thanks!
@jenn, actually i’ve not much experience in myspace. I am sorry
y para joomla?
wow. thumbs up from the reader. this is an interesting post., Have a Great day.
Hey nice looking blog but it’s a little weird looking in my K-meleon browser. Looks good besides that!
how to integrate facebook fan box in its on fan page? Is it possible? I think javascripts not working there. only fbml supporting there.pls help me
I just thought I’d highlight that having the domain of your web server is critical in this working.
fb:iframe src=”http://domain1.com/myfb/fan.html”
I was doing everything above but with:
fb:iframe src=”fan.html”
and it was still erroring with ‘FBML Error (line 2): unknown tag “fb:fan”’ because, I guess it was rendering through facebook as FBML, not loading it direct from my site as HTML+XFBML.
Hope this helps someone.