Analytics, Digital and Sports

Using Facebook Graphic API Explorer to retrieve insights over 180 days

Recently, Facebook – the largest social media site has given me some headache. My assignment is quite simple – the business needs its facebook page’s key metrics(impressions, engagements) on a year over year basis, to see understand how our company’s facebook performance is doing.
Surprisingly, I can’t do it by login the standard facebook business manager function.Facebook won’t allow its business user to download metrics over 180 days from its “insights” portal.

image

I understand it from technical perspective (performance lagging, exported file might be too big, etc), however not providing an option doesn’t make sense to me at all.  For example, Twitter can retrieve over 3 years of data with ease.  In the business world the reports are usually followed by the financial cycles – which means we needs year-over-year comparison. 180 days is simply not enough.
After my initial own research from Google/Youtube and Facebook Help document, there is no existing solution in place. So I decided to build my own  The solution I came up is not perfect yet, however it can get things done, and it also opens future opportunities ahead to optimize.
In short, using Facebook Graphic API Explorer,I am able to retrive up to 2 years of insights metrics.  Here is how I did it
  1. Read the standard facebook insights guide   This will tell you what metrics are available from facebook.  It is actually very similar to what you can download from FB business manager – insights pages. All the available metrics are breakdown by “page level”, and “post level”. In my case, what I need is the Total Impression and Total Engagement – both are in the “page level”. I was able to find it both from the guide and get their technical name – in green.
  2. Open the facebook API Explorer, and learn the basic usage from Youtube It is a 15min put up by facebook and it is well made
  3. Follow the Youtube video, and get the token for the page you are requesting, by logging in using your FB business manager account.
  4. Type in the metrics in the following format, adding the time frame, then I can get the impression metric anytime within L2years 
  5. The limitation here is – if you have the time frame between “Since” and “Then” for over 3 month, it will report the following error message
Next steps

Despite being hands-on, this is not a very sustainable solution but more of a work-round, being said it can only retrieve 1 metric for a given time. In my case I need to run this about 24 times, to get the total impressions for the page I need in total 2015 and 2016. It took me about 60min to pull and validate, reasonable for my task but can be improved

I have heard about Python, and I believe using Python to write scripts should be the ultimate solution, instead of calling this service on a ad-hoc basis

My next goal is to use Python(or whatever language) to automate this to an Excel or CSV.

Exit mobile version