Agent context
Facebook Ads models
4 SQL models that turn the raw Facebook Ads tables into the reports people ask about. Deploy them in Weld and your agent queries the definitions behind every number.
How the set is built
- 8Raw tables
- 8Staging
- 5Core
- 4Analytics
Staging cleans each raw table once, core holds the logic, and analytics is the table dashboards and agents read.
- Ad performance dailyDaily delivery and purchase results per ad, the Ads Manager "Ads" tab by day.grain: date_day x account_id x ad_id · 8 raw tables
- Ad set performance dailyDaily ad set performance with its optimisation goal and attribution setting, the Ads Manager "Ad sets" tab by day.grain: date_day x account_id x ad_set_id · 8 raw tables
- Campaign performance dailyDaily campaign performance with the rates Ads Manager shows: CTR, CPC, CPM, cost per purchase and ROAS.grain: date_day x account_id x campaign_id · 8 raw tables
- Conversions by action type dailyEvery conversion event Meta reports, per ad and day: purchases, leads, add to carts, registrations, app installs, custom conversions. Ads Manager's "Results" columns, one row per event.grain: date_day x account_id x ad_id x action_type · 8 raw tables
- Weld or dbt
- The same SQL in both dialects. Sync the folder with GitHub Sync, or copy the dbt models into your project.
- Check before you rely on it
- Reconcile a month against Facebook Ads's own reports first. Each model's notes say what the synced data can and can't support.
Connect Facebook Ads.
Your agents start with context.
Sync Facebook Ads to your warehouse, deploy these models, and query them from Claude, Cursor or ChatGPT over MCP. Free for 14 days, no credit card.