For AI agents: the complete documentation index is available at https://docs.dataplatform.ovh.net/llms.txt, the full documentation bundle is available at https://docs.dataplatform.ovh.net/llms-full.txt, and this page is available as Markdown at https://docs.dataplatform.ovh.net/connectors-sources-facebook.md.
  • πŸ‡¬πŸ‡§ English
  • Collect Facebook page insights with the Data Platform connector

    Collect data and insights from a Facebook page into the Data Platform, such as likes, views and comments

    Objective

    Warning

    Uh oh! This article is outdated and needs to be rewritten. Please contact Support if you need help setting up this connector.

    The Facebook connector lets you collect data and insights from a Facebook page into the Data Platform, such as likes, views and comments.

    FB1

    Get your access credentials

    Learn how to get a Facebook Developer app token

    The following steps will guide you through the procedure of creating an app token on the Facebook Developer user interface.

    Pre-requisites: app token

    • Log into your Facebook account that has all the Admin permissions on the Pages you want the access tokens for.
      If you are not the page's admin, ask your admin to grant you Analyst access to the page.

    • Please note that if the account that granted access to the tokens doesn’t own the admin or analyst role for the page anymore, the access token will be revoked.

    Procedure: app token

    Step 1. Create your Facebook Developer app
    Procedure: app token β€” Facebook dev2
    • Follow the steps in the pop-up window that just opened. It is not mandatory to create a "First App", you can skip this step.
    Procedure: app token β€” Facebook dev3
    • Go on https://developers.facebook.com. Enter the My Apps menu at the top right corner, right next to the search bar. You should now be able to click the Add a New App button at the top right corner.
    Procedure: app token β€” Facebook dev4
    • Fill-in the blanks in the form that just popped up and click on Create App ID
    Procedure: app token β€” Facebook dev5
    Step 2. Retrieve your App ID and App Secret
    • You will now land on you new App Dashboard. Click on Settings on the left and then on Basic, right beneath it.
    Procedure: app token β€” Facebook dev6
    • Just right to the App Secret field, click on Show.
    Procedure: app token β€” Facebook dev7
    • You can now copy your App ID and App Secret and paste them in a new text editor window.
    Procedure: app token β€” Facebook dev8

    How to validate your Facebook app

    How to validate your Facebook app β€” Step1
    • Go to your basic settings. Click on "Settings", then "Basic"
    How to validate your Facebook app β€” Step2
    • Give your basic settings. Give the following information in order to submit your app.
    How to validate your Facebook app β€” Step3
    • Add a platform. At the bottom of the settings page, click on "Add Platform". Then click on Website, enter your company website URL and click on "Save changes", at the bottom right.
    How to validate your Facebook app β€” Step4
    • Begin the app review by simply clicking on "App Review". Then click on "Add items" in the right corner.
    How to validate your Facebook app β€” Step5
    • Then click on "Read_insights" and click on add 1 item.
    How to validate your Facebook app β€” Step6
    • Add details of sumissions. Go back to "App review tab" and click on "Add details" for read_insights.
    How to validate your Facebook app β€” Step7
    • Add details of read_insights submission
    How to validate your Facebook app β€” Step8
    • Submit the review. You must read the conditions, click on "I accept..." and then click on "Submit".

    • Conclusion of the review. Facebook review can take from 2-3 days, to some weeks in peak periods. If your review is not accepted : If that’s because of the screencast, kindly reajust the screencast in view of the facebook notices If that’s because of the review text, please reajust the text and gives us feedback about it If the reason seems more blocking or go in contradiction with the present document, you can contact the Data Platform Team and we will do our best to help.

    • Business creation. In the left menu, click on "Settings", then Advanced. Scroll down until you see "Business Manager", then click on "Get started".

    • Complete and validate the following form.

    How to validate your Facebook app β€” Step13
    • Business verification. Once your app has been verified, you should receive a message in order to verify your business Go to App Review, and click on "Provide business details". Enter them and click on the Next button.
    How to validate your Facebook app β€” Step9
    • You should provide business documents that show the legal name of your business plus at least one of the following which matches the information you just entered :
    • Business Phone Number
    • Address
    • Tax ID
    How to validate your Facebook app β€” Step14
    • Provide basic information about you, then "Submit".
    How to validate your Facebook app β€” Step11
    • You will receive an email in order to accept the legal terms If you haven’t got the email : please check your spam box. Or redo the last step and correct your email information, the submission will re-send an email. Click on the link in order to accept the terms.

    • On the terms page, read attentively all the terms, Then click "I Agree" if you agree with all the terms.

    You're good to move to step 3!

    Step 3. Generate your app's token
    How to validate your Facebook app β€” Facebook dev10
    • Now click on the Get token button and select Get User Access Token from the dropdown menu.
    How to validate your Facebook app β€” Facebook dev11
    • In the window that just popped up, select the different permissions you need (don't forget to tick the read_insights option) and click on the Get Access Token button.
    Info

    Note: as stated above, you need to be logged in to Facebook with an account that has either Admin or Analyst access for this to work

    How to validate your Facebook app β€” Facebook dev12
    • Click on the Continue as button.
    How to validate your Facebook app β€” Facebook dev13
    • Then on OK at the bottom right.
    How to validate your Facebook app β€” Facebook dev14
    • You just generated a short-term access token. Copy it and paste it in your text editor alongside your App ID and App Secret.
    How to validate your Facebook app β€” Facebook dev15
    • Now edit the following URL template by replacing {app_id}, {app_secret} and {access_token} with your values.

    https://graph.facebook.com/v2.12/oauth/access_token?grant_type=fb_exchange_token&client_id={app_id}&client_secret={app_secret}&fb_exchange_token={access_token}

    How to validate your Facebook app β€” Facebook dev17
    • Once done, paste your URL in your web browser. Copy the result and paste it in your text editor.
    How to validate your Facebook app β€” Facebook dev18
    • Copy this new URL and replace {access token} with the content of the "access_token" field from last step's result:

    https://graph.facebook.com/v2.12/me?access_token={access_token}

    How to validate your Facebook app β€” Facebook dev19
    • Once again, copy the result from last step in your text editor and replace the {account_id} and {access_token} with the id and access_token fields from the previous steps in the following URL template:

    https://graph.facebook.com/v2.12/{account_id}/accounts?access_token={access_token}

    How to validate your Facebook app β€” Facebook dev21
    • One last time, paste the URL in your web browser. You can now save the information displayed on your screen to a .json document.

    Learn how to find your Facebook page ID

    Pre-requisites: page ID

    • You need to be the page's Admin to get this information.

    Procedure: page ID

    Step 1. Log into your Facebook account that has Admin access to the page.
    Procedure: page ID β€” Facebook page id1
    Step 2. Click on the three horizontal dots and select Edit Page Info in the dropdown menu.
    Procedure: page ID β€” Facebook page id2
    Step 3. Click on See All Information at the bottom of the window that just popped up.
    Procedure: page ID β€” Facebook page id3
    Step 4. Copy your Page ID from the very bottom of the page.
    Procedure: page ID β€” Facebook page id4

    Add a Facebook source on Data Platform

    Configuration screen overview

    Once you have found Facebook in the Data Platform store, click on Select and you will be able to see the configuration screen as shown below:

    FB2

    Configuring your source

    Connect to Facebook

    When creating the source, you will be required to input the following information :

    • Account: your Facebook Page ID
    • Access Token: your Facebook Developer app token
    • Source default schema: you can use this field to add columns to your data, if necessary. Use the following syntax {"name":"value"}, where name is the name of your column and value is the value to be filled in all rows.

    Once you add the above details click on Connect to establish a connection with Facebook.

    Add the Accounts and Endpoints

    Before moving on, you have to add accounts and endpoints.

    • Accounts are Facebook pages referenced by the Page ID - just like in the previous screen - which you want to get data from.
    • Endpoints are the different types of data about accounts that Data Platform will get using the Facebook API. Each endpoint corresponds to a final table, aggregating data for all selected accounts.
    FB3
    Info

    Data Platform will use the credentials given in the Connect to Facebook step to access the Facebook API but you can overwrite the credentials to have multiple accounts and endpoints in the same source. Simply add the different accounts to the Source after the Connect to Facebook step.

    How to add an account?

    To add an account, click on Add an Account. This will open the following window:

    FB4

    By default, it is using the same credentials you wrote previously when establishing the connection, which you can overwrite here. The account name is the internal display name.

    How to add an Endpoint?

    On Data Platform, each registered endpoint will correspond to a data source object, which you will be able to load into a distinct table.

    To add an endpoint, click on Add an Endpoint. This will open the following window:

    FB5

    Next, select the type of Endpoint you wish to add. The Data Platform team is always adding new types of Endpoints to the connectors. You can click on the scroll-down list under the Type field to see the ones available.

    Most common ones are:

    • page_data: general data about the page.
    • day_insights: data about the page sorted by day.
    • post_insights: data about the page's posts.

    Some types require you to add Insights to the endpoint, which is just a way of telling the Data Platform platform which data to get. To add an insight, just start typing inside the Insight field and click Enter to select the data insight you want.

    FB6
    Info

    Note that you can add more than one insight to the same endpoint.

    To finish, click on the Create button on the top right-hand corner.

    Warning

    Don't forget to name your source before creating it. The technical name cannot be changed after creating the source and will be used when trying to open the source using the Data Platform SDK.

    Go further

    If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.

    Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated Discord channel.

    If you need support with your OVHcloud services, create a request in our Help Centre.

    Join our community of users.