meta_ads
The Meta Ads source reads every ad account an access token can reach, along
with its campaigns, ad sets, ads, creatives, assets, audiences, conversions,
change history, and daily performance insights. It uses an
HTTP manifest and
targets Marketing API version v27.0. The connector is in preview. It follows
Meta’s API docs but has not been tested against a live ad account.
Configuration
Create a Meta app with the Marketing API product. Then create a system user in
Business settings under
System Users, assign it your ad accounts, and generate a token for your app
with
ads_read.
System user tokens
can be generated to never expire or to expire after 60 days, and some businesses
must use the expiring kind. Check the token’s expiration when you generate it,
and renew an expiring token before it lapses or scheduled runs start failing. A
long-lived user token also lasts about 60 days and must then be replaced. Reading ad accounts that belong to
other people needs advanced access to ads_read. See
Authorization.
Leave Require App Secret off in the app’s advanced settings. The connector
does not sign requests with appsecret_proof, so Meta rejects every call when
that setting is on.
Connection testing lists the ad accounts with GET /v27.0/me/adaccounts. Every
read starts from that list, so the connector reads each ad account the token can
access. To read fewer accounts, assign the system user only those accounts. An
error from any one ad account fails the whole resource for that run, so remove
accounts the token can list but no longer read.
insights_date_preset takes any of Meta’s
date_preset values,
such as last_7d, last_28d, last_90d, this_month, or maximum. Meta
caps maximum at 37 months. hourly_insights_date_preset offers the same
presets up to this_year and leaves out last_year, maximum, and
data_maximum, because Meta returns no hourly data for a range that starts more
than 13 months ago.
Resources
{ad_account} is the act_ ID that GET /v27.0/me/adaccounts returns. That
list is read on every run and never written. Every other resource except
ad_accounts makes its requests once per ad account.
ad_accounts, campaigns, ad_sets, ads, ad_creatives, and the account,
campaign, ad set, and ad insights are selected by default. The other resources
are optional.
Objects and assets
Each request names the fields it reads with thefields parameter. Nested
objects such as targeting, bid settings, promoted objects, story specs, and
action lists are kept as JSON columns. The connector does not read
signed media URLs such as creative thumbnails, image download URLs, or video
sources, because Meta’s signed URLs expire. permalink_url, image_hash, and
video_id identify the assets instead. Ad account billing fields that Meta
gates behind the MANAGE task, such as funding source details, are not read.
Money keeps the values Meta returns, without currency conversion, and the unit
depends on the field. Meta documents budgets, bids, and spend caps in the
currency’s smallest unit, such as cents for USD and yen for JPY. That covers
daily_budget, lifetime_budget, budget_remaining, the ad set spend targets
and caps, bid_amount, and spend_cap. Meta reports the ad account’s
amount_spent and balance against spend_cap but does not state their unit,
and they are commonly read in the same smallest unit. Insights spend and cost
metrics are decimal amounts in the account currency, such as 12.34 for
$12.34.
Campaigns, ad sets, and ads include archived objects through an
effective_status filter. Deleted objects are left out, because Meta returns an
error when that filter names DELETED. Campaigns, ad sets, ads, creatives,
images, labels, and rules are keyed by their ID. Videos, custom audiences, saved
audiences, custom conversions, and pixels are keyed by ad_account_id and ID,
so an asset that several ad accounts list keeps one row per account.
ad_account_id is the numeric ID of the ad account that listed the row.
ad_creatives_by_ad reads each ad’s creative through the ads listing, 25 ads per
page, with one row per ad keyed by ad_id. Use it when ad_creatives fails on
a large account with “Please reduce the amount of data you’re asking for”. Ads
that share a creative repeat its columns.
custom_audiences reports time_created, time_updated, and
time_content_updated as Unix seconds, so they load as integers. It does not
read the audience rule, because that field can make Meta answer “Please
reduce the amount of data you’re asking for”.
ad_videos can fail with error 283 when Meta wants a Page permission such as
pages_read_engagement for videos that belong to a Page.
Insights
Each insights row covers one day, throughtime_increment=1. date_start and
date_stop are calendar dates in the ad account’s time zone, which
ad_accounts reports as timezone_name. The row’s level sets its key, which is
account_id, campaign_id, adset_id, or ad_id together with date_start.
The account, campaign, ad set, and ad resources read impressions, clicks,
spend, reach, frequency, cost metrics, link clicks, outbound clicks, actions and
action values, conversions, return on ad spend, and video views. Actions and
other per-action metrics are JSON arrays of action types and values.
Campaign, ad set, and ad insights filter on effective_status with every status
including ARCHIVED and DELETED. Meta documents the DELETED value for the
ad.effective_status filter, so ad-level rows keep delivery from ads deleted
later. Meta does not document it for campaign.effective_status or
adset.effective_status, so campaign and ad set rows for deleted objects may be
missing.
ad_insights_rankings reads the quality, engagement rate, and conversion rate
rankings for each ad and day. Meta’s current insights field lists do not
include these rankings, and integrators report Meta stopped returning them in
version v18.0. This resource can return empty rankings or fail, so it is kept
apart from ad_insights.
Breakdown resources read ad-level daily insights split by one or more
dimensions. Their keys add the breakdown columns to ad_id and date_start.
They leave out video metrics, which Meta does not support with every breakdown.
comscore_marketreplaced thedmabreakdown on June 22, 2026. It needs thecomscoreinsights feature on the ad account and returns no rows without it.impression_deviceneeds enablement for some ad accounts since August 6, 2026. Without itad_insights_placement_devicereturns no rows.device_platformis a documented breakdown but is missing from Meta’s table of allowed combinations.ad_insights_device_platformandad_insights_publisher_device_platformcan fail if Meta rejects it.- Meta reports region names without their country. Two regions with the same
name in different countries, such as Limburg in Belgium and the Netherlands,
share a key in
ad_insights_region, and an upsert keeps only one of them.
ad_insights but group the
entries of the action arrays by another dimension. They add no columns or rows,
so they keep the ad_id and date_start key.
action_video_sound and action_video_type are documented action breakdowns
but are missing from Meta’s combination table, so Meta may reject them.
campaign_insights_hourly reads campaign insights by
hourly_stats_aggregated_by_advertiser_time_zone, which is part of its key,
over hourly_insights_date_preset. It reads delivery, cost, click, and action metrics. Meta returns 0 for reach and
frequency with hourly breakdowns and does not allow video metrics, so the
resource reads neither.
Modes
All resources support full reads. Use full upsert for insights. Each run rereads the days in its preset and replaces those rows by key. Full replace would delete every day outside the preset, so avoid it for insights. Meta says insights do not change after 28 days, which is why the default preset islast_28d. A shorter preset stops
refreshing older days while late conversions can still change them, so those
days stay stale.
Entity resources are full only. Use full upsert to refresh existing rows, or
full replace to also drop rows Meta no longer returns, such as deleted
campaigns. The campaigns listing has no modified-time filter. The ad set and ad
listings accept updated_since, but one watermark would be shared across every
ad account. A campaign’s paused or archived status also passes down to its ad
sets and ads as their effective_status, and Meta does not document whether
that changes the child’s update time.
activities also supports incremental append on event_time. Meta returns
one week of activity when a request names no start, so the resource needs
activities_start_date. Full reads and the first incremental run send it as
since. Later runs send the watermark as since in Unix seconds, one hour
earlier to cover activity logged while other ad accounts were read. Activity
rows have no ID, so they are keyless, and rows inside that hour can repeat.
Every column of a repeated row matches, so SELECT DISTINCT removes them.
The activities watermark is the latest event_time across every ad account,
and ad accounts are read at the same time. When a run fails after some accounts
have advanced the watermark, the next run starts from it and can skip events
that a slower account had not yet delivered. A newly added ad account also
starts at the shared watermark. Run a full read to recover either case.
Insights do not support incremental reads. Meta’s time_range needs an end
date, and the manifest cannot compute the current date.
Behavior
- Auth sends the token as a bearer token in the
Authorizationheader rather than theaccess_tokenquery parameter, which keeps it out of the URLs the connector builds. Meta does not document whether itspaging.nextlinks carry the token. - Pagination follows the
paging.nextURL Meta returns with each page until a page has none. A page can be empty and still link to the next one. Lists use 100 rows per page. Creatives and custom audiences use 25, since their responses carry large specs. - Rate limiting sends at most two requests per second across the connection,
which suits apps with Full access to the Marketing API. Meta’s throttling
errors back off from 30 seconds and retry. These are codes
4,17,341,613,80000,80003,80004, and80014, and insights subcode1504043, when Meta returns them with HTTP 400 or 403. An app with Limited access gets a score of 60 per ad account that decays over 300 seconds, about one read every five seconds, and is blocked for five minutes when it runs out. Such apps spend much of a run waiting on retries. See rate limiting. Filament does not read Meta’s usage headers or track quotas shared with other apps. - Errors other than throttling fail the read with Meta’s message, including expired tokens, missing permissions, and invalid parameters. Server errors are retried up to three times.
- Insights timeouts happen when a synchronous request asks for too much
data. Meta returns code
100subcode1504018or code2subcode1504038and the read fails. Ad-level and breakdown insights over a long preset on a large account are the likeliest to time out. Meta’s remedy is an asynchronous report or a request split into shorter date ranges, and the connector supports neither. A shorter preset can reduce the timeout risk, but Meta sets no size below which a query is sure to finish, and a preset shorter than 28 days leaves older days stale, as described in Modes. A backfill withmaximumis likeliest to finish for account and campaign insights and likeliest to time out for ad-level and breakdown insights on large accounts. - Insights history follows Meta’s retention.
maximumreturns at most 37 months. Breakdown queries that start more than 13 months ago leave out reach, frequency, andcpp. Hourly queries that start more than 13 months ago return no data, so the hourly preset offers no range that reaches that far. - Attribution follows each ad set’s attribution setting, which Meta reports
in
attribution_setting. Meta has ignoreduse_unified_attribution_settingandaction_report_timesince June 2025. The connector sends neither and leavesaction_attribution_windowsat Meta’s default. - Off-Meta actions are not returned with the
regionbreakdown or hourly insights. With theproduct_idbreakdown and the carousel card action breakdowns Meta returns off-Meta web actions without the breakdown value and drops mobile app actions. On-Meta metrics such as impressions and link clicks are unaffected.