How to redirect a visitor after they "like" your Facebook page

Want to make your website users like your page before redirecting them somewhere? Use this code! HTML:

<div id="fb-root"></div>
//change pagetolike
<fb:like href="" send="false" width="450" show_faces="false" font=""></fb:like>
<script type="text/javascript">
window.fbAsyncInit = function() {
//change to your facebook app id
FB.init({appId: 'YOURAPPID', status: true, cookie: true, xfbml: true});
FB.Canvas.setSize({ width: 520, height: 1500 });
function(response) {
// change pagetoredirectto
window.location = "";
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +

Shane Stebner

Author: Shane Stebner

Shane is a successful web-developer specializing in responsive design, and the open-source LAMP stack. Over the years, he's gained in-depth experience with Stripe, Twilio, PhantomJs,, PayPal, Facebook, Twitter, and many other plugins/APIs.

comments powered by Disqus