JSData & Media Start a project

← All connectors

Schema · Entity relationship diagram

Meta Ads tables and relationships

Facebook and Instagram campaigns, ad sets, ads, creatives and daily ad performance with conversions.

Beta8 tables · 14 relationships
ConnectApprove an access request
Default schemameta_ads
DestinationsAmazon Redshift, Google BigQuery, Snowflake, PostgreSQL, Amazon S3
  • Tables mirror the Marketing API objects (ad account, campaigns, ad sets, ads, ad creatives): one row per object with its latest settings; updated_time says when it last changed.
  • ad_insights_daily is the ad-level Insights report, one row per ad per day (date_start) in the ad account's timezone. The last 28 days are re-pulled on every sync while Meta's attribution settles.
  • ad_insights_actions_daily and ad_insights_action_values_daily split the Insights actions and action_values lists into one row per action_type (purchase, add_to_cart, link_click ...), with the 1-day view, 1-day click and 7-day click windows as columns.
campaigns.account_id → ad_accounts.account_idad_sets.campaign_id → campaigns.idad_sets.account_id → ad_accounts.account_idads.adset_id → ad_sets.idads.campaign_id → campaigns.idads.account_id → ad_accounts.account_idad_creatives.account_id → ad_accounts.account_idad_insights_daily.ad_id → ads.idad_insights_daily.adset_id → ad_sets.idad_insights_daily.campaign_id → campaigns.idad_insights_daily.account_id → ad_accounts.account_idads.creative_id → ad_creatives.idad_insights_actions_daily.ad_id,date_start → ad_insights_daily.ad_id,date_startad_insights_action_values_daily.ad_id,date_start → ad_insights_daily.ad_id,date_startad_creatives — One row per ad creative (GET act_<id>/adcreatives).ad_creatives16id BIGINT · primary keyidbigintaccount_id BIGINT · → ad_accounts.account_idaccount_idbigintname VARCHAR(1024)namevarcharstatus VARCHAR(32)statusvarcharobject_type VARCHAR(64)object_typevarchartitle VARCHAR(1024)titlevarcharbody VARCHAR(8192)bodyvarcharcall_to_action_type VARCHAR(64)call_to_action_typevarcharlink_url VARCHAR(2048)link_urlvarcharurl_tags VARCHAR(2048)url_tagsvarcharimage_url VARCHAR(2048)image_urlvarcharthumbnail_url VARCHAR(2048)thumbnail_urlvarcharvideo_id BIGINTvideo_idbiginteffective_object_story_id VARCHAR(128)effective_object_story_idvarcharinstagram_permalink_url VARCHAR(1024)instagram_permalink_urlvarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestampad_accounts — One row per ad account (GET act_<id>).ad_accounts12account_id BIGINT · primary keyaccount_idbigintname VARCHAR(512)namevarcharaccount_status VARCHAR(32)account_statusvarcharcurrency VARCHAR(8)currencyvarchartimezone_name VARCHAR(64)timezone_namevarchartimezone_offset_hours_utc DECIMAL(6,2)timezone_offset_hours_utcdecimalbusiness_name VARCHAR(512)business_namevarcharbusiness_country_code VARCHAR(8)business_country_codevarcharamount_spent BIGINTamount_spentbigintspend_cap BIGINTspend_capbigintcreated_time TIMESTAMPcreated_timetimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampad_insights_action_values_daily — Insights `action_values` per ad, day and action_type (conversion value, account currency).ad_insights_action_values_daily9ad_id BIGINT · primary key · → ad_insights_daily.ad_id,date_startad_idbigintdate_start DATE · primary key · → ad_insights_daily.ad_id,date_startdate_startdateaction_type VARCHAR(256) · primary keyaction_typevarcharvalue DECIMAL(24,6)valuedecimalvalue_1d_view DECIMAL(24,6)value_1d_viewdecimalvalue_1d_click DECIMAL(24,6)value_1d_clickdecimalvalue_7d_click DECIMAL(24,6)value_7d_clickdecimal_jsdata_key VARCHAR(64)_jsdata_keyvarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestampads — One row per ad (GET act_<id>/ads), latest settings.ads13id BIGINT · primary keyidbigintadset_id BIGINT · → ad_sets.idadset_idbigintcampaign_id BIGINT · → campaigns.idcampaign_idbigintaccount_id BIGINT · → ad_accounts.account_idaccount_idbigintcreative_id BIGINT · → ad_creatives.idcreative_idbigintname VARCHAR(1024)namevarcharstatus VARCHAR(32)statusvarchareffective_status VARCHAR(32)effective_statusvarcharconfigured_status VARCHAR(32)configured_statusvarcharpreview_shareable_link VARCHAR(1024)preview_shareable_linkvarcharcreated_time TIMESTAMPcreated_timetimestampupdated_time TIMESTAMPupdated_timetimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampad_sets — One row per ad set (GET act_<id>/adsets), latest settings.ad_sets25id BIGINT · primary keyidbigintcampaign_id BIGINT · → campaigns.idcampaign_idbigintaccount_id BIGINT · → ad_accounts.account_idaccount_idbigintname VARCHAR(1024)namevarcharstatus VARCHAR(32)statusvarchareffective_status VARCHAR(32)effective_statusvarcharconfigured_status VARCHAR(32)configured_statusvarcharoptimization_goal VARCHAR(64)optimization_goalvarcharbilling_event VARCHAR(64)billing_eventvarcharbid_strategy VARCHAR(64)bid_strategyvarcharbid_amount BIGINTbid_amountbigintdaily_budget BIGINTdaily_budgetbigintlifetime_budget BIGINTlifetime_budgetbigintbudget_remaining BIGINTbudget_remainingbigintdestination_type VARCHAR(64)destination_typevarcharpromoted_object_pixel_id BIGINTpromoted_object_pixel_idbigintpromoted_object_custom_event_type VARCHAR(64)promoted_object_custom_event_typevarchartargeting_age_min BIGINTtargeting_age_minbiginttargeting_age_max BIGINTtargeting_age_maxbiginttargeting_geo_locations_countries VARCHAR(2048)targeting_geo_locations_countriesvarcharstart_time TIMESTAMPstart_timetimestampend_time TIMESTAMPend_timetimestampcreated_time TIMESTAMPcreated_timetimestampupdated_time TIMESTAMPupdated_timetimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampad_insights_daily — Insights, level=ad, one row per ad per day (date_start, the ad account's timezone).ad_insights_daily20ad_id BIGINT · primary key · → ads.idad_idbigintdate_start DATE · primary keydate_startdateadset_id BIGINT · → ad_sets.idadset_idbigintcampaign_id BIGINT · → campaigns.idcampaign_idbigintaccount_id BIGINT · → ad_accounts.account_idaccount_idbigintad_name VARCHAR(1024)ad_namevarcharadset_name VARCHAR(1024)adset_namevarcharcampaign_name VARCHAR(1024)campaign_namevarcharaccount_currency VARCHAR(8)account_currencyvarcharimpressions BIGINTimpressionsbigintreach BIGINTreachbigintfrequency DECIMAL(18,6)frequencydecimalclicks BIGINTclicksbigintinline_link_clicks BIGINTinline_link_clicksbigintspend DECIMAL(18,4)spenddecimalcpm DECIMAL(18,6)cpmdecimalcpc DECIMAL(18,6)cpcdecimalctr DECIMAL(18,6)ctrdecimal_jsdata_key VARCHAR(64)_jsdata_keyvarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestampcampaigns — One row per campaign (GET act_<id>/campaigns), latest settings.campaigns19id BIGINT · primary keyidbigintaccount_id BIGINT · → ad_accounts.account_idaccount_idbigintname VARCHAR(1024)namevarcharobjective VARCHAR(64)objectivevarcharstatus VARCHAR(32)statusvarchareffective_status VARCHAR(32)effective_statusvarcharconfigured_status VARCHAR(32)configured_statusvarcharbuying_type VARCHAR(32)buying_typevarcharbid_strategy VARCHAR(64)bid_strategyvarchardaily_budget BIGINTdaily_budgetbigintlifetime_budget BIGINTlifetime_budgetbigintbudget_remaining DECIMAL(18,2)budget_remainingdecimalspend_cap BIGINTspend_capbigintspecial_ad_categories VARCHAR(256)special_ad_categoriesvarcharstart_time TIMESTAMPstart_timetimestampstop_time TIMESTAMPstop_timetimestampcreated_time TIMESTAMPcreated_timetimestampupdated_time TIMESTAMPupdated_timetimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampad_insights_actions_daily — Insights `actions` per ad, day and action_type (counts). value = default attribution setting; value_1d_view / value_1d_click / value_7d_click = action_attribution_windows.ad_insights_actions_daily9ad_id BIGINT · primary key · → ad_insights_daily.ad_id,date_startad_idbigintdate_start DATE · primary key · → ad_insights_daily.ad_id,date_startdate_startdateaction_type VARCHAR(256) · primary keyaction_typevarcharvalue DECIMAL(24,6)valuedecimalvalue_1d_view DECIMAL(24,6)value_1d_viewdecimalvalue_1d_click DECIMAL(24,6)value_1d_clickdecimalvalue_7d_click DECIMAL(24,6)value_7d_clickdecimal_jsdata_key VARCHAR(64)_jsdata_keyvarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestamp
Primary keyForeign keyReferencesJoins on (not a key)

Drag to pan, scroll or pinch to zoom, click a table to see what it joins to.

Table reference

8 tables · click a table for its columns
ad_accounts12 columns · Account & ad structureshow in diagram

One row per ad account (GET act_<id>).

Primary key: account_id

ColumnTypeKeyDescription
account_idPrimary key.bigintPK Primary key.
namevarchar(512)
account_statusvarchar(32)
currencyvarchar(8)
timezone_namevarchar(64)
timezone_offset_hours_utcdecimal(6,2)
business_namevarchar(512)
business_country_codevarchar(8)
amount_spentbigint
spend_capbigint
created_timetimestamp
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
campaigns19 columns · Account & ad structureshow in diagram

One row per campaign (GET act_<id>/campaigns), latest settings.

Primary key: id

ColumnTypeKeyDescription
idPrimary key.bigintPK Primary key.
account_idReferences ad_accounts.account_id.bigintFKReferences ad_accounts.account_id.
namevarchar(1024)
objectivevarchar(64)
statusvarchar(32)
effective_statusvarchar(32)
configured_statusvarchar(32)
buying_typevarchar(32)
bid_strategyvarchar(64)
daily_budgetMinor units of the account currency (cents for USD), as the API returns it.bigintMinor units of the account currency (cents for USD), as the API returns it.
lifetime_budgetbigint
budget_remainingdecimal(18,2)
spend_capbigint
special_ad_categoriesvarchar(256)
start_timetimestamp
stop_timetimestamp
created_timetimestamp
updated_timetimestamp
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
ad_sets25 columns · Account & ad structureshow in diagram

One row per ad set (GET act_<id>/adsets), latest settings.

Primary key: id

ColumnTypeKeyDescription
idPrimary key.bigintPK Primary key.
campaign_idReferences campaigns.id.bigintFKReferences campaigns.id.
account_idReferences ad_accounts.account_id.bigintFKReferences ad_accounts.account_id.
namevarchar(1024)
statusvarchar(32)
effective_statusvarchar(32)
configured_statusvarchar(32)
optimization_goalvarchar(64)
billing_eventvarchar(64)
bid_strategyvarchar(64)
bid_amountbigint
daily_budgetbigint
lifetime_budgetbigint
budget_remainingbigint
destination_typevarchar(64)
promoted_object_pixel_idbigint
promoted_object_custom_event_typevarchar(64)
targeting_age_minbigint
targeting_age_maxbigint
targeting_geo_locations_countriesvarchar(2048)
start_timetimestamp
end_timetimestamp
created_timetimestamp
updated_timetimestamp
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
ads13 columns · Account & ad structureshow in diagram

One row per ad (GET act_<id>/ads), latest settings.

Primary key: id

ColumnTypeKeyDescription
idPrimary key.bigintPK Primary key.
adset_idReferences ad_sets.id.bigintFKReferences ad_sets.id.
campaign_idReferences campaigns.id.bigintFKReferences campaigns.id.
account_idReferences ad_accounts.account_id.bigintFKReferences ad_accounts.account_id.
creative_idReferences ad_creatives.id.bigintFKReferences ad_creatives.id.
namevarchar(1024)
statusvarchar(32)
effective_statusvarchar(32)
configured_statusvarchar(32)
preview_shareable_linkvarchar(1024)
created_timetimestamp
updated_timetimestamp
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
ad_creatives16 columns · Account & ad structureshow in diagram

One row per ad creative (GET act_<id>/adcreatives).

Primary key: id

ColumnTypeKeyDescription
idPrimary key.bigintPK Primary key.
account_idReferences ad_accounts.account_id.bigintFKReferences ad_accounts.account_id.
namevarchar(1024)
statusvarchar(32)
object_typevarchar(64)
titlevarchar(1024)
bodyvarchar(8192)
call_to_action_typevarchar(64)
link_urlvarchar(2048)
url_tagsvarchar(2048)
image_urlvarchar(2048)
thumbnail_urlvarchar(2048)
video_idbigint
effective_object_story_idvarchar(128)
instagram_permalink_urlvarchar(1024)
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
ad_insights_daily20 columns · Daily insightsshow in diagram

Insights, level=ad, one row per ad per day (date_start, the ad account's timezone).

Primary key: ad_id, date_start

ColumnTypeKeyDescription
ad_idPrimary key (with date_start). References ads.id.bigintPK FKPrimary key (with date_start). References ads.id.
date_startPrimary key (with ad_id).datePK Primary key (with ad_id).
adset_idReferences ad_sets.id.bigintFKReferences ad_sets.id.
campaign_idReferences campaigns.id.bigintFKReferences campaigns.id.
account_idReferences ad_accounts.account_id.bigintFKReferences ad_accounts.account_id.
ad_namevarchar(1024)
adset_namevarchar(1024)
campaign_namevarchar(1024)
account_currencyvarchar(8)
impressionsbigint
reachbigint
frequencydecimal(18,6)
clicksbigint
inline_link_clicksbigint
spenddecimal(18,4)
cpmdecimal(18,6)
cpcdecimal(18,6)
ctrdecimal(18,6)
_jsdata_keyUpsert key: md5 of the natural key. Upsert key: md5 of ad_id | date_start.varchar(64)Upsert key: md5 of the natural key. Upsert key: md5 of ad_id | date_start.
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
ad_insights_actions_daily9 columns · Daily insightsshow in diagram

Insights `actions` per ad, day and action_type (counts). value = default attribution setting; value_1d_view / value_1d_click / value_7d_click = action_attribution_windows.

Primary key: ad_id, date_start, action_type

ColumnTypeKeyDescription
ad_idPrimary key (with date_start, action_type). References ad_insights_daily.ad_id,date_start.bigintPK FKPrimary key (with date_start, action_type). References ad_insights_daily.ad_id,date_start.
date_startPrimary key (with ad_id, action_type). References ad_insights_daily.ad_id,date_start.datePK FKPrimary key (with ad_id, action_type). References ad_insights_daily.ad_id,date_start.
action_typePrimary key (with ad_id, date_start).varchar(256)PK Primary key (with ad_id, date_start).
valueCount under the ad set's attribution setting.decimal(24,6)Count under the ad set's attribution setting.
value_1d_viewCount attributed within 1 day of an impression without a click.decimal(24,6)Count attributed within 1 day of an impression without a click.
value_1d_clickdecimal(24,6)
value_7d_clickCount attributed within 7 days of a click.decimal(24,6)Count attributed within 7 days of a click.
_jsdata_keyUpsert key: md5 of the natural key.varchar(64)Upsert key: md5 of the natural key.
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
ad_insights_action_values_daily9 columns · Daily insightsshow in diagram

Insights `action_values` per ad, day and action_type (conversion value, account currency).

Primary key: ad_id, date_start, action_type

ColumnTypeKeyDescription
ad_idPrimary key (with date_start, action_type). References ad_insights_daily.ad_id,date_start.bigintPK FKPrimary key (with date_start, action_type). References ad_insights_daily.ad_id,date_start.
date_startPrimary key (with ad_id, action_type). References ad_insights_daily.ad_id,date_start.datePK FKPrimary key (with ad_id, action_type). References ad_insights_daily.ad_id,date_start.
action_typePrimary key (with ad_id, date_start).varchar(256)PK Primary key (with ad_id, date_start).
valueConversion value (account currency) under the ad set's attribution setting.decimal(24,6)Conversion value (account currency) under the ad set's attribution setting.
value_1d_viewdecimal(24,6)
value_1d_clickdecimal(24,6)
value_7d_clickdecimal(24,6)
_jsdata_keyUpsert key: md5 of the natural key.varchar(64)Upsert key: md5 of the natural key.
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.

Connect Meta Ads All connectors