Before you start
- Live data sources enabled for your organization. See Live data sources.
- Admin role in the Lightdash project.
- Your ad account ID: the number after
act=in your Ads Manager URL. - A system user access token with only the
ads_readpermission. To create one:- In Meta Business settings, add a system user and assign it your ad account with View performance access.
- In Meta for Developers, create a Business app in the same business portfolio and add the Marketing API product.
- On the system user, click Generate new token, choose the app, select
ads_read, and set the token to never expire.
Connect Meta Ads
- On the nav bar, click Browse → Semantic Layer.
- In the sidebar, select Live data sources, then click Add.
- Select Meta Ads.
- Enter a Name, such as
Meta Ads. People see this name in Explore and agents use it to refer to the source. - Enter the Ad account ID and Access token, then click Test connection.
- Click Add source.
Dimensions
Age and gender, location, and placement can’t be combined in one query. Meta doesn’t report those breakdowns together.
Metrics
Conversion metrics use Meta’s default attribution: 7-day click and 1-day view. This can differ from an ad set’s own attribution setting, so numbers can differ from Ads Manager. A blank value means Meta reported nothing for that row.
Supported features
To filter by a campaign, ad set or ad, include that field or a finer one in the query. For example, add Campaign name before you filter by it.
Limits
When a query has more than 5,000 rows, Lightdash shows an error rather than a partial result. Narrow the date range, add a filter or remove a dimension.
Example questions
- “Spend and purchases by campaign over the last 30 days.”
- “Top 10 ads by spend this month.”
- “Impressions and link clicks by age and gender last week.”
Troubleshooting
Meta rejected the access token. Generate a new system user token withads_read and update the source.
Meta denied access to the ad account. Check that the system user is assigned to this ad account and that the token includes ads_read.
Numbers don’t match Ads Manager. Check the date range and time zone first. For conversions, compare against the 7-day click and 1-day view attribution setting in Ads Manager.