There is no default metric for getting the count of posts from Facebook, but you can generate this value with a custom calculated field in Data Studio. Here's step-by-step instructions of how to set this up!
- Click the edit icon for the Facebook Insights data source to bring up the field list.
- Click + ADD A FIELD to bring up the calculated field dialog.
- In Field Name, give the calculated field a meaningful name.
- In the Formula field, add the following:
SUM(CASE WHEN Post ID IS NULL THEN 0 ELSE 1 END )
Example of a completed field configuration:
- Click SAVE to store the custom field.
- You can now add it as a "metric" type field to your report elements!
IMPORTANT - This custom field will behave like a metric, but it's not actually a metric field request to the data source. It is still handled as a "Post ID" dimension by Facebook. So if you use it alone without another metric, you will get the error that "no metric is selected". To get around this, you can use the field with another true metric, add a meaningless filter that uses a metric, or add a field sort on a metric.
Sample workaround below to show the post count in a scorecard (this method does not watch for potential NULL values). The example is made with our Instagram Insights connector, but the same principle works for Facebook as well.