Facebook Ads Connector

Overview

Facebook Marketing is an online advertising platform developed by Facebook where businesses pay to display and track marketing campaigns over the Facebook platform to users.

The Datacoral Facebook Ads connector collects data from a Facebook marketing account and replicates ads, campaigns, and ad accounts data into a data warehouse, such as Redshift.

Set up connector through the UI

The steps to create a connector are:

  1. Connect to Facebook through OAuth
  2. Specify the connector configuration
  3. Add the Facebook connector

1. Connect to Facebook through OAuth

Pre-requisites

Before adding the connector, make sure to have an email and password to log into Facebook.

Instructions

  1. Select Facebook Ads connector.

  2. Click on "Continue with Facebook".

  3. Log in with your Facebook credentials (email and password).

2. Specify the connector configuration

After successfully connecting to facebook through OAuth, fill out the form to specify Facebook connector configuration.

On this page, set:

  • Slice Name: Name of the connector (which also becomes that name of the schema in your warehouse).
  • Warehouses: Select the warehouse to replicate data into.

Finally, hit "Add Connector".

3. Add the Facebook connector

After clicking on "Add Connector" from the previous screen, wait a few minutes for the connector to be added. You should see the following screen now.

Set up connector through the CLI

The steps to create a connector are:

  1. Generate Facebook app ID and access token
  2. Specify the connector configuration
  3. Add the Facebook connector

1. Generate Facebook app ID and access token

Setup requirements

Before getting started please make sure to have the following information:

  • Access to an active Facebook Marketing account

Setup instructions

The Facebook connector requires an application ID, corresponding client secret ID, and access token to collect data. An app ID and client secret ID can be obtained from Facebook through the following steps:

  1. Log in at https://developers.facebook.com/apps
  2. Click "Add New App"
  3. Enter "Datacoral" as the display name and click "Create App ID"
  4. The app ID will appear in the header
  5. Navigate to Settings → "Basic" in the left menu
  6. Under the "App Secret" label, click "Show" to view your client secret

An access token can be obtained from Facebook through the following steps;

  1. Log it at https://business.facebook.com/settings/system-users/
  2. Select a user, or click "+ Add' to create a new system user
  3. Click "Generate New Token" → desired app → "Generate Token"
  4. View your access token in the modal window

2. Specify the connector configuration

To get a template for the Facebook connector configuration save the output of the describe --input-parameters command as follows:

datacoral collect describe --slice-type facebook \
--input-parameters > facebook_parameters_files.json

Example template:

{
"client_id": "test",
"client_secret": "test",
"client_access_token": "test"
}

Modify the facebook_parameters_file file to add the tokens generated from Facebook.

3. Add the Facebook connector

datacoral collect add --slice-type facebook --slice-name <slice-name> --parameters-file <params-file>
  • slice-name Name of your connector. A schema with your slice-name is automatically created in your warehouse
  • params-file File path to your input parameters file. Ex. facebook_parameters_file.json

Supported load units

  • accounts: this loadunit does not store any data, it fetches lists of specific accounts and fans out next loadunit with list of account ids.

  • ad_accounts: this loadunit is used to store information about particular accounts

  • ad_sets: this loadunit is used to store information about a particular account's ad sets

  • ads: this loadunit is used to store information about a particular account's ads and ad creatives

    • this loadunit supports an incremental fetch mode
  • campaigns: this loadunit is used to store information about a particular account's campaigns

  • insights: this loadunit is used to store information about insights for a particular campaign

    • this loadunit supports an incremental fetch mode

Connector output

Output of this connector is stored in S3 and the destination warehouse.

AWS S3 Data stored in AWS S3 is partitions by date and time s3://datacoral-data-bucket/<slice-name>

Destination Warehouse: Schema - schema will be the same as slice-name Tables produced by the connector are:

- schema.accounts
- schema.ad_accounts
- schema.ad_sets
- schema.ads
- schema.campaigns
- schema.insights

Questions? Interested?

If you have questions or feedback, feel free to reach out at hello@datacoral.co or Request a demo.