Get facebook post insights of page on daily basis - facebook

I am hitting the following facebook api in graph api explorer to get the daily insights of page post. It always return the empty response.
2168960843146707_2213719068670884/insights?metric=page_actions_post_reactions_like_total, page_actions_post_reactions_haha_total,page_actions_post_reactions_wow_total&period=day&since=1550146218&until=1550148280

There is either no data for those fields, or your page didn't meet certain criteria. You're also querying for a 30 minute time range for yesterday, so those metrics may not be ready yet, but I think they probably should be if your page is published.
"Insights are only generated for a Facebook Page that has more than 100 people that like it. Likewise, demographic metrics, such as age, gender and location, are available in Page Insights once there is data for 100 or more people."

Related

Facebook Graph API and Insight stats don't match/incorrect

We are developing an application using the Facebook Graph API to track metrics for our page over time, for example, number of shares of posts on the page.
We are retrieving number of shares, comments and likes from the post objects in our page feed and then summing them for our reporting period - the query is of the following form
{page-id}/posts?fields=shares,created_time,likes.limit(1).summary(true),comments.limit(1).summary(true)&since={start-date}&until={end-date}
However, the numbers we are getting from this query do not match with those from the Business Manager Insights page. For example, for the month of October 2016 the Graph API count for post comments is more than twice that reported from the insights data. Furthermore, the numbers do not always match with those we get from manually counting comments etc. directly from the posts on our page.
Does anyone have an explanation for how these discrepancies might arise?
Check this article. "Error: When gauging the total number of people who saw at least one of a Page’s posts organically over a seven-day or 28-day period, Facebook didn’t de-duplicate that audience when reporting a Page’s organic reach in its Page Insights dashboard. In other words, if someone saw a Page’s post on Monday, and then another post from that Page on Tuesday, Facebook counted that person as two people."
http://marketingland.com/heres-itemized-list-facebooks-measurement-errors-date-200663

Facebook API Insight Metrics Daily graph API

Hi Guys I am hoping someone could help me.
I have been toying around with the Facebook API for our company's facebook analytics page. I am looking to get information on the likes, shares, impressions etc and store directly to a database
I have been able to pull this information back using the Graph API Explorer. Now I want to be able to pull the information back for say today. When I add today's date in it only relates to the actual posts that were posted today, not today's activity. if that makes sense.
An example of this is if I had liked a post today that was created 2 days ago, it doesnt show in in today's activity, but the activity from 2 days ago.
The code I have been using is:
feed?fields=comments.limit(1).summary(true),likes.limit(1).summary(true)&since=2016-10-28
Just wondering if I am missing something as surely should be an easy way of getting todays actual activity from users?
Your example isn't fetching Insights, you're fetching the posts visible on the page's Timeline, then asking for a count of the comments and likes
There's a totally different API for fetching Insights data: https://developers.facebook.com/docs/platforminsights/page
This is the same API used by the Insights UI, so for the same set of metrics/dates, it should give identical results to the UI

Facebook PHP SDK limitations

I am developing a page on my site that pulls in analytics data from Facebook posts and pages, and have began with trying out the PHP SDK for Facebook.
The documentation seems to have improved in the last few months since the last time I used it, but as there is so much going on, I find it difficult to find the exact answer to my questions sometimes.
I want to get the analytics data for a number of posts and pages which are not necessarily related to each other... and also want to do this without logging in via Facebook. Is there some sort of simple API key I can use, which skips the logging in stage? I want a number of different peple to go to the site and see info from a number of different posts and pages.
Hope this makes sense.
You'll be able to get limited data from public pages and posts without logging in. Data includes number of likes, public page information, comment and likes on posts etc.
For example, if I look at the following Page https://graph.facebook.com/thetimberyard, I can see various stats like:
checkins
talking_about_count
were_here_count
likes
However, you can get better insights if you ask the user to login with read_insights permission. This permission will give you access to full insights for pages you own. Extra insights include (but not limited to):
Daily New Likes
Daily Unlikes
Daily Non/Logged-in Page Views
Weekly Non/Logged-in Page Views
Daily Internal Referrers
Daily External Referrers
Daily/Weekly/Monthly People Talking About This
Daily/Weekly/Monthly Reach Demographics, etc.

how to get past newsfeed using facebook API?

the API to fetch newsfeed is: https://graph.facebook.com/me/home?access_token=&limit=1000&untill=
which returns paginated feed output with 'next' url to fetch previous feeds.
However it stops returning newsfeed beyond a certain time. So newsfeed of few days is only available for parsing.
Is there a way out to get more historical newsfeed using facebook apis???
If you look at the graph API documentation page, /me/home is limited to only 1-2 weeks of history, and it has fallen into the "we don't care about this" category:
/me/home retrieves an outdated view of the News Feed. This is currently a known issue and we don't have any near term plans to bring them back up into parity.
Use /me/feed instead.
You can use the since and until parameters to get historical data from a user's feed. This will get you the posts that appeared between August 15-20, 2012.
/me/feed?since=2012-08-15&until=2012-08-20
The data returned by /me/feed/ is also limited. The limits aren't explicitly stated, but I never expect to be able to access more than 30 days worth of posts from one API call.

Getting all facebook page wall posts and comments?

I am developing a social media monitoring application. Currently, we are entering Facebook page ids into the application to collect data from possible customers' Facebook walls (so we have a realistic sample for the customer for direct promotion).
These page ids are used to collect wall postings and comments and to compute statistics (e.g. to show most used words), and are presented to the user in a special view. Requirements are to collect all postings and comments without exception in near-live time. We currently have about 130 page ids in the system, with more to come.
Right now, I am using the Graph API for this, with several disadvantages:
FB API access is restricted to 600 request/10 minutes. To get a near-live view, I need to access the API at least each two hours. As we are using API requests in other parts of the program, too, it is obvious that the limit is hit sooner or later (actually, this already happens)
The responses are mostly redundant: to receive current comments, I have to request the wall postings (comments are enclosed in postings) with the URL http://graph.facebook.com/NAME/feed...
The probability for hitting the limits is dependent on the number of postings on the several walls
I cannot get all comments with this method (e.g. comments on postings some time ago)
I am currently trying out how to switch to (or to complement Graph API usage) using FQL by querying the stream and the comment tables but this also has limitations:
I cannot restrict my query to a specific timespan, leading to redundancy again
The max number of posts I am getting for each one of my 130 page ids is 61 - (why 61?)
I need an unpredictable number of additional requests because I need to get special objects like videos and links in separate requests.
My question now is - if anyone is doing similar things: How did you solve these problems? How do you get a pseudo-live-stream of a larger number (up to, say 1,000) of walls?
Letting the customer grant extra permissions to us is currently not an option.
you will probably have to meet with FaceBook and work out a contractual deal for greater access to their data. I would bet that the answer will be no, no and no, seeing as it appears you are trying to monetize their data, and furthermore, do so without the explicit permission of the users, but hey give it a shot.
I have a similar task - By default FB return only last ~50 posts or all in last 30 days(whichever is smaller) in FQL you should use created_time filter to receive more results. my current problem is that via FQL I receive no more than ~500 posts from any FB page wall even when LIMIT increased:
'select post_id from stream where source_id = 40796308305 and created_time <'.time().' LIMIT 1000000 ;'
this FQL request to CocaCola FB Page returns now ~300 posts only (less than 2 day posts).
If you find a better solution pls advise :)