So I found that the problem is actually a documented bug. https://developers.facebook.com/bugs/665575443480429/
Facebook Graph API Insights returns empty array
-
15-07-2023 - |
質問
I cannot figure out how to get particular Facebook Insight metrics, and don't know if I am missing something, or doing something wrong, or there is a bug ... ?
I'm using JS SDK v2.0. After logging in, I have 4 granted permissions (FB.api("/me/permissions" ...
): public_profile, email, read_insights, manage_pages.
Then, for the sake of an example, let's say I want to get page impressions of Lufthansa page. I tried:
FB.api("/lufthansa/insights/page_impressions",...)
FB.api("/{lufthansa-page-id}/insights/page_impressions",...)
FB.api("/lufthansa/insights/page_impressions?period=day",...)
FB.api("/lufthansa/insights/page_impressions?period=day&since=1396310400&until=1399075200",...)
None of these work. Or to be precise, all of those return empty array ({data:Array[0],paging:Object}
). Can anybody help me out with tip what am I doing wrong? I also couldn't find any example online; there are many simple FB API examples, but none with working FB Insights API ...
Thank you, Ales
解決