Connector

Query Facebook Ads data in AWS Athena

Load Facebook and Instagram ad performance into Athena tables in your own AWS account with OWOX Data Marts: ads, creatives and insights, each in its own table, refreshed on a schedule. Query it next to web analytics and CRM to see which ads bring customers and deals.

Facebook AdsConnectedAdAd AccountAd Account UserAd Creatives
Data MartPublishedone definition
AWS AthenaDateCostClicksDaily 09:00
Refreshed on a schedule. No exports, no copy-paste.

Get Started Free

Hand this to your AI

Facebook Ads counts results by its own attribution, and the spend never sits next to your CRM in AWS Athena.

Paste this into your AI assistant. It creates a Facebook Ads Data Mart on your AWS Athena storage, loads ads, creatives and insights into separate tables on a schedule, and joins spend to your deals.

The prompt

load Facebook Ads ad insights and creatives into AWS Athena on a daily schedule and write a query that shows spend per ad next to the CRM deals its visitors opened

Endpoints

Facebook Ads Endpoints

Documentation

15 Facebook Ads endpoints you can import. Each lands in its own table in your data warehouse.

S00 · Why

Why query Facebook Ads with your web analytics and CRM in Athena

Ads Manager reports what Facebook and Instagram say they delivered, counted by Meta's own attribution. To see which ads brought customers and revenue, spend has to sit next to website touch points and CRM deals in one data warehouse that you query with Athena SQL.

  • Put Facebook next to Google, TikTok and Microsoft spend in one table
  • Connect ad clicks and sign-ups to the orders and deals they became
  • Query spend, reach and ROAS with the Athena SQL you already use
Facebook AdsAd spend, reach
Web analyticsVisits, sign-ups
CRMDeals
Your data warehouseAWS AthenaAdTouch pointDealJoined by idAd seen or clickedDeal months laterOne Athena query links the ad to the deal.

S01 · Step 1

Step 1: Connect Facebook Ads and pick the fields

Create a Data Mart on your Athena data storage and choose Facebook Ads as the data source. Sign in with Facebook or add an access token, list your ad account ids and tick only the fields you need.

  • 15 endpoints and 1172 fields to choose from
  • Ad Insights alone has 100 fields: spend, reach, clicks, conversions, ROAS
  • One Data Mart per endpoint, so each breakdown stays its own table
New Data MartChoose a sourceGoogle AdsFacebook AdsTikTok AdsAuthorizeConnectedEndpointAd InsightsAdAd AccountAd Account User
Ad Insights100 fieldsdate_startspendimpressionsclicksreachpurchase_roas

S02 · Step 2

Step 2: Load Facebook Ads into an Athena database and table

Choose the Athena database and table, or keep the pre-filled ones. Run it and the first load, from the start of the previous month through today, lands in your own AWS account.

  • Insights go to a table such as facebook_ads_ad_account_insights
  • Query results go to the S3 output bucket you set up for Athena
DestinationAWS AthenaDatabasefacebook_adsTablead_account_insightsRun
Run HistoryPendingRunningSuccessIncremental load
Tablefacebook_ads.ad_account_insig…

S03 · Step 3

Step 3: Know every column before you write the query

Once the first run finishes, the output schema lists every field with a plain-words description, not an API identifier. Your data quality checks can read it too.

  • Results such as actions and action_values are fields of their own, with descriptions
  • Anyone on the team can read the table
facebook_ads.ad_account_insightsOutput schemaFieldDescriptiondate_startThe start date for your data…spendThe estimated total amount of…impressionsThe number of times your ads…clicksThe number of clicks on your ads.reachThe number of people who saw…purchase_roasThe total return on ad spend…

S04 · Step 4

Step 4: Connect the Facebook Ads tables in Athena

Ad accounts, ads, creatives and insights are separate Athena tables, joined by ids. Join them and they form one Facebook Ads data model.

  • ad_id in Ad Insights is the id of the ad, and creative_id on the ad points to its creative
  • Campaign and ad set ids ride on every row, so spend rolls up to either level
Ad Accountnameaccount_id
Ad Creativesidname
Adsidaccount_idcreative_id
Ad Insightsad_idspend

S05 · Step 5

Step 5: Schedule the Athena load and backfill history

Set it up once. A daily scheduled refresh keeps the Athena tables current, and a manual backfill brings in any period you missed.

  • Run it daily, weekly, monthly or on an interval
  • Backfills longer than a month are split into segments of up to 31 days for you
ScheduleRun on a scheduleDaily 09:00
BackfillRun backfill
Run HistoryDaily scheduleManual backfillDaily schedule

S06 · Step 6

Step 6: Use the same Athena tables in every tool

The same tables feed your data model, spreadsheets, dashboards, AI assistants like Claude and ChatGPT, and scheduled AI insights in Slack or email.

  • Blend Facebook with Google and TikTok spend once
  • All reports read the same Athena tables
Facebook AdsData MartPublished
Blended ad spend
Google Sheets
Data Studio dashboards
Claude, ChatGPT
Slack, email

Recent updates

Why OWOX

Why OWOX for Facebook Ads in AWS Athena

Hand-built Marketing API scripts, a generic ETL tool or manual exports each get Facebook data out. OWOX also lands it in your AWS account, readable and ready to model.

  • You own the data. It lands in your own AWS account, in tables you control, not inside an ad account.
  • One table per breakdown. Country, region, age and gender, device, placement and product breakdowns each load into their own table, so you take the cuts you need and leave the rest.
  • Ready for a data model. Separate Athena tables joined by ad, ad set and campaign ids, built to connect to web analytics and CRM.
  • Maintained for you. No API scripts for you to patch when Meta updates the Marketing API.
  • Free to self-host. The open-source OWOX Data Marts runs in your own infrastructure, with Athena as its data storage.

Book a callGet Started Free

Trust

The Data Partner You Can Trust

users

175K Source: Internal OWOX data as of 2026-11-11

Executives and data analysts across 20+ industries

G2 rating

4.9★2

“A trusted data analytics partner” — verified review

npm installs

171K3

In Open Source We Trust

Customers