First, I’ll give a basic description of what’s going on for an individual who knows nothing about web design/development, then move into the how to section.
Recently, Facebook has made a lot of changes to their API – which means that some old functionality has changed – like using a page tab to take you out of Facebook. Of course, Facebook wants to keep you on Facebook, but sometimes, you want people to leave Facebook to view YOUR site.
With the new timeline layout, there are now 4 spots for applications and what used to be called page tabs, but you can really only highlight 3 main items (as the 4th spot is reserved for your photos). This makes whatever you choose to place in these 3 positions a bit more important (others appear but are hidden by a drop-down button). One possible choice for one of these links could be a link to your website, or a specific promotional page on your website.
These are also available on fan pages too. Other items that could go into these 3 spots could be apps that link users youtube, twitter, or games, or a number of different things.
Basically, Facebook will let you develop your own html and css pages, and slap them in an iframe within Facebook – the limitations here is that the viewing area is restricted to about 520px or 820px (820px is a new addition with the current changes to Facebook), which is a bit limiting. You need to create a facebook application to do this, and basically all the application does is tell Facebook to display your page inside of the viewing area in Facebook.
We can take this and use it to trick Facebook into directing us to our websites. Any code written within the Iframe will be executed, so with the right code, you can tell your browser to change the parent window (needed because you are in an iframe – a child window if you will).
Now for the meat of the tutorial…
Step 1: Make a page on your website that contains the redirect code.
-Make a file called something like… fbredirect.php and upload it to your server.
-Write this code inside of this page – be sure to replace YOUR_SITE with your actual website URL.
window.top.location.href = “https://www.YOUR_SITE.com”;
<p>If you are not automatically redirected here is a link to <a target=”_blank” href=”https://www.YOUR_SITE.com”>YOUR_SITE</a>. Opens in a new tab or window.</p>
Step 2: Create the Facebook application for the homepage
-Go to developers.facebook.com – click the apps tab along the top. Then click create a new tab (in the upper right corner).
-You need to add 2 sections the app on facebook area, and the page tab section on the create an app page.
-Canvas URL and Secure Canvas URL – these are for your redirects, the first link below is the canvas URL, and the second is the secure URL:
-These link to the file we created in step 1!
-Page Tab Section
Page Tab Name: What you want to appear as text underneath the photo on your Facebook page.
Page Tab URL: The same URL of above with /?app_tab=true after it.
Page Tab URL: Same as above with HTTPS.
Step 3: Allow Your Facebook Page to use the App you just created!
NOTE: Here is a link to facebook’s tutorial on adding page tabs – this process is described in detail there.
-Use this link below in your Address Bar, but replace YOUR_APP_ID with your application ID from the Application you just created, and YOUR_URL with http://www.YOUR_SITE.com – of course you’re replacing YOUR_SITE with your actual site URL – but sometimes it can be confusing which URL you want to use – is it the URL of the APP – no, it’s the URL of the site you want to redirect to.
-This brings up Facebook in your browser. You will need to select the pages you want the application to show up on (your personal page or any number of fan pages you have access to).
-After you select the sites, hit Allow – and you are done. If you did this correctly, your app will show up on your Facebook page. If you have a few apps already, you may have to use the arrow and switch out the position of it so it appears in one of the main 3 spots.
-Now you’ll notice that the application has no picture! This is an easy fix. Click the arrow to expand the application area. Now when you hover over an item, you’ll see that you can edit (the little pencil marker in the upper right) the item. Click edit settings, then add/change the custom image associated with the tab to a custom graphic.
Congratulations – that’s it! If you have any questions about this process, feel free to leave some questions in the comments below.