Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Insights access in php

I am having issues figuring out how to get data from the graph api insights, I dont have sufficient rights to get any data returned. In the Graph API explorer I generated a new access token with the right to read insights but I dont know how to take it into use in php. I am currently trying to get the data as follows:

FacebookSession::setDefaultApplication('app_id', 'app_secret');
$session = FacebookSession::newAppSession();
$engagement = (new FacebookRequest(
    $session, 'GET', '/page_id/insights/page_engaged_users'
))->execute()->getGraphObject();
like image 366
Rasmus Nørskov Avatar asked Nov 09 '22 10:11

Rasmus Nørskov


1 Answers

Hope this helps others too.... regarding Facebook access token and also in query How to handle access tokens with Facebook SDK v4.0 by Sammy Kaye Powers

like image 78
jones Avatar answered Nov 14 '22 22:11

jones