{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Facebook Page Insights Import Integration","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"facebook-page-insights-import-integration","__idx":0},"children":["Facebook Page Insights Import Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can connect Facebook Page Insights integration to import the following Facebook data into Treasure Data:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/graph-api/reference/v6.0/insights"},"children":["Page insights"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/graph-api/reference/post/insights/"},"children":["Post insights"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/graph-api/reference/video/video_insights/"},"children":["Video Insights"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/graph-api/reference/v6.0/object/comments"},"children":["Comments"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/graph-api/reference/page/conversations/"},"children":["Conversation Participants"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/graph-api/reference/v6.0/conversation/messages"},"children":["Conversation Messages"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Treasure Data"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Facebook Graph API"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Having required permissions for downloading Facebook Page data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Authorized Treasure account access"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"using-treasure-console-to-create-your-connection","__idx":2},"children":["Using Treasure Console to Create Your Connection"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-new-authentication","__idx":3},"children":["Create a New Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Go to Integrations Hub > Catalog. Search and select Facebook Page Insights. A dialog will open."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-210320.45b16b9ff73f9c639627a2c0629db4923ce78ddbcef2f12c0d0c535e580b03e3.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can select an existing OAuth connection for Facebook or click the link under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth connection"]}," to create a new connection."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-210750.ed776521d5e97fa8c5c454f61b78b4f1100c8ef807aedcb130a389964eccdfcf.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-new-oauth-connection","__idx":4},"children":["Create a New OAuth Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Login to your Facebook account in a popup window:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-210808.88e27aad3041867a9970bdd740cf86fa67c4f15ce47a655fd9eb583051e60260.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["And grant access to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure Data"]}," app."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You will be redirected back to the Treasure Console. Repeat the first step (Create a new authentication**)** and choose your new OAuth connection."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-210840.aabffa2d03c7059fe0ea0f6116c9cbe7e0e947cc447e926aa229b965196023c0.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Name your new authentication. Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-210911.ae4274b1fc1d2af755683e4f58e585882b7abe3715eca3c5537f443b27e95f17.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"transfer-your-facebook-insights-data-to-treasure-data","__idx":5},"children":["Transfer Your Facebook Insights Data to Treasure Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentications"]},", configure the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Source"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-210935.bb873f066cd95ded8e17aca1046832603b5773aa17c05ac29678c9d8aa131b12.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can name the Source in this dialog by editing the Data Transfer Name."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Name the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source"]}," in the Data Transfer field**.**"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},". The Source Table dialog opens."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200330-193201.b416ea4b9c91a08ef18afaa872503538ee3b6bb9f75d12558b5823eab0ae84ff.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"source-table","__idx":6},"children":["Source Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the Source Table, edit the parameters and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200330-193531.a9eadc3ea07f75316f8a63936e463be2d740b65b2ac675f0b2a762e97ddc0e59.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameter"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Supported data types**:**   - Page - Post - Video - Conversation Messages - Conversation Participants - Comments"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Folders(s)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conversation folders"]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the data type Video, the only period supported is Lifetime."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-settings","__idx":7},"children":["Data Settings"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this dialog, you can edit data settings or skip this step."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Edit the Data Settings parameters."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Next."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200330-193913.b257f6d711d5944fbb9af4d682d21cb9285d532fc9837511ce272d42a88e1864.4ac59c12.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Retrieve Video insights back to"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Due to Facebook-specified data limits, a job may fail to retrieve all past data. The default setting is to import the last three months of data for Video Insights. Update this value to import more data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Skip Error POST"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Default true. Skip the error when importing POST Insights when an error occurs."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Retry Limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The number of retries before the connector stops trying to connect and retrieve data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Retry initial wait in millis"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Interval to retry if a recoverable error happens (in milliseconds)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Max retry wait in millis"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum time in milliseconds between retry attempts."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTP connect timeout in millis"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP connection timeout."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTP idle timeout in millis"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP idle timeout."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-preview","__idx":8},"children":["Data Preview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can see a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data"},"children":["preview"]}," of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},". The Data Preview page opens."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If you want to preview your data, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Generate Preview"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify the data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-placement","__idx":9},"children":["Data Placement"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For data placement, select the target database and table where you want your data placed and indicate how often the import should run."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next."]}," Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Database"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Select an existing"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Database"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, type a database name."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Table"]},"> ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Select an existing"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Table"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, type a table name."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Choose the method for importing the data."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Append"]}," (default)-Data import results are appended to the table."," ","If the table does not exist, it will be created."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Always Replace"]},"-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Replace on New Data"]},"-Only replace the entire content of an existing table with the result output when there is new data."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timestamp-based Partition Key"]}," column."," ","If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timezone"]}," for your data storage."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]},", you can choose when and how often you want to run this query."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"run-once","__idx":10},"children":["Run once"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Off"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scheduling Timezone"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create & Run Now"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"repeat-regularly","__idx":11},"children":["Repeat Regularly"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["On"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]},". The UI provides these four options: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@hourly"]},", ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@daily"]}," and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@monthly"]}," or custom ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["cron"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can also select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delay Transfer"]}," and add a delay of execution time."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scheduling Timezone"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create & Run Now"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After your transfer has run, you can see the results of your transfer in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Databases."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-command-line-to-create-your-facebook-connection","__idx":12},"children":["Use Command-Line to Create Your Facebook Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the Treasure Console to configure your connection."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"install-the-treasure-data-toolbelt","__idx":13},"children":["Install the Treasure Data Toolbelt"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open a terminal and run the following command to install the newest ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"obtain-a-facebook-token","__idx":14},"children":["Obtain a Facebook Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/facebook-login/access-tokens"},"children":["Facebook provides three types of tokens"]},". You will need the Page Access Token. We recommend that you select the never-expiring Page Access Token."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To obtain the never-expiring Page Access Token, follow the instructions here: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.rocketmarketinginc.com/blog/get-never-expiring-facebook-page-access-token/"},"children":["https://www.rocketmarketinginc.com/blog/get-never-expiring-facebook-page-access-token/"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prepare-a-configuration-file-configyml","__idx":15},"children":["Prepare a Configuration File (config.yml)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Using a text editor, create a file called config.yml. Copy and paste the following information, replacing the placeholder text with your Facebook connector info."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["in"]}," section specifies what comes into the connector from Facebook, and the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["out"]}," section specifies what the connector sends to the database in Treasure Data. For more details on available ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["out"]}," modes, see Appendix."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: \"facebook_page_insights\"\n  access_token: \"[your Facebook Page token]\"\n  page_id: [your Facebook Page ID]\n  data_type: page\n  incremental: true\n  select_all_metrics: true\n  since: 2017-01-01\n  until: 2017-01-31\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuration keys and descriptions are as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option name"},"children":["Option name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required?"},"children":["Required?"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default Value"},"children":["Default Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["access_token"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Facebook Page Access Token."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["page_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Facebook Page ID. See Addendum"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["data_type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- page - post - video - conversation_message - conversation_participant - comment"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["page"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["select_all_metrics"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Import all supported insight metrics for the current Data Type. Set this value so you don't need to set metric_presets or metrics. Applicable for Page and Post. See Available Metrics."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["metric_presets"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Predefined category of metrics or group of related metrics. See Supported Preset Metrics."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["metrics"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Facebook Graph insight metrics, you can specify each metric as much as you need. This config will override metric_preset if both of them are specified. Supported Metrics"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["since"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A lower bound of the time range to consider, supported formats: yyyy-MM-dd or Unix time i.e. 1584697547"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["until"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An upper bound of the time range to consider, supported formats: yyyy-MM-dd or Unix time i.e. 1584697547"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["period"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The aggregation period. See Supported Periods."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["enum"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["date_preset"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Preset a date range, like ‘lastweek’ or ‘yesterday’. The data transfer request will fail if a ‘since’ or ‘until’ date is specified, and the date_preset is also selected. See Supported Date Presets."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["enum"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["incremental"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["true for generate “config_diff” with embulk run -c config.diff"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["last_in_months"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retrieve Video insights back to this month's range. Specify that a range of more than three months would cause the job error due to Facebook API limitations."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3 (months)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["skip_error_post"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skip error when importing POST insights"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["true"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["retry_limit"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number of error retries before the connector gives up"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["7"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["retry_initial_wait_millis"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait milliseconds for exponential backoff initial value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["500 (0.5 second)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["max_retry_wait_millis"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum wait milliseconds for each retry"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["300000 (5 minutes)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["connect_timeout_millis"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP connect timeout in milliseconds"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["180000 (3 minutes)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["idle_timeout_millis"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP idle timeout in milliseconds"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["300000 (5 minutes)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["conversation_folders"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conversation folder: inbox, page_done, other, pending and spam  E.g. [{\"value\":\"inbox\"}]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["all folders"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example of config*.yml* with incremental and Page data type"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: \"facebook_page_insights\"\n  access_token: \"[your Facebook Page token]\"\n  page_id: [your Facebook Page ID]\n  data_type: page\n  page_metric_presets:\n  - value: page_impressions\n  - value: page_cta_clicks\n  - value: page_user_demographics\n  - value: page_views\n  - value: page_engagement\n  incremental: true\n  since: 2017-01-01\n  until: 2017-01-31\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Post data type"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: \"facebook_page_insights\"\n  access_token: \"[your Facebook Page token]\"\n  page_id: [your Facebook Page ID]\n  data_type: post\n  post_metric_presets:\n  - value: page_post_impressions\n  - value: page_post_engagement\n  - value: page_post_reactions\n  - value: page_video_posts\n  since: 2017-01-01\n  until: 2017-01-31\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Video data type"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: \"facebook_page_insights\"\n  access_token: \"[your Facebook Page token]\"\n  page_id: [your Facebook Page ID]\n  data_type: video\n  last_in_months: 3\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"preview-the-data-to-be-imported-optional","__idx":16},"children":["Preview the Data to be Imported (Optional)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can preview data to be imported using the command ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td connector:preview"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:preview config.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"execute-load-job","__idx":17},"children":["Execute Load Job"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you execute the load job, you must specify the database and table where you want to store the data. |"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You use td connector:issue to execute the job. The following are required: the schedule's name, the cron-style schedule, the database and table where their data will be stored, and the Data Connector configuration file."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue config.yml --database td_sample_db --table td_sample_table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is recommended to specify --time-column option because Treasure Data’s storage is partitioned by time. You can also use the --time-column option to override auto-generated time values, by specifying end_time as the time column (only applied for data_type",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["page"]},"). Data will be accumulated daily and end_time will be end of the day, using the timezone of your Facebook Page, but converted to UTC format."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your data doesn’t have a time column, you can add one using the add_time filter option. See details at ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/add_time-filter-function"},"children":["add_time Filter Plugin for Integrations"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Finally, submit the load job. Depending on the data size, it may take a couple of hours. You must specify the database and table where their data is stored."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue config.yml --database td_sample_db --table\ntd_sample_table --time-column end_time\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scheduled-execution","__idx":18},"children":["Scheduled Execution"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can schedule periodic data connector execution for incremental Facebook Insights data. We configure our scheduler carefully to ensure high availability. This feature eliminates the need for a cron daemon in your local data center."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the scheduled import, the Data Connector for Facebook Page Insights imports all of your ad data at the first run."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the second and subsequent runs, the connector imports only newer data than the last load."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"create-the-schedule","__idx":19},"children":["Create the Schedule"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A new schedule can be created using the td connector:create command. The following are required: the schedule's name, the cron-style schedule, the database and table where their data will be stored, and the data connector configuration file."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:create \\\n    daily_import \\\n    \"10 0 * * *\" \\\n    td_sample_db \\\n    td_sample_table \\\n    config.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cron"]}," parameter also accepts three special options: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@hourly"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@daily"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@monthly"]},". | By default, the schedule is set in the UTC timezone. You can set the schedule in a different timezone using the —t or—-timezone option. Note that the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]}," option supports only extended timezone formats like 'Asia/Tokyo', 'America/Los_Angeles', etc. Timezone abbreviations like PST and CST are not supported and may lead to unexpected schedules."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"faq","__idx":20},"children":["FAQ"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"q-why-were-my-scheduled-jobs-categorized-as-success-but-did-not-bring-in-new-data","__idx":21},"children":["Q: Why were my scheduled jobs categorized as \"SUCCESS\" but did not bring in new data?"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"2018-05-06 13:00:18.627 +0000 [WARN] (0047:task-0043): Time range does not reach, abort and will retry later. Start Date: '1525330800', End Date: '1528095600', Current Date: '2018-05-06'\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This means either ‘Start Date’ or ‘End Date’ has exceeded the current date, for example, is specified with a date in the future. The cause of such warning messages could be that you’ve configured cron shorter than the fetching time range. For example, a daily job to pull monthly data."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"q-how-can-i-set-up-daily-jobs-to-pull-in-new-data-each-time","__idx":22},"children":["Q: How can I set up daily jobs to pull in new data each time?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You need an initial load (or multiple loads, due to the limitation of a 3-month time range for each load). Let’s say today is 2018-05-09, and you need to load data since 2018-01-01:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Jobs"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Start Date"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["End Date"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["First job (one-time)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2018-01-01"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2018-04-01"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Second job (one-time)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2018-04-01"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2018-05-08"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[Incremental] Daily job"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2018-05-08"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2018-05-09"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"q-why-do-i-suddenly-have-so-many-posts-insights-data","__idx":23},"children":["Q: Why do I suddenly have so many Posts Insights data?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Starting from version v0.2.0, you will get insights into all Posts from the very first post of the page until the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["End Date"]}," value. This improvement upgrades the date setting so you will be able to get the Insights data from ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["the Start Date"]}," to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["End Date"]}," of all available Posts. Compared to version v0.1.16, you can only get the insights data from ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["the Start Date"]}," to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["the End Date"]},"of the Posts created within that date range."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"page-id","__idx":24},"children":["Page ID"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Instead of using Page's username when creating the connector, you can use Page ID. To find the page ID, on your Facebook page, select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["About"]}," menu and scroll down to the Page ID, as shown:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191017-212720.d13ab7557b7f8108626a126329983da7233e2f4c98922fe36ecad09470d100e6.4ac59c12.png","alt":""},"children":[]}]}]},"headings":[{"value":"Facebook Page Insights Import Integration","id":"facebook-page-insights-import-integration","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Using Treasure Console to Create Your Connection","id":"using-treasure-console-to-create-your-connection","depth":2},{"value":"Create a New Authentication","id":"create-a-new-authentication","depth":3},{"value":"Create a New OAuth Connection","id":"create-a-new-oauth-connection","depth":3},{"value":"Transfer Your Facebook Insights Data to Treasure Data","id":"transfer-your-facebook-insights-data-to-treasure-data","depth":3},{"value":"Source Table","id":"source-table","depth":3},{"value":"Data Settings","id":"data-settings","depth":3},{"value":"Data Preview","id":"data-preview","depth":3},{"value":"Data Placement","id":"data-placement","depth":3},{"value":"Run once","id":"run-once","depth":4},{"value":"Repeat Regularly","id":"repeat-regularly","depth":4},{"value":"Use Command-Line to Create Your Facebook Connection","id":"use-command-line-to-create-your-facebook-connection","depth":2},{"value":"Install the Treasure Data Toolbelt","id":"install-the-treasure-data-toolbelt","depth":3},{"value":"Obtain a Facebook Token","id":"obtain-a-facebook-token","depth":3},{"value":"Prepare a Configuration File (config.yml)","id":"prepare-a-configuration-file-configyml","depth":3},{"value":"Preview the Data to be Imported (Optional)","id":"preview-the-data-to-be-imported-optional","depth":3},{"value":"Execute Load Job","id":"execute-load-job","depth":3},{"value":"Scheduled Execution","id":"scheduled-execution","depth":3},{"value":"Create the Schedule","id":"create-the-schedule","depth":4},{"value":"FAQ","id":"faq","depth":2},{"value":"Q: Why were my scheduled jobs categorized as \"SUCCESS\" but did not bring in new data?","id":"q-why-were-my-scheduled-jobs-categorized-as-success-but-did-not-bring-in-new-data","depth":3},{"value":"Q: How can I set up daily jobs to pull in new data each time?","id":"q-how-can-i-set-up-daily-jobs-to-pull-in-new-data-each-time","depth":3},{"value":"Q: Why do I suddenly have so many Posts Insights data?","id":"q-why-do-i-suddenly-have-so-many-posts-insights-data","depth":3},{"value":"Page ID","id":"page-id","depth":2}],"frontmatter":{"seo":{"title":"Facebook Page Insights Import Integration"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/facebook-page-insights-import-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}