Edit: I've managed to get this far in the documentation: https://developers.facebook.com/docs/graph-api/reference/v2.5/promotion-info
However there's nothing linking to the {promotion-info-id} parameter in the docs that I could find.
I'll accept an answer with code/API references that's not specific to PHP as well.
I'm trying to fetch my users pages and posts insights which are working as expected, however I also need to receive stats such as per 1000 reached (cpm), total spent and new fan costs.
I am able to receive all user pages and posts however the insights API doesn't return any associated costs. I've looked at the Marketing API, but can't figure out how to link the pages and posts to those stats. How do I get the ad_account/ad_campaign values from posts and pages? Do I need them at all? Feeling quite lost in its API.
I also need to fetch the stats on a daily basis in order to calculate daily and monthly changes.
I can pull most daily stats using the insights API but there are no costs attached and https://developers.facebook.com/docs/graph-api/reference/v2.5/page nor https://developers.facebook.com/docs/graph-api/reference/v2.5/post offers no such thing.
$response = $this->facebook->get('/' . $pageId . '/insights?since=' . date('Y-m') . '-01', $token); $data = $response->getGraphEdge()->asArray();
Also, is there a facebook sandbox I could use to pull dummy costs or other stats since I don't have a page that would have paid content.
In fact, the analytics cover over 250 metrics, and reports can be easily generated and customized. Cost: Facebook analytics tool is free. Full suite prices start at $100/month, with a 14-day free trial.
Tap Pages, then go to your Page. Tap More at the top of your Page, then tap Insights. To see more insights or to export insights, log into Facebook from a computer. Insights provide information about your Page's performance, like demographic data about your audience and how people are responding to your posts.
Post reach is the number of people who saw any of your posts at least once. This metric is estimated. Paid reach is the number of people who had a paid post from your Page enter their screen. Organic reach is the number of people who had an unpaid post from your Page enter their screen.
Accessing Facebook Insights is simple: just go to the Facebook Page Manager and click Insights. The default data range displayed on Facebook Insights is 28 days, but you can toggle this to fit your needs.
You can get the Ads Insights using the Facebook Marketing API Insights Edge. There is really many data you can crawl, but unfortunately there is no way to connect them to the posts due to the Facebook ads nature.
If you want to you can try to create ads using Marketing API Ads Managment Edge with data grabbed from your posts and than track these ads.
But there is really no other way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With