Facebook Ads

Facebook Ads

This document provides instructions for collecting Facebook Ads data into Panoply. The following items will be covered:

Collection

To access Facebook Ads data, users require access to the Ad Accounts and the permissions of Developer or greater. The data any user has access to in Panoply is controlled by the permissions they have in Facebook.

To configure this data source and collect Facebook Ads data:

  1. From the Data Sources menu, click Add Data Source.
  2. Search for Facebook Ads, then select it to continue to the next step.
  3. On the General tab:
    • Click on the Login button and follow the dialog to connect your Facebook with Panoply.
    • Choose which Ad Account to use. Click on the arrows on the bottom right for additional Ad Accounts available.
    • Choose from the Data Available. See the Data Dictionary for more information.

In order to see the Ad Creatives, users need to choose Ads or Ad Sets from the Data Availavle list

4. (Optional) Set the Advanced Settings. We do not recommend changing advanced settings unless you are an experienced Panoply user.

  • Historical Range: Choose the historical range for your first collection. Options are the last 30, 90, 365 and 730 days. The default is the last 365 days.
  • Delivery Breakdown: The delivery breakdown allows you to choose a method of categorization for your data. For example, if you select Age, your results will be returned based on age ranges. Learn more.
    • Facebook limits which values can be selected when choosing both an Action and a Delivery breakdown. Learn more.
  • Action Breakdown: The action breakdown allows you to categorize data by actions taken as a result of your ad. For example, if you are running a campaign with a Carousel ad, you can select Carousel Card to show how many clicks each card received. Learn more.
    • Facebook limits which values can be selected when choosing both an Action and a Delivery breakdown. Learn more.*
  • Click Window: This is the length of time after a person clicked your ad that will give that ad credit for subsequent actions. By default, Facebook uses an attribution window of 1-day view and 28-day click. This means your reporting table will show these actions if they happened within 1 day of someone seeing your ad or within 28 days of someone clicking on your ad. Learn More
  • View Window: This is the length of time after a person viewed your ad that will give that ad credit for subsequent actions. By default, Facebook uses an attribution window of 1-day view and 28-day click. This means your reporting table will show these actions if they happened within 1 day of someone seeing your ad or within 28 days of someone clicking on your ad. Learn More.
  • Destination Prefix: The Destination Prefix determines the name of the tables created. Panoply automatically uses facebook_ads as the destination prefix, then adds the name of the resource, such as facebook_ads_<resource>. To change the prefix for these tables, enter your preferred prefix. If you enter my_fb_ads for example, the resulting table would be my_fb_ads_<resource> such as my_fb_ads_insights or my_fb_ads_campaigns.
    • For nested data, child tables will be created with the prefix facebook_ads_<resource>>_<child>. 5. Click Save Changes and then click Collect.
  • The data source appears grayed out while the collection runs.
  • You may add additional data sources while this collection runs.
  • You can monitor this collection from the Jobs page or the Data Sources page.
  • After a successful collection, navigate to the Tables page to review the data results.

Data Dictionary

The resources available in the Facebook Ads data source include Ad Insights, Ad Accounts, Ad Sets, Ad Creatives, Ads, and Campaigns. For additional information, see the Facebook Ads Marketing API documentation.

Data Available: When configuring the Facebook Ads, one of the mandatory fields is called Data Available. You will be required to choose from this list.

  • Ad Accounts
  • Ad Sets
  • Ads
  • Campaigns
  • Insights

Primary Key:

  • For the Ad Accounts, Ad Sets, Ads, and Campaigns, the primary key is the Facebook supplied id field.
  • For the Ad Insights endpoint, Panoply creates the primary key based on the following pattern: <account_id>_<ad_id>_<adset_id>_<campaign_id>_<date_start>_<date_stop> _<__action_attribution_windows>_<__delivery>_<__breakdowns>_<__action>

Incremental Key: On your first collection, Panoply imports data based on the Historical Range you select when configuring this source. For subsequent collections, Panoply uses the following logic:

  • Ad Insights: Uses the date of the last successful collection, minus 30 calendar days.
  • Ad Accounts: There is no date field in this data, so Panoply will always pull all of the data of all available Ad Accounts, no matter which accounts were selected.
  • Ad Sets: Uses the date of the last successful collection, minus 2 calendar days.
  • Ads: Uses the date of the last successful collection, minus 2 calendar days.
  • Campaigns: Uses the date of the last successful collection, minus 2 calendar days.

Metadata

Panoply includes these metadata columns in the Ad Insights table:

  • __action_attribution_windows: Formatted as a combination of the payload values of the Click Attribution and View Attribution. Comma separated.
  • __delivery: The payload value of Delivery Breakdown.
  • __action: The payload value of Action Breakdown.
  • __breakdowns: The value from the API’s returned data of the fields assigned to the Delivery. Underscore delimited.
  • __id: The generated primary key for the Insight data based from the ID pattern.
  • __resource: INSIGHTS
  • __aggregation: DAY
  • __senttime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z
  • __updatetime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z

Panoply includes these metadata columns in the Ad Accounts table:

  • __senttime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __updatetime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __resource: AD_ACCOUNTS

Panoply includes these metadata columns in the Ad Sets table:

  • __senttime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __updatetime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __resource: ADSETS
  • __ad_creative_id:

    • Sub-table of facebook_adsets
    • This is generated because the original id field will be overwritten.

Panoply includes these metadata columns in the Ads table:

  • __senttime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __updatetime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __resource: ADS
  • __creative_id:

  • __ad_creative_id:

    • Sub-table of facebook_ads_ads
    • This is generated because the original id field will be overwritten.

Panoply includes these metadata columns in the Campaigns table:

  • __senttime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __updatetime: Formatted as a datetime, such as 2020-04-26T01:26:14.695Z.
  • __resource: CAMPAIGNS

Collected Tables

These tables include the data contained in each endpoint. These are parent tables, there may also be tables created by Panoply out of any nested data.

Note: Fields for each table are dynamic depending on the data returned by Facebook. Facebook only returns fields that is in the logged in user’s account. It is possible that there are fields listed here that might not be available for the user or fields not listed here but available to the user.

Ad Insights

Ad Accounts

Ad Sets

Ads

Campaigns

Sample SQL Queries

Finished collecting data? Here are some sample SQL queries to get you started. You can copy these queries and run them in the Workbench in the Panoply platform and also save them as views there. These queries can also be used with an External workbench or in your BI tool.

Sample queries for more source can be seen here

Facebook Ads - Last 7 VS Previous 7

This query compares the sessions of the last 7 days to the previous 7 days aggregated by campaign_name. This query demonstrates the use of a concept that can be used with any dimension and metric\s, comparing different values of the metric based on different values of time or a given dimension.

Facebook Ads - Monthly Breakdown

This query sums the total cost, clicks and impressions by month and year from facebook-ads_insights.

Getting started is easy! Get all your data in one place in minutes.
Try Free