Correlating users who "like" a page with users of an app - facebook

I have a page that links to my app. and this page has an increasing number of "likes".
We want to know how many of the FB users who have "liked" our page have authorized our app.
Per Querying Users who 'like' my Facebook Page, it doesn't appear that I can get the list of "likers" of my page in order to correlate the FB ids against my user base for the app.
Two questions:
1) Is there an existing Insights metric that I should be using to get this information? This does seem like a special kind of "conversion" (from page - liker to app - user).
2) The only other option I see is scraping the output of
https://www.facebook.com/browse?type=page_fans&page_id=PAGE_ID
which some have suggested violates the FB TOS (why is that, btw?). Does anyone have any other suggestions?
3) Upon further reflection, it occurs to me that I can come at this problem from the app instead. I should be able to get likes for my app users and see if my page is among them. Can anyone verify if this will work?
Many thanks,
Wes

No, you'd need to manually calculate this by using the user's access token when they're using your app to see if they like the page - Facebook's API will not give you a list of users of your app or a list of likers of a page

Related

Facebook API - FQL url_like table behaving strangely for some users, not returning all URLs liked

I am writing a facebook API based app and I ran into a few complications with the URL_like table in FQL with certain facebook accounts
If I run the following query, I expect to get back a list of URLS including web pages on which I have clicked the "like" button:
https://graph.facebook.com/fql?q=SELECT+url+FROM+url_like+WHERE+user_id=me()&access_token=TOKEN
However, on my own personal facebook account (the same one I registered the app with), when I run the query, the URLs that show up are only URLs i liked "inside" facebook - URLs that were posted on my wall, or other peoples walls, but not urls that I visited and clicked the "like" button on.
At first I thought this was an issue with account or privacy settings. I adjusted the settings on my facebook account to match the exact settings that my friend had on his facebook account which showed the correct results of the FQL query, but it still gave me the result above.
I deleted the app from the list of approved apps, approved it again, thinking this would change the result with a different access token, but it has not.
Also - this functionality worked correctly on my facebook account before, which makes the predicament even stranger
So here is the question - does anyone know why only certain URLs show up in the URL_like table? was there a change in the facebook API to justify this? Can this error be repeated? Or is my profile just some sort of super glitch?
Thanks in advance, I am at my wits end with this

List Facebook Page events on website for a Venue using FQL or Graph API

I am helping out a friend with a site for a venue that lists all events on FB with a location, ticket URI, time, etc.
I have found lots of info on how to get the data, but what I am unclear on is how to get public events without being logged in to FB.
What type of tokens do I need to have a website simply pull events data and display it to visitors?
Basically, what I am attempting to do is show a set number of upcoming events and assume that the visitors to the site are not logged in to FB.
On this page, https://developers.facebook.com/docs/reference/fql/event, it says this:
Permissions
To read the event table you need:
a generic access_token for public events (those whose privacy is set to OPEN)
a user access_token with user_events permission for a user who can see the event for non-public events
an app access_token with user_events permission (for non-public events, must be the app that created the event)
a page access_token with user_events permission (for non-public events, must be the page that created the event)
I am not looking to get help with the code really, I am just having trouble figuring out how the access/auth process works.
It appears FQL may be the best option so I can do queries based on date ranges, but alas, I am stuck on the access/auth/token part.
What do I need to have in place to be able to list a Page's events on a 3rd party site?
If anyone has any advice there, I would appreciate it. Thanks.
Just to explain to others, you cannot get ALL the events in the city by graph search. You need to refine it either by user details or some other metric.
I figured it out.
This question helped, but was not correct and there is a syntax error in an answer:
Get Facebook events from public fan page
From what I found, you need to become an FB developer, create an app, get an ID and secret.
Use the SDK (PHP in my case), and this question had a good example of returning the list I want:
Link from ticket_uri is opening a blank page
I am having the same issue though of getting blank pages on the ticket link if the user is not logged into FB.
But my original issue is solved.

Using single access token to get the 'likes' of other users

Using the normal Facebook website, one can get to a page showing which pages a user has 'liked'.
From the graph API, it is possible to get this for pretty much all pages, using graph.facebook.com/userid/likes?access_token=MYACCESSTOKEN.
However, I need to be able to do the same - i.e. get the list of pages a user has 'liked' for normal Facebook users (and not 'pages' who have 'liked' other pages).
Is this possible with the single access token? Judging by the fact you can get this info from the normal Facebook web page, I would expect it to be possible.
Privacy works slightly differently for applications accessing the API and for users accessing the actual site.
An application doesn't have access (by default) to your friends' likes to prevent data mining. In order to get a users friend's likes, you'll need to request the friends_likes permission.
You can read about this permission and others in the documentation.

How can i show the wall (feed) of my page to app on facebook?

How can i show the wall (feed) of my page to app on facebook? As i see in the page
www.facebook.com/kesha?sk=app_178091127385 and
www.facebook.com/pages/Khanduna-Yengu-Nangsu-Amuktang/187317137978077
I want show the wall(feed) of my page to my app of facebook. Please Help me.
I also try and see graph api as below
graph.facebook.com//feed
But Fail,
Please Help any one.
As I understand your question, you want to take the wall of your page and show the content of that on another page controlled by an app you have made, so that is the question I will answer.
There are a couple of things you need to do.
Facebook now requires you to have an access_token to get that information. You can get this in two different ways. Either you get your users permission to grab an access_token for them, or you create an access_token for one of the admin users with offline_access and manage_pages permissions.
There are problems with both cases:
1: Getting an access_token per user requires people to give permissions to your app which is quite annoying if they just gain access to the contents of the feed.
2: Having one access_token is also a problem seeing as Facebook puts a limit on how many requests you can make per access_token in a given time.
You need to balance these things out if you want the feed to be shown. Which case would you most likely use? If you don't have many users the second case might be the best, but if you go over the request limit no content will be shown and that could confuse your users.
Anyways.. Once you are past the access_token problem, you can access the information by getting the content from the page:
https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_ACCESS_TOKEN.
You then get a nice json output you can use. If you are using the Javascript API you can simply use the information here:
http://developers.facebook.com/docs/reference/javascript/FB.api/
If you are ever unsure how to get the information you need there is a nice tool for that developed by Facebook called Graph API Explorer which you can find here:
http://developers.facebook.com/tools/explorer/

Check whether user of non-facebook app likes/shares particular URL on FB

I'd like to know if there is a possibility to check (using Graph API or any other way) whether given user likes / shares a specific link. Probably I'll have this user's facebook ID or facebook login, but my site is non-Facebook application. Actually it's Dot Net Nuke portal (target: .NET with MS SQL Server) with part of it being avaliable as Facebook app, but certainly not greater part of it, so the solution should be out of Facebook Connect, although it's not a showstopper if it's necessary.
We'll be giving points to users who share/like most of links that we serve in our portal and such possibility would be a great help to make a ranking.
Another option we consider is making some kind of "wrapper" or proxy for FB like / share buttons which will at first save some data in our database (probably - this user clicked on like for this link) and then go on with standard FB like / share route. Did anybody of You tried such solution?
If You have any other suggestion on the subject, please, post them, we'll be really thankful.
It is possible to know if a user has LIKED a site or not. You can get all user's likes with Graph API (you need user_likes permission). Take a look at the docs: http://developers.facebook.com/docs/reference/api/user/
I'm not sure if you can know if he has shared your site, but you could try by parsing his wall with the read_stream permission and then look for your site name/URL post by post.
For just general liking of items on your site, you can use a Facebook Social Plugin. However, you won't be able to associate (or really even access) user activity with users on your site without integrating Facebook Connect and creating a Facebook application for your site. At that point you can design with greater control all the possible user activity and interleave with your facebook calls other calls that affect users' accounts on your site.