I know that this has been covered in various ways before - but is there a way to display one set of content on a page for liked users and another set for people that don't like it.
This approach (http://www.uksitebuilder.net/2011/05/create-facebook-secret-fan-page/) only seems to work the first time you hit the app, so it's not good for returning visits.
I've google forever but it's very hard to find a up to date / current solution.
Any help would be greatly appreciated.
It's all in the docs. Simply parse the signed request in your Tab and read out the page.liked property. It's true if the user liked the page and false if not.
Edit_: After seeing your comment, just save the "liked" state in a session variable. You should then use the JavaScript methods provided by Facebook to check if the user liked the page while browsing around in your App. You could then reload the page for example. You can read about FB.Event.subscribe in the Facebook JavaScript SDK docs.
Related
Hope you can help with the below, which I've spent most of this weekend trying to resolve but to no avail.
I use a social share and vote plugin on my website, which works perfectly for G+ Twitter Pinterest etc etc. However my facebook like button simply does not want to work.
Example, yesterday I posted this on my websites facebook page.
https://www.facebook.com/116091541779464/photos/a.496114153777199.1073741829.116091541779464/696621417059804/?type=1
As you can see, this links to this page of my website which has its like, share, +1 counts etc at the bottom: http://www.superluigibros.com/evolution-of-mario
As you can see from the Facebook post it has 85 likes. Yet the website shows only 1 like?
The social plugin that I use asks for an App ID. I have created, and activated an App in Facebook and put the App ID in the relevant field of the plugin.
However I am not sure that the App is actually set up properly on the Facebook side, or maybe it lacks the permission to actually count the likes?
The only other point of note is that I am using another Facebook widget (the one that shows who likes our page) in a seperate module. Could this be conflicting in some way?
If anyone could help would be greatly appreciated. I really dont understand whats up with it
Best regards
Luke
This is the case because those are two completely different things:
On http://www.superluigibros.com/evolution-of-mario the number of likes is the number of times the URL was liked
With https://www.facebook.com/116091541779464/photos/a.496114153777199.1073741829.116091541779464/696621417059804/?type=1 you just posted an image also present on your page to your Facebook pages. The like count show the likes only for this image
So, what you need to do is to add the OpenGraph tags properly to your website, as described at https://developers.facebook.com/docs/opengraph/using-objects#selfhosted-creating Then, you shouldn't share just an image on your Facebook page's feed, but the URL instead. FB will then pull the content for the image etc. from your website upon sharing.
The like counter in your facebook post is handled separately from the likes of your website page. Each "like" that your post receive doesn't count towards the site's like counter.
EDIT: I've just tested your site's like counter, and it's counting correctly as I have just liked it myself.
I am in the process of making a band website. I have a download of a song but I want it only to be available to the user if they have liked the bands Facebook page. I am aware there are similar questions to this already on here. I have tried some of them and they don't work, also none of them are very clear. Thank you for your help.
There are more than enough results which answer your question, for example Create Like-Gate for page
The most simple way to create this is using a Page Tab app (https://developers.facebook.com/docs/appsonfacebook/pagetabs/) and parsing the signed_request (https://developers.facebook.com/docs/reference/login/signed-request/) Facebook is sending when the page Tab is accessed.
The page object within the signed_request contains a field called liked which indicates whether the actual user liked the Page or not.
I want a Like button on my web site that Likes my Facebook profile (rather than my web page), so that when a user clicks it they subscribe to my Facebook posts.
I've created the Like button using the tool at https://developers.facebook.com/docs/reference/plugins/like/
Further down that page there is an FAQ entry:
Can I link the Like button to my Facebook page?
Yes. Simply specify the URL of your Facebook page in the href
parameter of the button.
So, I've edited the href parameter to point to my Facebook page. eg:
https://www.facebook.com/myfacebookid
When a user clicks the Like button it has the desired effect. The user ends up having Liked my Facebook page. This is easily verified by the user going to my Facebook profile and checking that the Like button has changed to Liked.
But. When the user clicks the Like button, and entry appears in their News Feed with a generic Facebook description. ie:
Facebook is a social utility that connects people with friends and
others who work, study and live around them. People use Facebook to
keep up with friends, upload an unlimited number of photos, post links
and videos, and learn more about the people they meet.
I don't want a generic post about Facebook to appear. I want the description to relate to my Facebook account and/or web site.
Normally, I could modify this behavior with the Opengraph og: description tag, but as the page in the href is a Facebook page and not my own, I can't control the Opengraph tags.
I'm pretty sure that this was working okay before I enabled timeline for my account, so maybe this is a timeline bug?
So, how do I add a Like button which a) Likes my Facebook profile rather than one of my own web pages, and b) Posts a description of my Facebook profile rather than give a generic Facbook description?
Are all your fields in the info part of your page filled in, and/or completed? I just tested your theory and it seemed to work as expected, only thing is I know all fields in "info" are filled it. Give that a try.
This may happen if you have filled invalid/incomplete/wrong og tags in past and later changed them. Facebook's cache creates problem sometime.
Try putting all the entries (i.e. all og tags) and then debug them here http://developers.facebook.com/tools/debug. This debugger gives a detailed info about the url with og tags and also clears the cache for you.
This should solve the problem.
You have 3 important fields that used on page opengraph: Name,Description,Profile Image.
They are used when some one post your link on Facebook, or Google or some else web service that handle opengraph.
Actually, the suggested answers currently do not work and there is an open bug / ticket on Facebook for it. Up to now, there's no fix.
The problem is that you can not use simply https://www.facebook.com/myfacebookid. You should copy and paste the exact page URL. If you have a low number of likes it would look something like https://www.facebook.com/pages/[YourPageName]/[Your page Id]/, and this is the URL that you should use at this point.
If it does not work, try also https://www.facebook.com/[YourPageName]/[Your page Id]/.
In short, copy-paste the URL, do not type it manually.
My question is regarding the likebox from this page: http://developers.facebook.com/docs/reference/plugins/like-box/
I want to know specifically what pages are generating likes for my Facebook page. For example, are they coming from the home page, individual product pages, or blog? I want to remove the likebox from pages that aren't generating any 'likes'
I was looking at this page: http://developers.facebook.com/docs/reference/plugins/like-box/
Is the edge.create event what I'm looking for here?
By the way, I know about the insights feature on Facebook where I can get stats on 'Like Sources'. I just want to know more specifically what URL's are being used for the Like Box.
Thanks in advance!
The edge.create method will allow you to capture when someone clicks on the Like button so you can do your own recording. If you don't want to write your own tracking code, you can use Google analytics, which is far easier since they do almost everything for you.
http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html
I've been seeing this for quite a while now, and am wondering how people achieve it: They create facebook pages, and then require users to like and share the pages in order to see links.
First, the user must be authenticated with your app. You can't force anonymous users to like your page, etc. After they are authenticated the easiest way to do this is just to use the graph api and call https://graph.facebook.com/me/likes (you will need the extended permission user_likes). After that you can just ensure that your page is listed as one of the user's likes and take action accordingly.
I found an answer to my question after spending quite some time googling. Turns out, as usual, that it was simply the matter of picking the correct keywords.
Create the fan page you wish to use
Allow Static FBML application to your page
Set Static FBML tab to show your title, and publish the content there. With static FBML you can 'choose' who you want to show certain content, accomplishing the desired goal.
Here's a code sample:
<fb:fbml version=”1.1″>
<fb:visible-to-connection>
<a href=’http://www.webmastershelpguide.com/’>Webmaster help</a>
<fb:else>Non-fans will see this content.</fb:else>
</fb:visible-to-connection>
</fb:fbml>