Facebook API - Top 5 users for engagement and likes on fb page - facebook-graph-api

I am trying to construct a Top 5 of engaged users and users that liked something on my Facebook page(a non-profit)(for instance posts, links or images). It has to be an aggregated total of engagement and likes for all items on the page per user.
Can anybody provide with some clues as to which Facebook API calls I could use for this. At this moment I am only capable of determining which users liked the page, or a particular post.
If the question is too general or anything else, I'll gladly modify it. I would have liked to attach image for clarification, but is not a possibility for me yet due to reputation score.

The only way to do this is to get all likes/comments/whatever from every single post with the API, store the numbers in your database and compare User IDs. You would have to keep it up to date too, so you would need to refresh your database entries from time to time.

Related

Facebook Insights API unique clicks

I'm trying to match columns of Ad statistics from Ads Manager with the one I get through insight API (Marketing API), namely, Unique Link Clicks. Which field from https://developers.facebook.com/docs/marketing-api/reference/adgroup/insights/v12.0#fields does it correpond to?
I may not have fully understood the question you asked, but you say that you will make a painting, I think the ones in the image can work.cost per unique clicks

How to develop a button for followers of a web site

I apologize for my English it is not very good.
I am developing a website that will have own followers.
I need to create a button by followers such as facebook, twitter or google plus buttons.
Thank you for any information that will allow me to begin to develop the button next to the platform.
Thank you
First, your English is fair enough. For creating your own follow button you will have to have an image that will be displayed on your website. When someone clicks on that button, your webapp should be able to know who clicked it and your should be able to remember that user in future as well. So first you will have users to register on your website (like facebook and twitter) for unique identification of each user.
Next, for remembering that a particular user is following your website you need to persist some information about that user. The obvious approach is having a database table to store the information. For instance you can have IS_FOLLOWING column in your USER table
But there are some considerations. First, the user must remain on the same page or be able to continue his activity even after cicking the follow button. For example, if the user is filling some form then his data should remain intact even after clicking the follow button. If the user is directed to some other page, he might lose information.
Second, database operations are costly. So you need to use them wisely.
One approach that I could think of is having AJAX do the work. If you want to learn AJAX you can visit this website and for AJAX database operations this one will be helpful.
Ajax will do all the work in background and both the problems mentioned above will be addressed. I hope this was helpful.

How to count all likes no matter how many times a post is shared and reshared?

I want to be able to count the total number of likes for a post or photo no matter how many times the post has been shared and reshared.
I want to know how popular a post is across the whole Facebook Universe.
Is this even possible?
This is not fully possible, for these reasons:
Facebook does not indicate via the API whether a post is a re-share
of another post (there is no "via" property on Post objects, in
other words). Nor is there a property that indicates where or how
many times a particular post has been re-shared.
Many posts on Facebook use privacy settings set by the user creating the post, and
this applies to re-shared stories as well. Your app has access to
whatever its users give it permission to read, but that does not
grant it access to the feeds of all users on Facebook.
At most, you could theoretically do this (although I am not sure if there are other limitations in place to prevent this):
Search all PUBLIC posts on Facebook, for text that matches the text in the post you want to track. (see the documentation under "Searching" here: http://developers.facebook.com/docs/reference/api/). Aggregate the Likes for all of these posts. Just understand that this is only the subset of posts that your app is capable of viewing.

disabling facebook comments with actions field on wall posts

My app allows users to interact with each other for a unique purpose. As part of this experience I post on user's wall so his/her friends can know about the post from user and they can come to app for interaction. But in this case, users may just end up commenting on the facebook page itself and my app will not have any knowledge of this interaction. To avoid this, I am wondering if I can disable comments on this post. Graph API documentations states that I can use the "actions" field on wall post for such purpose. I tried that with various combinations of Comment and empty link or link that takes the user to my app etc. But I notice that no matter what I set, facebook always shows link to the wall post instead of what I tried to put.
Any thoughts on how to achieve this purpose?
Thanks.

How can I allow my users, who create pages on my website, to communicate back to those people who click the Facebook "Like" button on their pages?

OK, apologies for the verbose title. Let me give the background in a bit more detail.
My website allows my registered users to create new pages, each of which has its own unique URL. Each page has a Facebook "Like" button on it. I've already implemented Facebook Open Graph API meta tags so that the pages are proper open graph objects, and when some other visiting Facebook user "likes" the registered user's page, a post appears on that Facebook user's wall saying they have liked the page. The Facebook Like widget also displays the number of "likes" that page has received as normal. So far, so good.
What I want to do is allow my registered users to be able to communicate back to the Facebook users who have liked their page. The community of "likers" for a page is a potentially valuable social media resource to the registered user, if only they could communicate back.
I am aware of the "admin page" link you get beside the Like button, which can be used to post to these people, but that is not an option for my registered users as they have no privileges in relation to the Like button.
What I want to do, if possible, is setup a form to capture the registered user's message back to the Facebook users, and then my website sends the message on their behalf, without having to ask for any extra privileges from the Facebook users.
The following Facebook documentation pages seem to say this is possible, but having followed the Open Graph API documentation, I can't get it to work as described - http://developers.facebook.com/blog/post/465/ and http://developers.facebook.com/docs/reference/api/ ("Publishing" subsection). I can get the access token correctly in the first request, and plug that into the second request to do the post, but that doesn't seem to do anything and doesn't return any error.
Since it doesn't work for me, I'm wondering if this is possible as described, or do I need to get some sort of extra permission to do this? I've seen reference to offline_access permission but as I'm new to this stuff I am not sure how it would fit in. If I have to get the Facebook users to grant permissions, this is not going to work as envisaged.
Any thoughts would be most helpful.
The short answer: No, You will never been able to post on someones wall as another user.
The long answer:
You could try to ask for offline access but then you are asking the user to hand over all their facebook data and give you access todo whatever you like their accound, so that is not likely to happend.
The next problem is that they have to be friends to be able to post on each others walls.
Thats why Pages was implemented, so that organisations could announce/talk with the people interested.
However if you have created the like button correctly and give the pages correct meta data, you are able to post to user who have liked it.
Scroll down to Publishing:
http://developers.facebook.com/docs/opengraph/
Just add a form for your user and let your system publish to the correct page, you probably will need a offline token from your own account or similar to use on the server.
Another more complex way could be to generate a facebook page for each page you have on your server.
When the user creates a page on your system a page is created on facebook but as your app as admin.
And when another user likes the page they like the facebook page, hence you have the possibility to post in that page and speak to the user who liked it. (whooa thats a mouthfull).