Facebook Pixel Stats GET / Reading - facebook

I have a Facebook Pixel on my website that is tracking events. I saw on the Ads Manager dashboard, that the pixel logs my events in a categorized way, i.e.:
PageView, ViewContent, InitiateCheckout, etc.
Although when logging stats, I include some extra parameters like the product_id maybe or other things, that way when the PageView is being logged, at least I will know which product_id it refers to.
The problem is that the Facebook Ads Dashboard doesn't show any of the extra parameters, it only displays the Count field.
After doing some research, I found this link on Facebook Pixel Stats, where they claim:
Use the Facebook Pixel Stats edge to get pixel statistics.
I tried using the Graph API Explorer, and even the iOS FB SDK for it (API Here) they both return an empty data array:
{
"data": [
]
}
I tried multiple parameter combinations, fields, and everything else to no avail.
If anyone knows whether I'm looking at the wrong place, or what not, all I'm interested in is reading those "extra" parameters that I'm appending to every FB Pixel event I log. Thank you!

You need specifing the parameters for it.
Example:
{fb_pixel_id}/stats?aggregation=url

The answer is displayed for a specific period of time in the past - I would say 24 hours.
You can use paging at the bottom of the json response for going back in time: use the link provided in the content of the field 'previous', and you can step back day by day.

Related

Can you extract Facebook data by date range using Facepager?

I've been using Facepager for research purposes for almost a year now and I can't figure out how to extract data - public posts, comments and likes from a page, for instance - by date range. While other programs such as Netvizz gives me this option, Facepager seems to fail to do so.
Thank you.
You can use the since and until parameters for this, e.g. set since (left side in parameter settings) to 2017-09-13 (right side) when fetching posts of a page. See the section Time Based Navigation in the Facebook Graph API.
Keep in mind that accessing very old data with the API is limited by Faceebok. Most social media platforms are aligned to the presence :)
BTW: we just opened a Group on Facebook for getting help.

How to search Facebook's "invitable_friends" results

I have a Facebook app, and I'd like to allow my users to invite their Facebook friends to my app. The proper endpoint is /me/invitable_friends which is working well. But towards the bottom of that doc page, they recommend implementing a "search box" to filter the results, yet they don't offer any example of how to do this. I've searched around and haven't found anything.
It doesn't appear as though you can pass additional params for filtering the results. Obviously I can filter the results after the fact, but that's not scalable since the API only returns ~20 users at a time. That limit is modifiable (I believe), though it's of course not wise to bump it too high.
So how can I build a search box interface if I can't pass the search text to the endpoint? I must be missing something.
Thanks in advance.
PS - I'm using the JS SDK.
You should probably file a bug.
Based on the documentation the default size is 1000 records (average Facebook friend list size is 300-400)
If you don't see the next parameter at the end of the result under paging then there are no more results.

Get old Facebook posts from public FB page

For a university research project I need to view some old posts on public Facebook pages from a specific date range (January 22-31 2014.) I was planning just to copy and paste each post but I have run into a problem with some of the pages that generate a very high volume of posts. Facebook will not display past a certain date. Even with scrolling down, at a certain point the posts stop displaying (this is true by month, so it jumps from January 25 directly to December 31 for example).
Here are the pages I am interested in:
https://www.facebook.com/Syrian.Revolution
https://www.facebook.com/Syrian.Truth
I have read about Facebook's Graph API but have had some trouble using it (I don't have a developer's background.) Also the posts are mostly in Arabic so that may be a problem.
I just need the pages' posts, not the comments sections.
Thanks anyone so much for your help, it is very appreciated.
Really depends on what language/environment you're using. As a simplest case, you can just use Graph API Explorer (https://developers.facebook.com/tools/explorer) and make a call:
{{page_id}}/posts
There are a lot of ways you can improve this call for your benefit. For example, you can use a limit parameter to increase the default number of results it retruns.
{{page_id}}/posts?limit=200
By default, this returns a lot of fields, you can limit the fields.
{{page_id}}/posts?limit=200&fields=id,message,created_time
You can visit https://developers.facebook.com/docs/graph-api/reference/page/feed/ to find out which fields are supported.
In order to get results during a certain time-range, you can use the created_time field to determine if a post belongs to a certain time interval.

Best way to get all the posts on a group's wall on Facebook

There is a group on Facebook called Pointless Haiku. I would like to download all of the posts that have ever been posted to the group's wall so I can entertain myself with random haiku for hours. So far I have used the graph explorer with this fql query (is that the right terminology?): 2204535003?fields=feed.limit(10000).fields(message), and it gives me some of the wall posts but not all of them (not even the first 10000, which is the limit I set). I don't have a Facebook app, because the only reason I want to do this is to amuse myself. Once I get all of the posts I'll probably just write them to a file and do some postprocessing with Python.
What is the best way to accomplish this? Do I need to create an app just to do this, if I want to do it programmatically?
About your observation that it gives me some of the wall posts but not all of them (not even the first 10000, which is the limit I set)
I think that the Graph Explorer is meant to be a development and debugging tool (sort of like Python's IDLE) rather that a full-power query engine. As such, I believe that it has its own built-in page-size limit that cannot be over-ridden. I believe that limit is 25. Note that this is not the limit of the number of results that are returned. It is the maximum number of results that will be displayed on one page. Depending on the size of your results set, it may take several, or many, pages to display the entire set.
So... if you are in Graph Explorer, and run a query, and get back your results, if you scroll down to the bottom of the results produced by Graph Explorer, you may see something like this:
"paging": {
"previous": "https://graph.facebook.com/...",
"next": "https://graph.facebook.com/... "
}
If you click on the URL following the "next" label, it will take you to the next page of results. And if you keep doing that, eventually you will click your way through all of the pages with all of your results.
I think that the way to get ALL of your results at a single shot is to submit the GET request (which Graph Explorer has helped you to create and debug) programmatically via (say) a Python script, or some other kind of script.
Just as an example, I used this query to get back a list of all of the messages and comments posted to a Facebook group since January 1, 2015. (I ran this query successfully on May 8, 2016, using Graph Explorer v2.6.)
128791213885003/?fields=name,id,description,owner,feed.since(2015-01-01){message,created_time,comments{from,message,created_time,comments{from,message,comments{from,message}}}}
I hope this helps.
You can use Graph Explorer for that.
/me/groups can bring group ids
/group-id/feed will bring groups feeds
Don't forget to Get Access Token with user_groups permission.

How to access links provided on one's timeline?

I would like to have access to the links one shared on their timeline.
Using the API Graph Explorer, I see there is a way to access "links". However, it returns empty data. I believe that this might have been used when posting links in FB was done in a special way, different than posting "usual" status.
Then, I thought, I should probably get all the stream and filter the data for links. But at that point, I'm a little confused:
There are THREE different actions that seem to provide the very same data:
- https://graph.facebook.com/me/feed
- .../me/posts
- .../me/statuses
Are they actually all the same?
In addition, all seem to provide me information that is not up to date, but is true for some point in the near past. Moreover, I would like to know how I can get the relevant data from the beginning of the FB usage, or at least, for a given period of time.
Do an HTTP Get to me/links to get the most recent links the user has shared.
To limit it to a timeframe, you can do me/links?since=YYY&until=ZZZ.
Or you can use the paging object to get the previous and next url to use to get that other page of data.