Facebook Ads link
Updated 7 days ago
Facebook Ads provides a history of the settings of your Ad Account, Campaigns, Ad Sets, Ads, and Ad Creatives. Facebook Ads also fetches Ad Insights data.
See Facebook documentation for more information.
Featureslink
Feature Name | Supported | Notes |
---|---|---|
Capture deletes | check | CAMPAIGN_HISTORY , AD_SET_HISTORY , AD_HISTORY and CREATIVE_HISTORY tables. |
Custom data | check | ACCOUNT_ATTRIBUTION and AD_SET_ATTRIBUTION tables. All fields in these tables are custom fields except primary and foreign keys. |
Data blocking | check | Column level |
Column hashing | check | |
Re-sync | check | Connector and table level. Only fetches reporting data |
History | check | All fields. We capture the delta of changes between syncs. |
API configurable | check | API configuration |
Priority-first sync | ||
Fivetran data models | check | Get the models: source / transform / creative history; Get the ad reporting model; Supports Quickstart data models |
Private networking |
Setup guidelink
Follow our step-by-step Facebook Ads setup guide to connect Facebook Ads with your destination using Fivetran connectors.
Sync overviewlink
You can decide to sync all accounts or sync specific accounts to the destination within the setup form.
NOTE: Selecting "Sync All Accounts" automatically adds and syncs any new accounts.
We retrieve the following tables and their related data, during every update:
- all
AD_ACCOUNTS
ADS
CAMPAIGNS
AD_SETS
AD_CREATIVES
CUSTOM_CONVERSIONS
REPORT
NOTE: In some cases, a sync may be interrupted due to too much data requested, missing permissions, or a temporary outage of an external API service. In such cases, we may use different ways of data fetching. See our Sync Fallback Algorithms.
Rollback synclink
A rollback sync is a sync that automatically runs once a day. Rollback syncs capture the changes that happen outside of the incremental sync time frame.
Rollback syncs for custom and pre-built reports depend on the maximum value between the Click Attribution Window and View Attribution Window settings. By default, we sync data from the last seven days during each sync. If both Click Attribution Window and View Attribution Window are set to DAY_1
, we perform a one-day rollback sync. If you set both to NONE
, we perform a 28-day rollback sync.
Most metadata tables are retrieved from Facebook during every sync except several tables that incrementally sync.
Sync fallback algorithmslink
Skipping fields in metadata tableslink
Fields that require extra permissions or contain too much data may cause metadata sync to fail. In that case, we have to skip querying those specific fields. We display the following notification about this workaround in your dashboard:
The following sections list some of these specific fields:
Business fieldslink
Expand for details
The Account
entity has a group of business fields:
business
business_city
business_country_code
business_name
business_state
business_street
business_street2
business_zip
owner
These business fields require the business_management permission granted to the user. We check if this permission is granted during our setup tests, and if it is not, we display the following warning before your connector starts the next sync:
Funding source details fieldlink
Expand for details
The funding_source_details
field of the Account
requires the MANAGE task permission granted to the user.
If this field is unavailable for current Facebook Ads account, we skip it during syncs. This will be mentioned in logs with following message: "You are not granted the "MANAGE task" permission. We skipped the funding_source_details
field. This is intended behavior and means that the connector is working as expected.".
Other metadata tables fieldslink
Expand for details
The following fields in various metadata tables can cause errors when they are included in API queries:
Table name | Skipped fields |
---|---|
account_history | is_prepay_account , failed_delivery_checks |
ad_history | tracking_specs , recommendations |
ad_set_history | review_feedback , promoted_object , billing_event , targeting |
ad_video_history | is_crossposting_eligible , post_views |
creative_history | asset_feed_spec{link_urls} , body , enable_direct_install , image_hash , image_url , link_og_id , object_store_url , playable_asset_id , thumbnail_url , title , use_page_actor_override |
custom_audience_history | rule , external_event_source , permission_for_actions , data_source , time_content_updated |
We skip the fields listed above when we get one of typical errors from the source API. These errors are common and usually are caused by missing permissions or too much data requested:
Error type | Facebook error code | Description |
---|---|---|
API Unknown | 1 | Unknown error due to downtime |
API Service | 2 | Temporary issue due to downtime |
API Method | 3 | Capability or permissions issue |
Invalid parameter | 100 | Invalid parameter error |
Fetching reports at different levelslink
When we fail to fetch report data, we don't stop the sync process, but try to fetch the data using alternative ways offered by the Facebook API service.
Levels overviewlink
Expand for details
Each report table has three types of specified metrics which are used to group data: Breakdowns
, Action Breakdowns
, and Fields
. Each of these metrics belongs to one of the grouping levels (listed from the highest to the lowest): Account
, Campaign
, Ad Set
, Ad
or None
.
Breakdown | Level |
---|---|
product_id | Ad |
Action Breakdown | Level |
---|---|
action_target_id | Ad |
Field | Level |
---|---|
ad_id | Ad |
ad_name | Ad |
adset_id | Ad Set |
adset_name | Ad Set |
campaign_id | Campaign |
campaign_name | Campaign |
objective | Campaign |
NOTE: All metrics not listed in the above table have the
Account
level.
The lowest level any of the selected metrics has is the overall level of the report.
Example: A custom report table has the following configuration:
All metrics here have the Account
grouping level except for the product_id
breakdown having the Ad
grouping level so the overall report grouping level is Ad
.
Regardless of the overall report level, we are try to fetch all data at the Account
level first:
https://graph.facebook.com/<API_VERSION>/<AD_ACCOUNT_ID>/insights
content_copy
Query failures by levellink
Expand for details
If the query for the Account
level fails for any reason, then we try to fetch data at the next lower level. In the example case, it is the Campaign
level. We fetch all campaign IDs for the current account and fetch reporting data for each campaign:
https://graph.facebook.com/<API_VERSION>/<CAMPAIGN_ID>/insights
content_copy
If the query for the Campaign
level fails for any reason, we try to fetch data at the Ad Set
and Ad
levels in the same way.
The level at which we successfully fetched data does not affect the resulting composed values in the destination. However, the row count may be different.
If queries failed for all levels, then the sync process stops, and we display the following warning in your dashboard:
NOTE: We don't try to fetch data at lower levels for the reports with the highest
Account
and the lowestNone
levels.
This workaround may impact duration of the sync, if the custom report contains too much data. Below are some recommendations to mitigate such an impact:
- Don't add too many metrics to a single report. We recommend splitting a complex report to several simpler ones when possible
- A report with a lower overall level should have fewer number of metrics
- Use metrics with the same level inside a single report
Schema informationlink
This schema applies to all Facebook Ads connectors.
To zoom, open ERD in new window.
Metadata tableslink
The *_HISTORY
tables contain metadata and capture versions of the objects as they are updated. Therefore, these tables only contain records from the date of a connector's creation because Facebook does not retain change history for these resources. Use SORT BY id
and ORDER BY updated_time
to query the *_HISTORY
tables when available.
IMPORTANT: Metadata tables do not contain the full change history of the objects within an account. Almost all selected metadata is retrieved from Facebook during every sync except the tables mentioned below.
Incremental update of metadata tableslink
We incrementally update the following metadata tables:
CAMPAIGN_HISTORY
AD_SET_HISTORY
AD_HISTORY
It means that we store the latest updated_time
for these entities after each sync. During the next sync, we fetch only those entities whose updated_time
value is greater that the cursor value.
IMPORTANT: This behavior is not the same as for reporting tables. Incrementally updated metadata tables can be re-synced on the Schema tab, but the re-sync does not restore the change history of the entity, it just saves the latest version.
Schema noteslink
The *_HISTORY
tables capture versions of the objects as they are updated. This isn't a perfect record of every change, rather, it captures the delta of changes between syncs. To query them, use SORT BY id
and ORDER BY updated_time
.
The bid_info_*
, global_*
, and placement_specific_*
columns in the AD_HISTORY
table can change their names depending on the source data, which is stored in the KEY-VALUE format. For example, depending on the source data, bid_info_*
would have bid_info_KEY
as name, and VALUE
as value. For more information regarding global
and placement_specific
fields, see Facebook documentation.
Report schema informationlink
We support all the fields of the Facebook Marketing API v14.0. See Facebook's documentation for more information.
We provide two types of reports:
- Prebuilt Report
- Custom Report
For either kind of report, we deliver a main table named after the schema name of the connector. The table will contain the fields selected within the setup form.
Secondary tableslink
If you select an action breakdown and field(s), Fivetran creates secondary tables only for fields of list<AdsActionStats>
and list<AdsHistogramStats>
types listed in the Facebook's field documentation.
Secondary tables are named after the main table, with the field name included as a postfix (e.g. <table_name>_cost_per_action_type
). The action breakdowns are columns in the table, and the field value
is the number of actions to occur.
Every primary table and its secondary tables have the _fivetran_id
column whose hashed values are unique for each distinct breakdown combination. It is useful for joining parent and child tables when more than one breakdown is selected. In the following examples, both the parent and child tables have the impression_device
and publisher_platform
breakdowns selected:
Parent table
Child table
NOTE: The action data is hierarchical: a simple sum of all actions will not equal the field
total_actions
. See Actions you can measure in Facebook Ads Reporting for more information.
Aggregation levelslink
Depending on the aggregation you select, we provide the corresponding column (the source field in the Facebook report is date_start
):
date
for Day and Lifetime aggregationweek
for Week aggregationmonth
for Month aggregation
Depending on the breakdowns, action breakdowns and fields you selected while configuring the connector, we query at different levels:
Ad
level: If you select thead_id
and/orad_name
fields, and/orproduct_id
breakdown, and/oraction_target_id
action breakdownAdset
level: If you select theadset_id
and/oradset_name
fieldsCampaign
level: If you select thecampaign_id
and/orcampaign_name
and/orobjective
fieldsAccount
level: If you selected none of the fields listed above
The primary key of the parent table is the composite of the _fivetran_id
column, and the date (date
, week
, or month
, depending on aggregation level) and breakdown columns. The composite key of the child tables also includes the index
column.
NOTE: If you selected fields that correspond to more than one level, we query at the most granular level. For example, if you select both the
ad_id
andadset_id
fields, we query onAd
level.
Conversions and actionslink
Conversions from Facebook are shared between two fields: actions
and conversions
. For conversion values, use action_values
and conversion_values
instead. See Facebook Insight Parameters for definitions of these fields. When creating your report, remember to include the action_type
from the "Action Breakdowns" selection as well as the following fields:
- For conversions:
conversions
andactions
from the "Fields" selection - For conversion values:
conversion_values
andaction_values
from the "Fields" selection. To avoid discrepancies, we recommend using a union of the two resulting child tables (e.g.<table_name>_conversions
and<table_name>_actions
).
If you select an action breakdown and field or fields, Fivetran creates a secondary table or tables. We name secondary tables with the main table name appended with the field names.
We create separate tables for fields of the list<AdsActionStats>
and list<AdsHistogramStats>
types listed in the Facebook's field documentation.
The action breakdowns are columns in the table, and the field value
is the number of actions to occur.
NOTE: The action data is hierarchical: a simple sum of all actions will not equal the field
total_actions
. See Actions you can measure in Facebook Ads Reporting for more information.
Missing datalink
In the request used to query Facebook's Insights API, we specify the report configuration defined during the connector setup. The report returned as a response may not contain all fields you selected. Certain data may be missing due to Facebook API limitations.
NOTE: When Facebook introduced changes related to Apple's iOS 14 updates, some metrics became unavailable with certain breakdowns selected. For example, delivery and action breakdowns are not supported for offsite conversion events. This includes demographic breakdowns such as age, gender, and region. See Apple's iOS 14 changes in Facebook API for more information.
API configuration optionslink
If you configure your Facebook Ads connectors using our REST API, you will need to provide specific values for some parameters.
See our REST API documentation for more information about using the Fivetran REST API to configure Facebook Ads.
Expand for details
fieldslink
- account_currency
- account_id
- account_name
- action_values
- actions
- ad_id
- ad_name
- adset_id
- adset_name
- attribution_setting
- buying_type
- campaign_id
- campaign_name
- canvas_avg_view_percent
- canvas_avg_view_time
- catalog_segment_value
- clicks
- conversion_rate_ranking
- conversion_values
- conversions
- cost_per_10_sec_video_view
- cost_per_action_type
- cost_per_conversion
- cost_per_estimated_ad_recallers
- cost_per_inline_link_click
- cost_per_inline_post_engagement
- cost_per_outbound_click
- cost_per_thruplay
- cost_per_unique_action_type
- cost_per_unique_click
- cost_per_unique_inline_link_click
- cost_per_unique_outbound_click
- cpc
- cpm
- cpp
- ctr
- engagement_rate_ranking
- estimated_ad_recall_rate
- estimated_ad_recallers
- frequency
- full_view_impressions
- full_view_reach
- gender_targeting
- impressions
- inline_link_click_ctr
- inline_link_clicks
- inline_post_engagement
- instant_experience_clicks_to_open
- instant_experience_clicks_to_start
- instant_experience_outbound_clicks
- labels
- location
- mobile_app_purchase_roas
- objective
- outbound_clicks
- outbound_clicks_ctr
- purchase_roas
- quality_ranking
- reach
- relevance_score
- social_spend
- spend
- unique_actions
- unique_clicks
- unique_ctr
- unique_inline_link_click_ctr
- unique_inline_link_clicks
- unique_link_clicks_ctr
- unique_outbound_clicks
- unique_outbound_clicks_ctr
- video_10_sec_watched_actions
- video_30_sec_watched_actions
- video_avg_percent_watched_actions
- video_avg_time_watched_actions
- video_p100_watched_actions
- video_p25_watched_actions
- video_p50_watched_actions
- video_p75_watched_actions
- video_p95_watched_actions
- video_play_actions
- video_play_curve_actions
- video_thruplay_watched_actions
- website_ctr
- website_purchase_roas
breakdownslink
- ad_format_asset
- age
- app_id
- body_asset
- call_to_action_asset
- country
- description_asset
- dma
- gender
- frequency_value
- hourly_stats_aggregated_by_advertiser_time_zone
- hourly_stats_aggregated_by_audience_time_zone
- image_asset
- impression_device
- link_url_asset
- place_page_id
- device_platform
- product_id
- publisher_platform
- platform_position
- region
- skan_conversion_id
- title_asset
- video_asset;
action_breakdownslink
- action_carousel_card_id
- action_carousel_card_name
- action_canvas_component_name
- action_destination
- action_device
- action_reaction
- action_target_id
- action_type
- action_video_sound
- action_video_type;
sync_modelink
- AllAccounts
- SpecificAccounts
aggregationlink
- Day
- Week
- Month
config_typelink
- Prebuilt
- Custom
prebuilt_reportlink
- ACTION_CANVAS_COMPONENT
- ACTION_CAROUSEL_CARD
- ACTION_CONVERSION_DEVICE
- ACTION_PRODUCT_ID
- ACTION_REACTIONS
- ACTION_VIDEO_SOUND
- ACTION_VIDEO_VIEW_TYPE
- BASIC_AD
- BASIC_AD_SET
- BASIC_ALL_LEVELS
- BASIC_CAMPAIGN
- DELIVERY_PLATFORM
- DELIVERY_PLATFORM_AND_DEVICE
- DELIVERY_PURCHASE_ROAS
- DEMOGRAPHICS_AGE
- DEMOGRAPHICS_AGE_AND_GENDER
- DEMOGRAPHICS_COUNTRY
- DEMOGRAPHICS_DMA_REGION
- DEMOGRAPHICS_GENDER
- DEMOGRAPHICS_REGION
action_report_timelink
- impression
- conversion
- mixed
click_attribution_windowlink
- NONE
- DAY_1
- DAY_7
view_attribution_windowlink
- NONE
- DAY_1
- DAY_7
Combinations of Breakdownslink
Generic breakdownlink
Expand for details
Breakdowns are estimated metrics. They are used to group data. You can select any of these breakdowns while creating your connector.
age
app_id
country
dma
gender
frequency_value
reach
impression_device
place_page_id
publisher_platform
platform_position
device_platform
product_id
region
ad_format_asset
body_asset
call_to_action_asset
description_asset
image_asset
link_url_asset
skan_conversion_id
title_asset
video_asset
Restrictionslink
reach
andfrequency_value
breakdowns are related and must be selected together.The following fields cannot be grouped so they can't be requested if you are specifying a breakdown:
app_store_clicks
newsfeed_avg_position
newsfeed_clicks
relevance_score
newsfeed_impressions
NOTE: When Facebook introduced changes related to Apple's iOS 14 updates, some metrics became unavailable with certain breakdowns selected. For example, delivery and action breakdowns are not supported for offsite conversion events. This includes demographic breakdowns such as age, gender, and region. See Apple's iOS 14 changes in Facebook API for more information.
Hourly breakdownslink
Expand for details
hourly_stats_aggregated_by_advertiser_time_zone
hourly_stats_aggregated_by_audience_time_zone
Restrictionslink
video_*
fields cannot be requested with any hourly breakdowns.- Hourly breakdowns do not support unique fields, which are any fields prepended with
unique_*
,reach
orfrequency
. reach
andfrequency
fields will return 0 when hourly breakdowns are in use.
Action breakdownslink
Expand for details
Action breakdowns group results in action fields.
IMPORTANT: Permutations marked with an asterisk (*) can be joined with
action_type
,action_target_id
andaction_destination
which is the name foraction_target_id
.
action_canvas_component_name
action_destination
action_device
action_reaction
action_target_id
action_type
action_video_sound
action_video_type
Restrictionslink
You can't select the following fields along with the action_device
breakdown:
instant_experience_clicks_to_open
instant_experience_clicks_to_start
instant_experience_outbound_clicks
Combined breakdownslink
Expand for details
action_type
*action_target_id
*action_device
*action_device
,impression_device
*action_device
,publisher_platform
*action_device
,publisher_platform
,impression_device
*action_device
,publisher_platform
,platform_position
*action_device
,publisher_platform
,platform_position
,impression_device
*action_reaction
action_type, action_reaction
age
*gender
*age
,gender
*app_id
,skan_conversion_id
country
*region
*frequency_value
,reach
publisher_platform
*publisher_platform
,impression_device
*publisher_platform
,platform_position
*publisher_platform
,platform_position
,impression_device
*product_id
*hourly_stats_aggregated_by_advertiser_time_zone
*hourly_stats_aggregated_by_audience_time_zone
*
Ads action statisticslink
We create a separate table for each field of the AdsActionStats list type. These fields are listed in Facebook's documentation.
Expand for details
The created child tables contain the following main fields:
- action_type - The type of action taken on your ad, Page, app, or event after your ad was displayed to the user, even if they didn't click on it. Action types include Page likes, app installs, conversions, event responses, etc.
- value - The conversion metric value for the default attribution window (
7d_click
and1d_view
) - 1_d_click - The conversion metric value for the "1 day after clicking the ad" attribution window
- 7_d_click - The conversion metric value for the "7 days after clicking the ad" attribution window
- 1_d_view - The conversion metric value for the "1 day after viewing the ad" attribution window
- 7_d_view - The conversion metric value for the "7 days after viewing the ad" attribution window
- inline - The conversion metric value for the default attribution window that corresponds to all conversions that occur on the ad, like 'link_click', 'video_view'
Attribution Windowslink
Facebook uses the 7d_click
and 1d_view
attribution windows by default. You can change each value to 1d_click
and 7d_view
in the setup form, respectively.
In the setup form, you also can toggle the Use unified attribution setting option, which is enabled by default. When this option is enabled, your ads results are calculated using the unified attribution settings, which are defined at the ad set level. This means using a single time period to attribute conversions to ads and to optimize the campaign. However, in this case, conversion metric values across different attribution settings cannot be aggregated.
Conversionslink
Depending on the type of your conversion, Facebook maps the values into the following AdsActionStats fields:
- actions
- action_values
- conversions
- conversion_values
In order to get the complete conversion information using the Facebook Insights API, you need to:
- Include all the fields listed above in the report.
- Combine them downstream of your destination using the JOIN operator or other methods.
Rate limit troubleshootinglink
If you are experiencing rate limit issues, we recommend that you try the following:
- Check that no other process is running in parallel with the same credentials.
- Increase the number of active ads, since rate limits depend on that number.
- Reduce the number of synced accounts.
- Switch off the metadata sync.
- When possible, use user access instead of system tokens.
Learn more in Facebook's Graph API Rate Limits documentation.