Use Facebook as a data source

Resources

Data Source Type: Web Accessible Resource
Authentication: OAuthToken Authentication
API Documentation: Facebook Graph API
API Explorer: Facebook's Graph API Explorer
Date Ranges: Klipfolio Date Ranges
Klip Gallery

Save time and add pre-built Klips with the Klip Gallery!

Klip Gallery: Facebook

Connecting to the Facebook API


Overview


You can add Facebook data to a Klip by creating a query. This article shows you how to use Facebook as a data source and provides advanced information on customizing your query.

For step-by step instructions on retrieving Facebook Page Insights, see our blog: Using Facebook’s Graph API Explorer to retrieve Page Insights data.
Reminder: Ensure that your access token is current. For instructions on re-authorizing your OAuth token, please see this article.
You can either watch our short video or follow our step-by-step guide below on creating a data source using Facebook .



Step-by-Step

Creating a data source using Facebook


To create a data source using Facebook data, you need to accomplish the following tasks as explained in the step - action table below:
  1. Craft a query using the Facebook Graph API Explorer
  2. Start the data source creation process
  3. Set up your Access Token
  4. Enter the query in Klipfolio 
  5. Use Klipfolio to adjust the query for your dashboard
  6. Review our list of resources for creating Facebook queries. 
Notes: You must have an active Facebook account to work with Facebook queries.

Steps

Actions

Step 1: Use the Facebook Graph API Explorer to craft a query.

In this section, you will work with the Facebook's Graph API Explorer to construct a URL.

  1. Navigate to the Facebook Graph API Explorer at the following URL: https://developers.facebook.com/tools/explorer
  2. Click the Get Access Token button.
  3. In the Get Access Token window, click Extended Permissions, select the appropriate permissions and click the Get Access Token button. A new Login window will appear.  
  4. Click OKAY to allow Graph API Explorer access your public profile
  5. Click your profile ID in the Graph API Explorer window. The Request URL is updated.
  6. Keep the Explorer window open while you create the Facebook datasource in Klipfolio.
Step 2: Start the data source creation process.
  1. Log into your Klipfolio.
  2. Click on the Library link.
  3. Select the Data Sources tab.
  4. Click the Create a New Data Source button.
  5. Select the Web Accessible Resource option
  6. Click on the Library link.
  7. Select the Data Sources tab.
  8. Click the Create a New Data Source button.
  9. Select the Web Accessible Resource option.

Step 3: Authenticate with Facebook.
  1. Expand Authentication (OAuth, 2-Step, or Basic) in the New Data Source window. 
  2. Select the OAuth Credentials option.
  3. Click the Create button.
  4. Select Facebook from the list of OAuth service providers.
  5. Click OKAY to allow Klipfolio to access your public profile.
  6. Enter your name and password when prompted.
  7. Click the Log In button.
  8. Click Save.

Step 4: Enter the query in Klipfolio.


Now you'll need to bring the query you crafted with the Query Explorer into Klipfolio.
  1. In the Facebook Graph API explorer, select the query URL from the text field.
  2. Copy the URL to your clipboard.
  3. Return to Klipfolio
  4. Paste the URL in the URL field on the New Data Source page.


Note: You will need to manually enter the first part of the query URL: http://graph.facebook.com
You may need to modify your query (see next step) before you create the data source and build a Klip.
Step 5: Edit the query date ranges and save.

Many Klips that use Facebook data need a date range that is dynamic (for example, the past 30 days). In this section we're going to change the query from a fixed range to a dynamic one. Note that you will use the since and until parameters, as opposed to the start-date and end-date parameters used for other data sources (such as Google Analytics).
  1. To edit the query, navigate to Library and select the Facebook data source with which you are working.
  2. Enter a ? at the end of the URL.
  3. Enter since={date.last30Days} at the end of your Query URL (after the ?).
  4. Enter &until={date.today} at the end of your Query URL (after the since parameter).
  5. For Date Format, use the drop-down menu to select JSON.
  6. Click the Get Resource button.
  7. Click the Continue button once you verify you have retrieved the correct data.
  8. Name and save the data source.

If you used the sample query (see above), then the query should look something like this:

https://graph.facebook.com/{ProfileID}/insights/page_fans?since={date.last30Days}&until={date.today}

Replace {ProfileID} with your Facebook ID.

Common date range expressions:


{date.today}
{date.last30Days}
{date.startOfQuarter}
And many more..
Facebook Insights

You can use Facebook's Graph API explorer to retrieve Facebook Page Insights data. To do this, insert /insights after your profile ID. When you click submit, the query explorer window will update to show all insights data associated with your account. To limit the data you retrieve, click on the id link to add that query parameter to your URL endpoint.For a quick explanation of how to forumlate a Facebook Page Insights query, check out our blog on this topic. 

Facebook Ads

The Facebook Ads API are also supported.

Examples

Daily Page Viewhttps://graph.facebook.com/{ProfileID}/insights/page_views/day
Daily People Talking About Thishttps://graph.facebook.com/{ProfileID}/insights/page_story_adds_unique/day
Lifetime Likes by Gender and Agehttps://graph.facebook.com/{ProfileID}/insights/page_fans_gender_age/lifetime

Related Links


Connecting to data sources

  1. Klipfolio Data Source Integrations
  2. Creating data sources
  3. Best practices for uploading your data
  4. Updating data sources
  5. About data source refresh
  6. Install the latest Google Analytics KlipStart Dashboard
  7. NEW: Install the latest Google AdWords KlipStart (for MCC accounts only)
  8. Guide to Web Accessible (REST API) data sources
  9. Authentication method: OAuth Token Authentication for Web Accessible Data Source
  10. Why does Klipfolio need specific permissions to connect my service accounts?
  11. Authentication method: 2 Step Authentication
  12. Authentication method: Basic HTTP Authentication
  13. Authentication method: API Key Authentication
  14. Managing OAuth tokens for connected accounts
  15. Use date range parameters to modify data retrieval period
  16. NEW: Signed Authentication Builder (Hash Helper) (advanced)
  17. Locate a data source ID
  18. SQL Databases
  19. Use files from your computer as a data source
  20. Use Email Attachments as a data source
  21. Use Excel spreadsheets as a data source
  22. NEW: Use Adobe Analytics as a data source
  23. NEW: Use Alexa as a data source
  24. Use Asana as a data source
  25. NEW: Use Atlassian JIRA as a data source
  26. NEW: Use AWeber as a Data Source
  27. NEW: Use Basecamp as a data source
  28. Use Bitly as a data source
  29. Use Box as a data source
  30. NEW: Use Buffer as a data source
  31. NEW: Use CallRail as a data source
  32. Use Campaign Monitor as a data source
  33. NEW: Use Chargify as a data source
  34. Use Cloud Monitor as a data source
  35. Use comScore Digital Analytix as a data source
  36. NEW: Use Desk.com as a data source
  37. Use Dropbox as a data source
  38. Use Eloqua as a data source
  39. Use Facebook as a data source
  40. NEW: Use Facebook Ads as a data source
  41. NEW: Use FluidSurveys as a data source
  42. Use Freshdesk as a data source
  43. NEW: Use Fusebill as a data source
  44. Use FTP or SFTP as a data source
  45. NEW: Use Glassdoor as a data source
  46. Use Google+ as a data source
  47. NEW: Use Google AdWords as a data source
  48. Use Google Analytics as a data source
  49. Use Google Analytics to create a Multi-Channel Funnel (MCF) API data source
  50. NEW: Use Google Calendar as a data source
  51. Use Google Drive Apps as a data source
  52. Use Google Webmaster Tools as a data source
  53. NEW: Use Harvest as a Data Source
  54. NEW: Use GoSquared as a data source
  55. Use Heartbeat as a Data Source
  56. NEW: Use HubSpot as a data source
  57. NEW: Use iFormBuilder as a data source
  58. PREVIOUS: Use iFormBuilder as a data source
  59. Use Infusionsoft as a data source
  60. NEW: Use Insightly as a data source
  61. NEW: Use Instagram as a data source
  62. NEW: Use Intercom as a data source
  63. Use Intervals as a data source
  64. NEW: Use Lighthouse as a Data Source
  65. Use LinkedIn as a data source
  66. Use Localytics as a data source
  67. Use MailChimp as a data source
  68. NEW: Use Mixpanel as a data source
  69. NEW: Use Marketo as a data source
  70. NEW: Use Moz as a data source
  71. NEW: Use New Relic as a data source
  72. Use Nicereply as a data source
  73. Use Optimizely as a data source
  74. NEW: Use Pardot as a data source
  75. Use Pingdom as a data source
  76. NEW: Use Pipedrive as a data source
  77. Use Podio as a data source
  78. NEW: Use QuickBooks as a data source
  79. Use QuickBooks with the Email Attachment Connector
  80. NEW: Use Quintly as a data source
  81. Use Radian6 as a data source
  82. NEW: Use RSS news feeds as a data source
  83. Use Salesforce as a data source
  84. Use Searchmetrics as a data source
  85. Use Sendible as a data source
  86. NEW: Use Shopify as a data source
  87. Use ShoreTelSky as a data source
  88. NEW: Use Slack as a data source
  89. Use Smartsheet as a data source
  90. NEW: Use Stripe as a data source
  91. Use SurveyGizmo as a data source
  92. NEW: Use Swrve as a data source
  93. Use Toggl as a data source
  94. NEW: Use Trello as a data source
  95. NEW: Use Taleo as a data source
  96. NEW: Use Talkwalker as a data source
  97. NEW: Use Todoist as a data source
  98. Use Topsy as a data source
  99. Use Twitter as a data source
  100. Use UserVoice as a data source
  101. NEW: Use VKontakte as a data source
  102. Use Webtrends as a data source
  103. NEW: Use Xero as a data source
  104. Use XMLA as a data source
  105. NEW: Use Yahoo Finance as a data source
  106. Use YouTube Analytics as a data source
  107. Use Zendesk as a data source
  108. Use Zoho CRM as a data source
  109. Automate data upload using the data source API
  110. Use Unbounce as a data source
  111. Data examples

Feedback and Knowledge Base