Facebook Posts and Pages
The Facebook Posts and Pages connector automates downloading performance data for Facebook Posts, Facebook Pages and Facebok Page-Post Insights
Prerequisites
As of July 2022 you must create a Facebook login or a Business login (System User) to access this functionality.
The Facebook Posts and Pages connector requires the following properties for a Facebook System User Key created in the Key Manger.
- System User Name
- You with need a System Username
- Access Token
- You will need to generate a System User Token in the Graph API Explorer as described in the Facebook Developer documentation
Additionally the following permissions should be set for the system user:
- The system user should be assigned to the Facebook Pages that you need.
- The
page_read_engagement
,page_read_user_content
andpages_show_list permissions
are required or you will receive an empty array of data when asking for pages. - The
read_insights
andpages_read_engagement permissions
are needed to fetch Page and Posts insights data or you will get a permissions error.
Known Issue
Some system users didn't correctly receive the insights permissions. If this is the case, you will get a permissions error. This error only affects Facebook Posts Insights, so to avoid the problem in the middle time, don't use the posts_insights table.Scheduling
The Facebook Posts and Pages connector can be scheduled to ingest data once per day at a user-defined hour and timezone.
By default, the connector will run once at 6am PT.
See Daily Scheduling for more information.
Posts
Parameters
- api_version string
- required
- currently only “v14.0” is allowed
- page_fields list of strings
- required
- For a list of available values, see the table under the heading “Fields” on the Facebook Page GraphQL reference.
- post_fields list of strings
- required
- For a list of available values, see the table under the heading “Fields” on the Facebook Post GraphQL reference.
- post_insights list of strings
- required
- For a list of available values, see the table under the heading “Page Post Impressions” on the Facebook Insights reference
Sample Switchboard Script
download bundle t {
type: "facebook:posts_bundle";
key: "facebook_key";
api_version: "v14.0"; // required
page_fields: ["category","category_list","name","tasks","verification_status"]; // required
post_fields: ["id","permalink_url","shares"]; // required
post_insights: ["post_impressions"]; // required
table pages using {*};
table posts using {*};
table posts_insights {*};
table posts_likes using {*};
table posts_comments using {*};
};
Page Insights
Parameters
See the documentation on Page Insights for details about the limitations on the data returned.
- api_version string
- required
- currently only “v14.0” is allowed
- page_insights string list
- required
- For a list of available values, see the table under the heading “Page Impressions” on the Facebook Insights reference
Sample Switchboard Script
download t from {
type: "facebook:page_insights";
key: "facebook_key";
api_version: "v14.0"; // required
page_insights: ["page_impressions_frequency_distribution","page_impressions","page_posts_impressions"]; // required
} using{*};