Skip to content

Instantly share code, notes, and snippets.

@safuss
Created June 28, 2017 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save safuss/826dc1a7b7034b7c7a4af20e931928b9 to your computer and use it in GitHub Desktop.
Save safuss/826dc1a7b7034b7c7a4af20e931928b9 to your computer and use it in GitHub Desktop.
Config for custom Facebook "Key Metrics Table" showing total interactions
{
"config": {
"qqlQuery": "SELECT \n\tname, \n\tfans AS totalFans, \n\t(fans-fansBefore) AS fanIncrease, \n\townPosts AS own_posts, \n\townPostsLikes+ownPostsLove+ownPostsWow+ownPostsHaha+ownPostsSad+ownPostsAngry+ownPostsComments+ownPostsShares AS own_interactions, \n\t(ownPostsLikes+ownPostsLove+ownPostsWow+ownPostsHaha+ownPostsSad+ownPostsAngry) AS own_reactions, \n\townPostsComments AS own_comments, \n\townPostsShares AS own_shares, \n\tuserPosts AS user_posts, \n\tPRINTFNULL(\"%.4f\",(((ownPostsLikes+ownPostsLove+ownPostsWow+ownPostsHaha+ownPostsSad+ownPostsAngry+ownPostsComments+ownPostsShares*1.0)/ownPosts)/((fansBefore+fans)/2))*100) AS interactionRate, \n\tPRINTF(\"%.1f\",(((responseTime0To2h + responseTime2To8h + responseTime8To24h + responseTimeLongerThan24h*1.0)/(responseTime0To2h + responseTime2To8h + responseTime8To24h + responseTimeLongerThan24h + responseTimeNotResponded*1.0))*100)) AS responseRate \nFROM facebook \nINNER JOIN profiles \nON facebook.profileId=profiles.id",
"metaData": {
"columns": [
{
"id": "name",
"title": "Name",
"width": 0.15
},
{
"id": "totalFans",
"title": "Fans",
"width": 0.085,
"type": "integer"
},
{
"id": "fanIncrease",
"title": "+/-",
"width": 0.085,
"type": "integer",
"hideOnDashboard": true
},
{
"id": "own_posts",
"title": "Posts",
"width": 0.085,
"type": "integer"
},
{
"id": "own_interactions",
"title": "Total Interactions",
"width": 0.085,
"type": "integer"
},
{
"id": "own_reactions",
"title": "Reactions",
"width": 0.085,
"type": "integer",
"hideOnDashboard": true
},
{
"id": "own_comments",
"title": "Comments",
"width": 0.085,
"type": "integer",
"hideOnDashboard": true
},
{
"id": "own_shares",
"title": "Shares",
"width": 0.085,
"type": "integer",
"hideOnDashboard": true
},
{
"id": "user_posts",
"title": "User Posts",
"width": 0.085,
"type": "integer"
},
{
"id": "interactionRate",
"title": "I-Rate",
"width": 0.085,
"type": "percent"
},
{
"id": "responseRate",
"title": "Response Rate",
"width": 0.085,
"type": "percent",
"hideOnDashboard": true
}
],
"serverSide": false,
"paginate": false,
"sortBy": "totalFans",
"sortDir": "DESC"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment