Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a Facebook "Like" button that is just a link, not an iFrame?

Tags:

I would like to put a "Like" button into an email message that it going out to our e-newsletter subscribers. The usual way of embedding a Like button, which uses, an iframe technique, is not going to work.

What I would like to do is to have a static hyperlink, where clicking on the button image will just go to a particular URL that is our corresponding Facebook page, and do the action of becoming a fan.

Can anybody figured out an official or unofficial kind of URL that one could link to that takes you to the page on Facebook and performs the appropriate action?

like image 983
danwood Avatar asked Jun 02 '10 03:06

danwood


1 Answers

It would be a horribly insecure system if a link could force the action to happen. People would be 'liking' things all the shop that they didn't want to. Imagine how easy it would be for companies to send out a shortened URL on twitter and get hundreds of illicit 'likes'.

It's better to let people do that explicitly themselves so from an email the best you can do is to link people to the facebook page and hope they'll click like. If it's a good/useful page then chances are they will.

One approach is to have the email aimed at getting people to a landing page on your own site. You can then have a like button on that and using the Open Graph Protocol meta tags have that 'like' applied to the home page or whole site.

If you want your like button on the landing page to be a general one for the entire site then use the canonical og:url meta tag eg:

<meta name="og:url" content="http://yoursite.com/" /> 
like image 182
roborourke Avatar answered Oct 07 '22 23:10

roborourke