Accessing Open Graph FB page Insights without the

2019-08-05 17:33发布

I have built a platform for my local young professionals organization with a PHP backend using Laravel. One of the newest initiatives I am wanting to take on is the integration of our marketing insights and for the board to take a quick look at our marketing efforts without needing to be directly in the software, such as our Piwik setup and FB page insights.

I have pulled the Open Graph/FB SDK and have configured some basic APIs to use in the software. I am wanting to make it so board members without admin access on the FB page can still see the insights. Is it possible to use an app access token to grab the insights? Do all of the board members viewing the PHP page need to be logged into FB with admin access to the page?

1条回答
够拽才男人
2楼-- · 2019-08-05 18:13

This is possible if you use a long-lived (eternal) Page Access Token.First, you'd have to get a User Access Token, for example via the Graph Explorer (https://developers.facebook.com/tools/explorer), with manage_pages and read_insights permissions.

Then, you need to exchange the returned short-lived User Access Token with a long-lived one. Next, request /me/accounts with the long-lived User Access Token and fetch the eternal Page Access Token from the result. Store it your application for further use.

You can check the Access Token with

https://developers.facebook.com/tools/debug/

Have a look at

查看更多
登录 后发表回答