To retrieve data from Facebook Insights, you must make a request that contains several parameters with unique values to a specific table.

Each request includes the name of the table you want to request data from, for example, InsightsByConsumptionType, and three unique parameters described below

Insight Name: The metric to be returned.

Target: The element to retrieve the insights from. When requesting data from a source, all the data is returned for the authorized user who made the request. For example, target in (select ID from pages) returns all the pages for the relevant ID for the defined period of time.

Note: When requesting data for all posts for all of your pages, you might experience performance issues. Sisense recommends breaking up requests in which large amounts of data are returned by Facebook.

Period: The aggregation period. The value ‘lifetime’ includes all your data up to the time of the request. Any other values such as ‘day’, ‘month’ etc. are limited to a range of 90 days as per Facebook’s time range limitation.

This page provides example requests and lists the possible values for each table.

InsightsByConsumptionType

Example:

SELECT EndTime as Date,Target as PageID, Period, InsightName, VideoPlay, OtherClicks, PhotoView, LinkClicks, ButtonClicks
FROM InsightsByConsumptionType
where target in (select ID from pages) and InsightName = 'PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPE' and Period = 'day' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPEPageday, week, days_28
PAGE_CONSUMPTIONS_BY_CONSUMPTION_TYPE_UNIQUEPageday, week, days_28
POST_CONSUMPTIONS_BY_TYPEPostday, week, days_28
POST_CONSUMPTIONS_BY_TYPE_UNIQUEPostday, week, days_28

InsightsByFeedbackType

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, [Like], Comment, Link, Answer, Claim, Rsvp, HideAllClicks, HideClicks, UnlikePageClicks, ReportSpamClicks, XButtonClicks
FROM InsightsByFeedbackType
where target in (select ID from pages) and InsightName = 'PAGE_NEGATIVE_FEEDBACK_BY_TYPE' and Period = 'day' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_NEGATIVE_FEEDBACK_BY_TYPEPageday, week, days_28
PAGE_NEGATIVE_FEEDBACK_BY_TYPE_UNIQUEPageday, week, days_28
PAGE_POSITIVE_FEEDBACK_BY_TYPEPageday, week, days_28
PAGE_POSITIVE_FEEDBACK_BY_TYPE_UNIQUEPageday, week, days_28
POST_NEGATIVE_FEEDBACK_BY_TYPEPostlifetime
POST_NEGATIVE_FEEDBACK_BY_TYPE_UNIQUEPostlifetime

InsightsByLikeSourceType

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, PageSuggestion, PageTimeline, Ads, MobileAds, Registration, Mobile, WizardSuggestion, ProfileConnect, ExternalConnect,
RecommendedPages, Favorites, Api, PageBrowser, MobilePageBrowser, Hovercard, Search, PageProfile, Ticker, LikeStory, FeedChaining, AllCategoryPyml,
PageSuggestionsOnLiking, MobilePageSuggestionsOnLiking, FanContextStory, SponsoredStory, PageInviteEscapeHatchFinch, PageAdminNumPosts, PageAdminNumPostsByType
FROM InsightsByLikeSourceType
where target in (select ID from pages) and InsightName = 'PAGE_FANS_BY_LIKE_SOURCE' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_FANS_BY_LIKE_SOURCEPageday
PAGE_FANS_BY_LIKE_SOURCE_UNIQUEPageday
PAGE_FANS_BY_UNLIKE_SOURCE_UNIQUEPageday

InsightsByPaidStatus

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, Total, Paid, Unpaid
FROM InsightsByPaidStatus
where target in (select ID from pages) and InsightName = 'PAGE_IMPRESSIONS_BY_PAID_NON_PAID' and Period = 'day' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_IMPRESSIONS_BY_PAID_NON_PAIDPageday, week, days_28
PAGE_IMPRESSIONS_BY_PAID_NON_PAID_UNIQUEPageday, week, days_28
POST_IMPRESSIONS_BY_PAID_NON_PAIDPostlifetime
POST_IMPRESSIONS_BY_PAID_NON_PAID_UNIQUEPostlifetime
PAGE_POSTS_IMPRESSIONS_BY_PAID_NON_PAIDPostday, week, days_28
PAGE_POSTS_IMPRESSIONS_BY_PAID_NON_PAID_UNIQUEPostday, week, days_28

InsightsByReactionTotals

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, [Like], Love, Wow, Haha, Sorry, Anger, Target
FROM InsightsByReactionTotals
where target in (select ID from pages)
and InsightName = 'PAGE_ACTIONS_POST_REACTIONS_TOTAL' and Period = 'day' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_ACTIONS_POST_REACTIONS_TOTALPageday

InsightsByStoryType

Example:
SELECT EndTime as Date,Target as PostID, Period, InsightName, UserPost, PagePost, Checkin, Fan, Question, Coupon, Event, Mention, Other
FROM InsightsByStoryType
where target in (select ID from Posts where target in (select ID from pages))
and InsightName = 'POST_IMPRESSIONS_BY_STORY_TYPE' and Period = 'day' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_STORIES_BY_STORY_TYPEPageday, week, days_28
PAGE_STORYTELLERS_BY_STORY_TYPEPageday, week, days_28
PAGE_IMPRESSIONS_BY_STORY_TYPEPageday, week, days_28
PAGE_IMPRESSIONS_BY_STORY_TYPE_UNIQUEPageday, week, days_28
POST_IMPRESSIONS_BY_STORY_TYPEPostday, week, days_28
POST_IMPRESSIONS_BY_STORY_TYPE_UNIQUEPostday, week, days_28

InsightsByTabType

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, AllActivity, App, Info, Insights, Likes, Locations, Photos, PhotosAlbums, PhotosStream, Profile, ProfileInfo, ProfileLikes, ProfilePhotos, Timeline, Events, Videos, Wall
FROM InsightsByTabType
where target in (select ID from pages)
and InsightName = 'PAGE_TAB_VIEWS_LOGIN_TOP_UNIQUE' and Period = 'day' and FromDateTime='Date' and ToDateTime='Date'

Mapping 

Insight NameTarget Period
PAGE_TAB_VIEWS_LOGIN_TOP_UNIQUEPageday, week
PAGE_TAB_VIEWS_LOGIN_TOPPageday, week
PAGE_TAB_VIEWS_LOGOUT_TOPPageday

SimpleInsights

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, Value FROM SimpleInsights where target in (select ID from pages) and InsightName = 'PAGE_ACTIONS_POST_REACTIONS_ANGER_TOTAL' and Period = 'day' and FromDateTime='@Date' and ToDateTime='@Date'

Mapping 

Insight NameTarget Period
PAGE_STORIESPageday, week, days_28
POST_STORIESPagelifetime
POST_STORYTELLERSPagelifetime
PAGE_IMPRESSIONSPageday, week, days_28
PAGE_IMPRESSIONS_UNIQUEPageday, week, days_28
PAGE_IMPRESSIONS_PAIDPageday, week, days_28
PAGE_IMPRESSIONS_PAID_UNIQUEPageday, week, days_28
PAGE_IMPRESSIONS_ORGANICPageday, week, days_28
PAGE_IMPRESSIONS_ORGANIC_UNIQUEPageday, week, days_28
PAGE_IMPRESSIONS_VIRALPageday, week, days_28
PAGE_IMPRESSIONS_VIRAL_UNIQUEPageday, week, days_28
PAGE_IMPRESSIONS_FREQUENCY_DISTRIBUTIONPageday, week, days_28
PAGE_IMPRESSIONS_VIRAL_FREQUENCY_DISTRIBUTIONPageday, week, days_28
PAGE_ENGAGED_USERSPageday, week, days_28
PAGE_CONSUMPTIONSPageday, week, days_28
PAGE_CONSUMPTIONS_UNIQUEPageday, week, days_28
PAGE_PLACES_CHECKIN_TOTALPageday, week, days_28
PAGE_PLACES_CHECKIN_TOTAL_UNIQUEPageday, week, days_28
PAGE_PLACES_CHECKIN_MOBILEPageday, week, days_28
PAGE_PLACES_CHECKIN_MOBILE_UNIQUEPageday, week, days_28
PAGE_NEGATIVE_FEEDBACKPageday, week, days_28
PAGE_NEGATIVE_FEEDBACK_UNIQUEPageday, week, days_28
PAGE_FANS_ONLINEPageday
PAGE_FANS_ONLINE_PER_DAYPageday
PAGE_FANSPagelifetime
PAGE_FAN_ADDSPageday
PAGE_FAN_ADDS_UNIQUEPageday, week
PAGE_FAN_REMOVESPageday
PAGE_FAN_REMOVES_UNIQUEPageday
PAGE_VIEWSPageday
PAGE_VIEWS_UNIQUEPageday, week
PAGE_VIEWS_LOGINPageday, week
PAGE_VIEWS_LOGIN_UNIQUEPageday, week
PAGE_VIEWS_LOGOUTPageday
PAGE_VIDEO_VIEWSPageday, week, days_28
PAGE_VIDEO_VIEWS_PAIDPageday, week, days_28
PAGE_VIDEO_VIEWS_ORGANICPageday, week, days_28
PAGE_VIDEO_VIEWS_AUTOPLAYEDPageday, week, days_28
PAGE_VIDEO_VIEWS_CLICK_TO_PLAYPageday, week, days_28
PAGE_VIDEO_VIEWS_UNIQUEPageday, week, days_28
PAGE_VIDEO_REPEAT_VIEWSPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30SPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30S_PAIDPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30S_ORGANICPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30S_AUTOPLAYEDPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30S_CLICK_TO_PLAYPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30S_UNIQUEPageday, week, days_28
PAGE_VIDEO_COMPLETE_VIEWS_30S_REPEAT_VIEWSPageday, week, days_28
PAGE_POSTS_IMPRESSIONSPostlifetime
PAGE_POSTS_IMPRESSIONS_UNIQUEPostlifetime
PAGE_POSTS_IMPRESSIONS_PAIDPostlifetime
PAGE_POSTS_IMPRESSIONS_PAID_UNIQUEPostlifetime
PAGE_POSTS_IMPRESSIONS_ORGANICPostlifetime
PAGE_POSTS_IMPRESSIONS_ORGANIC_UNIQUEPostlifetime
PAGE_POSTS_IMPRESSIONS_VIRALPostlifetime
PAGE_POSTS_IMPRESSIONS_VIRAL_UNIQUEPostlifetime
POST_IMPRESSIONSPostlifetime
POST_IMPRESSIONS_UNIQUEPostlifetime
POST_IMPRESSIONS_PAIDPostlifetime
POST_IMPRESSIONS_PAID_UNIQUEPostlifetime
POST_IMPRESSIONS_FANPostlifetime
POST_IMPRESSIONS_FAN_UNIQUEPostlifetime
POST_IMPRESSIONS_FAN_PAIDPostlifetime
POST_IMPRESSIONS_FAN_PAID_UNIQUEPostlifetime
POST_IMPRESSIONS_ORGANICPostlifetime
POST_IMPRESSIONS_ORGANIC_UNIQUEPostlifetime
POST_IMPRESSIONS_VIRALPostlifetime
POST_IMPRESSIONS_VIRAL_UNIQUEPostlifetime
POST_CONSUMPTIONSPostday, week, days_28
POST_CONSUMPTIONS_UNIQUEPostday, week, days_28
POST_ENGAGED_USERSPostday, week, days_28
POST_NEGATIVE_FEEDBACKPostday, week, days_28
POST_NEGATIVE_FEEDBACK_UNIQUEPostday, week, days_28
POST_VIDEO_AVG_TIME_WATCHEDPostlifetime
POST_VIDEO_COMPLETE_VIEWS_ORGANICPostlifetime
POST_VIDEO_COMPLETE_VIEWS_ORGANIC_UNIQUEPostlifetime
POST_VIDEO_COMPLETE_VIEWS_PAIDPostlifetime
POST_VIDEO_COMPLETE_VIEWS_PAID_UNIQUEPostlifetime
POST_VIDEO_VIEWS_ORGANICPostlifetime
POST_VIDEO_VIEWS_ORGANIC_UNIQUEPostlifetime
POST_VIDEO_VIEWS_PAIDPostlifetime
POST_VIDEO_VIEWS_PAID_UNIQUEPostlifetime

SimpleVideoInsights

Example:
SELECT Target as PostID, Period, InsightName, Value FROM SimpleVideoInsights where target in (select id from videos where target in (select ID from Pages)) and InsightName = 'TOTAL_VIDEO_VIEWS' and Period = 'lifetime'

Mapping 

Insight NameTarget Period
PAGE_VIDEO_VIEW_TIMEPageday
TOTAL_VIDEO_VIEWSVideolifetime
TOTAL_VIDEO_VIEWS_UNIQUEVideolifetime
TOTAL_VIDEO_VIEWS_AUTOPLAYEDVideolifetime
TOTAL_VIDEO_VIEWS_CLICKED_TO_PLAYVideolifetime
TOTAL_VIDEO_VIEWS_SOUND_ONVideolifetime
TOTAL_VIDEO_COMPLETE_VIEWSVideolifetime
TOTAL_VIDEO_COMPLETE_VIEWS_UNIQUEVideolifetime
TOTAL_VIDEO_COMPLETE_VIEWS_AUTO_PLAYEDVideolifetime
TOTAL_VIDEO_COMPLETE_VIEWS_CLICKED_TO_PLAYVideolifetime
TOTAL_VIDEO_10S_VIEWSVideolifetime
TOTAL_VIDEO_10S_VIEWS_UNIQUEVideolifetime
TOTAL_VIDEO_10S_VIEWS_auto_playedVideolifetime
TOTAL_VIDEO_10S_VIEWS_CLICKED_TO_PLAYVideolifetime
TOTAL_VIDEO_10S_VIEWS_SOUND_ONVideolifetime
TOTAL_VIDEO_AVG_TIME_WATCHEDVideolifetime
TOTAL_VIDEO_VIEW_TOTAL_TIMEVideolifetime
TOTAL_VIDEO_IMPRESSIONSVideolifetime
TOTAL_VIDEO_IMPRESSIONS_UNIQUEVideolifetime
TOTAL_VIDEO_IMPRESSIONS_VIRAL_UNIQUEVideolifetime
TOTAL_VIDEO_IMPRESSIONS_VIRALVideolifetime
TOTAL_VIDEO_IMPRESSIONS_FAN_UNIQUEVideolifetime
TOTAL_VIDEO_IMPRESSIONS_FANVideolifetime

VideoInsightsByActionType

Example:
SELECT Target as PostID, Period, InsightName, Value
FROM VideoInsightsByActionType
where target in (select id from videos where target in (select ID from Pages)) and InsightName = 'TOTAL_VIDEO_STORIES_BY_ACTION_TYPE' and Period = 'lifetime'

Mapping 

Insight NameTarget Period
TOTAL_VIDEO_STORIES_BY_ACTION_TYPEVideolifetime

VideoInsightsByDistributionType

Example:
SELECT EndTime as Date,Target as PageID, Period, InsightName, Page_Owned, Shared, Crossposted
FROM VideoInsightsByDistributionType
where target in (select ID from pages)
and InsightName = 'TOTAL_VIDEO_VIEWS_BY_DISTRIBUTION_TYPE' and Period = 'lifetime'

Mapping 

Insight NameTarget Period
TOTAL_VIDEO_VIEWS_BY_DISTRIBUTION_TYPEVideolifetime
TOTAL_VIDEO_VIEW_TIME_BY_DISTRIBUTION_TYPEVideolifetime

VideoInsightsByReactionType

Example:
SELECT Target as PostID, Period, InsightName, Value
FROM VideoInsightsByReactionType
where target in (select id from videos where target in (select ID from Pages)) and InsightName = 'TOTAL_VIDEO_REACTIONS_BY_TYPE_TOTAL' and Period = 'lifetime'

Mapping 

Insight NameTarget Period
TOTAL_VIDEO_REACTIONS_BY_TYPE_TOTALVideolifetime