Use Facebook Ads as a data source


Data Source Type Facebook
Authentication OAuthToken Authentication
Sample Query
API Documentation Facebook Marketing API documentation


Creating a data source using Facebook Ads

To create a data source using Facebook Ads, you need to accomplish 3 tasks:

  • Start the data source creation process.
  • Authenticate with Facebook Ads.
  • Write a query and enter it in Klipfolio.

Step 1: Start the data source creation process

To create a data source using Facebook Ads, go to the Connector Gallery page in Klipfolio and select Facebook Ads.

Step 2: Authenticate with Facebook Ads

  1. Choose your current Facebook token from the dropdown list, or create a new token by clicking Connect new account.
  2. If prompted, enter your username and password and click Log in.
  3. Save your OAuth Credentials.

Step 3: Write the query and enter it in Klipfolio

Refer to the Facebook Marketing API Documentation as you are writing a query. There are many query options available in the Facebook Ads API documentation; here are sample queries to get you started:

Daily Metrics<your_account_id>/insights

Facebook Ads Metrics over the past 7 days<your_account_id>/insights?level=ad&fields=ad_name,adset_name,campaign_name,spend,unique_clicks,cost_per_unique_click,cpm,ctr&sort=spend_descending&date_preset=last_7_days


Specify a date range

To specify a date range for your Facebook Ads query, you can select either a preset date range, for example,


or a specific time range using the following parameters:


Find your Facebook Ads Account ID

Your Facebook Ads account ID must be included in your query. There are two places where you can find your Facebook Ads Account ID.

  • Navigate to your Facebook Business Manager page. Your Account ID is located on the homepage, under the Ad section. Copy the number after Account ID.


  • Navigate to your Facebook Ads Manager page. In the URL, copy the number after account_id=

Add new Facebook Ads users

To retrieve data from Facebook ads, you will need access to your company's Facebook Ads account. If you do not have access, follow these steps to add a new user:

  1. In the Facebook Ads manager page, on the left side menu, select Settings.
  2. On the Settings page, scroll down to Ad Account Roles.
  3. Click Add a person.
  4. You have added a new user to your Facebook Ads account.

Facebook Pixel

Facebook Ads is introducing Facebook Pixel for tracking conversions. To connect, make sure you have Facebook Pixel set up in your Facebook Ads account and that you have access to Facebook Pixel data.

Learn More