Tag Archives: profile tab

How to Insert “Add Profile Tab” Buttons

As described in an official blog post from Facebook, you can now put an “Add Profile Tab” button in your application or site to prompt users to add your application tab to their profiles for easy re-engagement. All implementations using the JavaScript API can call FB.Connect.showProfileTabDialog or use the fb:add-profile-tab XFBML tag to render the button, while FBML applications can call Facebook.showProfileTabDialog or use the fb:add-profile-tab FBML tag to render it.

Using the JavaScript API for Connect

FB.Connect.showProfileTabDialog(callback);

This method renders an Add Profile Tab button on your canvas or Web page, enabling the user to add your application tab to his or her profile.

If the user already added your application tab, the button doesn’t appear.

You can determine if a user added your application tab by querying the tab_added field in the permissions FQL table.

The optional Callback function can be used to execute after this call completes. It takes one argument, which is a JavaScript object. The object has one key, tab_added, the value for which is 1 or 0.

Using an XFBML tag

<fb:add-profile-tab />

or, if you’re using Connect

<fb:add-profile-tab></fb:add-profile-tab>

Renders a button that lets a user add your application or site’s application tab to his or her profile. Make sure you specify a Tab Name and a Tab URL in your application settings (on the Profiles tab).

If the user already added your application tab, the button doesn’t appear.

You can determine if a user added your application tab by querying the tab_added field in the permissions FQL table.