All resources
Topics

How to connect Facebook Ads to Databricks (step-by-step guide)

Step-by-step guide to piping Facebook Ads campaign data into your Databricks Lakehouse using OWOX connectors. OAuth auth, zero custom code, open-source.

Step-by-step guide to piping Facebook Ads campaign data into your Databricks Lakehouse using OWOX connectors. OAuth auth, zero custom code, open-source.

Facebook Ads generates a massive amount of campaign data – ad sets, audiences, creative performance, cost breakdowns – but most of it stays locked inside Meta's own reporting UI. Getting that data into Databricks where you can join it with other sources, run SQL, and build real analytics is usually a custom engineering project.

It doesn't have to be. This guide shows you how to connect Facebook Ads to Databricks in about 2 minutes using OWOX – an open-source connector platform that handles api access, schema mapping, and incremental loads automatically. As well as many other reporting workflows. No custom scripts, no token management, no maintenance.

What you'll need before you start

Before jumping into setup, make sure all prerequisites are in place. Missing one of these mid-flow will stall the process.

Databricks workspace access

You need an active Databricks workspace with permissions to create tables and run queries. Gather these three values before you start:

  • Workspace URL – the full URL of your Databricks deployment (e.g., https://dbc-abc123.cloud.databricks.com)
  • SQL Warehouse HTTP path – found under SQL Warehouses → your warehouse → Connection Details
  • Personal Access Token (PAT) – generate one from User Settings → Developer → Access Tokens

If you're on a Databricks trial, everything works the same way. Just make sure your SQL Warehouse is running when you configure the connection.

Databricks SQL Warehouse connection details showing HTTP path for OWOX connector setup

Facebook Ads account

You need a Facebook Ads account connected to a Meta Business Manager. The account should have active campaigns or historical data to pull.

OWOX uses OAuth authentication – you sign in with your Facebook account and authorize access. No long-lived tokens to generate, no app IDs to configure manually.

Make sure the Facebook user you'll authenticate with has at least Advertiser or Admin access to the ad account you want to connect.

OWOX account

Sign up at owox.com/app-signup if you don't have one yet. The free tier includes connectors and enough data volume to get started.

Step 1: Configure Databricks as your storage in OWOX

The first step is telling OWOX where to write data. You'll register your Databricks workspace as a storage destination so that every connector you set up later writes to the same place.

Log into your OWOX account and navigate to Storages.

OWOX Settings page showing Storages section where users add Databricks as a data destination

Click Add Storage and select Databricks from the list of supported warehouses.

OWOX storage selection dialog showing Databricks among supported data warehouses

Enter your Databricks connection details

Fill in the three values you gathered in the prerequisites:

                                                                                                                                                                    
FieldWhere to find itExample
Workspace URLYour browser address bar when logged into Databrickshttps://dbc-abc123.cloud.databricks.com
SQL Warehouse HTTP PathSQL Warehouses → [your warehouse] → Connection Details/sql/1.0/warehouses/abc123def456
Personal Access TokenUser Settings → Developer → Access Tokens → Generate New Tokendapi1234567890abcdef

OWOX Databricks storage setup form with workspace URL, HTTP path, and personal access token fields

Click Save to verify everything works. OWOX will now use this Databricks workspace as the target for all connectors you configure.

Troubleshooting tip: If the connection test fails, check that your SQL Warehouse is in a Running state. Databricks auto-suspends idle warehouses, and a stopped warehouse will reject connection attempts.

Step 2: Create a new data mart with the Facebook Ads connector

Now that Databricks is connected as your storage, you can set up the actual Facebook Ads pipeline. In OWOX, every data pipeline lives inside a Data Mart – a logical container that defines what data to pull, from where, and on what schedule.

Navigate to the Data Marts section and click Create New Data Mart.

OWOX Data Marts page with Create Data Mart button for setting up Facebook Ads connector

Select the Facebook Ads connector

Select Input Source - Connector, then from the connector library, select Facebook Ads. OWOX supports dozens of data sources – advertising platforms, CRMs, analytics tools – but for this guide, we're focusing on Facebook Ads.

OWOX connector library showing Facebook Ads among available data source connectors

Authorize with Facebook OAuth

Click Connect Facebook Account. A standard Facebook OAuth window will appear – sign in with your Facebook account that has access to the ad account and grant OWOX the requested permissions.

 Facebook OAuth authorization screen for connecting Facebook Ads account to OWOX

This is the entire authentication step. No long-lived tokens, no app IDs, no app secrets – just a standard OAuth flow. OWOX handles token refresh automatically, so you won't need to re-authorize unless you revoke access.

Choose your Facebook Ads account

After authorization, OWOX will display a list of ad accounts associated with your Facebook login. Select the ad account you want to pull data from or enter it manually.

OWOX Facebook Ads account selection after OAuth authorization

If you manage multiple ad accounts through Meta Business Manager, you'll see all of them listed. Pick the specific account whose campaign data you need in Databricks.

Step 3: Choose your API endpoints and fields

This is where you decide exactly what data flows into Databricks. OWOX exposes the Facebook Marketing API surface – you pick the resources and fields that matter for your reporting.

Select endpoints

Endpoints correspond to Facebook Marketing API resources. Each endpoint creates a separate table in your Databricks catalog.

 OWOX Facebook Ads endpoint selection showing available API resources for Databricks import

Common endpoint selections for marketing analytics:

  • Ad Insights – performance metrics (impressions, clicks, spend, conversions) broken down by date
  • Campaigns – campaign-level settings, objectives, status, and budget
  • Ad Sets – audience targeting, placements, scheduling, and optimization goals
  • Ads – individual ad creative, copy, URLs, and status
  • Ad Creative – creative assets, headlines, descriptions, and call-to-action details

Select the endpoints relevant to your reporting needs. You can always come back and add more later.

Select fields within endpoint

For selected endpoint, you can choose which fields (columns) to import. OWOX selects the most commonly used fields by default, but you can customize this to keep your Databricks tables lean or add deeper dimensions.

OWOX Facebook Ads field selection for customizing which data columns import into Databricks

Pro tip: Start with the defaults and iterate. Facebook's Marketing API has hundreds of fields per endpoint – importing everything creates wide, sparse tables. Focus on the metrics and dimensions you'll actually query.

Step 4: Configure the destination and schedule

With endpoints and fields selected, tell OWOX where to write the data in Databricks and how often to refresh it.

Set the Databricks destination

Choose the catalog, schema (database), and table prefix for your Facebook Ads data. Since you already configured Databricks as your storage in Step 1, these options will be available.

OWOX Databricks destination configuration with catalog, schema, and table prefix settings

A clean naming convention keeps things organized:

  • Schema: facebook_ads or marketing_raw
  • Table prefix: fb_ – so your tables become fb_campaigns, fb_ad_sets, fb_ads, etc.

Step 5: Publish and run your first import

Everything is configured. Time to launch.

Publish the data mart

Click Publish & Run Data Mart to activate your data mart. This saves all settings and automatically runs the data import for the last 7 days.

OWOX data mart publish screen showing Facebook Ads to Databricks pipeline configuration summary

Manual backfill run

After publishing, click Run Now to start the first data import. OWOX will pull historical data from the Facebook Marketing API and write it into your Databricks tables.

OWOX data mart ready to run with Run Now button for initial Facebook Ads data import to Databricks

The initial import duration depends on your data volume:

  • Small accounts (< 10 campaigns, < 1 year of data) – a few minutes
  • Medium accounts (50–100 campaigns, 2–3 years) – 10–30 minutes
  • Large accounts (hundreds of campaigns, 5+ years) – up to a few hours

You can monitor progress on the data mart page. OWOX shows import status, row counts, and any errors in real time.

Set the refresh schedule

OWOX supports daily, hourly, and custom cron schedules. For most Facebook Ads reporting, daily is the right choice – Facebook's attribution windows can adjust data for up to 28 days after an event, so frequent pulls of the same date range ensure accuracy.

OWOX data mart scheduling options for Facebook Ads to Databricks refresh frequency

Step 6: Verify your data in Databricks

Once the import completes, head to your Databricks workspace and confirm the data landed correctly.

Run a quick validation query

Open a SQL Editor or notebook in Databricks and run a basic check:

1-- Check that tables were created
2SHOW TABLES IN your_catalog.facebook_ads;
3
4-- Preview campaign data
5SELECT
6  campaign_name,
7  objective,
8  impressions,
9  clicks,
10  spend,
11  date_start
12FROM your_catalog.facebook_ads.fb_ad_insights
13WHERE date_start >= CURRENT_DATE - INTERVAL 7 DAYS
14ORDER BY spend DESC
15LIMIT 20;

If you see your campaign names, metrics, and recent dates – you're set. The data is now in your Databricks Lakehouse and ready for analysis.

Check row counts and freshness

Run a quick freshness check to confirm incremental loads are working:

1SELECT 
2COUNT(*) AS total_rows, 
3MIN(date_start) AS earliest_date, 
4MAX(date_start) AS latest_date
5FROM your_catalog.facebook_ads.fb_ad_insights;‍

The latest_date should reflect your most recent Facebook Ads data. Keep in mind that Facebook's attribution window can retroactively adjust metrics, so you may see data for the same dates update across multiple runs.

Why collect Facebook Ads data in Databricks?

If your company already runs on Databricks, keeping Facebook Ads data locked inside Meta's walled garden creates a blind spot. Here's what you're missing without it.

Meta's native reporting has hard limits

Facebook Ads Manager gives you pre-built dashboards and breakdowns – but they operate in isolation. You can't join ad performance with CRM revenue, product margin data, or website behavior from your own event tables. You can't apply your company's attribution model. And you can't run SQL across Facebook and Google Ads data in a single query to compare true channel efficiency.

The moment you need to answer "what's our blended CAC across paid channels?" or "which Facebook audiences convert to paying customers?" – you need the raw data in your data warehouse, not in Meta's UI.

Your Databricks Lakehouse is already the single source of truth

Most teams that use Databricks have already centralized their product, sales, and analytics data there. Adding Facebook Ads data to the same Lakehouse means marketing performance sits alongside everything else – governed, versioned, and queryable with the same tools your analysts already use.

This eliminates the classic problem of marketing data living in spreadsheets while the rest of the business runs on SQL. When Facebook spend data lands in the same catalog as your revenue tables, building a proper ROI model is just a JOIN away.

Cross-channel attribution becomes a SQL query

With Facebook Ads data in Databricks alongside Google Ads, LinkedIn Ads, TikTok Ads, and other sources, cross-channel analysis stops being a spreadsheet project. Compare Facebook CPA against Google's, measure channel incrementality, and build unified dashboards – all with standard SQL on Lakehouse architecture that scales to billions of rows.

How OWOX Data Marts enable self-service analytics on Facebook Ads data

Raw Facebook Ads data in Databricks is powerful – but raw tables with hundreds of columns aren't something a marketing manager can work with directly. This is exactly the gap OWOX Data Marts fill.

What are OWOX Data Marts?

A Data Mart is a reusable, SQL-defined analytical dataset that sits on top of your Databricks tables. Analysts write the SQL logic once – defining metrics, joins, filters, and business rules – and publish it as a clean, governed dataset. Business users then pull reports from that data mart into Google Sheets, Looker Studio, or any BI tool without touching SQL or waiting on the data team.

Think of it as a contract between analysts and business users: the analyst guarantees the logic is correct and the data is fresh; the business user gets self-service access to explore it freely.

Practical examples with Facebook Ads data

Once your Facebook data lands in Databricks, you can build data marts like:

  • Weekly spend by campaign objective – marketing leads see budget allocation across awareness, consideration, and conversion campaigns. Refreshed daily, available in Google Sheets
  • Ad-level creative performance – creative teams compare CTR, CPC, and ROAS across ad variations without asking for a custom report every time
  • Cross-channel cost comparison – a single data mart that joins Facebook, Google, and LinkedIn spend with CRM revenue data, giving leadership a blended CAC view they can filter by channel, region, or product line
  • Audience performance tracker – tracks which custom audiences and lookalikes deliver the best downstream conversion rates, not just clicks

Each of these data marts auto-refreshes on the schedule you set, and business users can slice the data through familiar tools. No more "can you pull this for me?" tickets in your analytics backlog.

Creative fatigue and audience analysis

With raw Facebook data in Databricks and OWOX Data Marts on top, you can run analyses that Meta's UI makes difficult – creative fatigue detection (when does performance degrade per creative?), audience overlap across ad sets, and ROAS trending by placement (Feed vs. Stories vs. Reels). Build these as reusable data marts, and your marketing team can monitor them independently.

Sign up for OWOX to start building data marts on top of your Databricks tables.

The open-source advantage

OWOX connectors are fully open-source. The Facebook Ads connector code is available on GitHub under an open license.

This matters in practice. If you need a Marketing API field that isn't exposed in the UI, or you want a custom breakdown dimension – you can fork the repository, add it, and submit a pull request. Contributor guides are in the repo.

For enterprise teams, this means:

  • Audit the code – see exactly what API calls are made and how data is transformed
  • Extend functionality – add new endpoints, custom breakdowns, or post-processing logic
  • Self-host if needed – run connectors in your own infrastructure with the Self-Managed Edition (though the Cloud Edition handles everything for most teams)

This fork-and-extend model is especially valuable for data teams in regulated industries or those with strict data governance requirements.

Troubleshooting common issues

Even with a straightforward setup, a few things can go wrong. Here are the most common issues and fixes.

Connection test fails

Problem: OWOX can't reach your Databricks workspace.

Check:

  • Is your SQL Warehouse running? Databricks auto-suspends idle warehouses
  • Is the workspace URL correct, including the full https:// prefix?
  • Is your Personal Access Token still valid? Tokens can expire based on your org's policies
  • Are there network restrictions (IP allowlists, private endpoints) blocking external access?

Facebook OAuth authorization fails

Problem: The Facebook OAuth flow doesn't complete or returns an error.

Check:

  • Are you signing in with a Facebook account that has Advertiser or Admin access to the ad account?
  • Has your Facebook app or business account been restricted by Meta? Check Meta Business Suite for notifications
  • Try in an incognito window – browser extensions or cached Facebook sessions sometimes interfere
  • Make sure third-party cookies aren't blocked, as Facebook's OAuth flow relies on them

Missing data or empty tables

Problem: Tables exist in Databricks but contain no rows.

Check:

  • Does the ad account have data for the selected date range? New accounts may have no historical data
  • Did you select the correct ad account ID? Business Managers can have dozens of accounts
  • Check the data mart run logs in OWOX for error details – they'll show which API calls failed and why
  • Facebook's Marketing API has rate limits – very large accounts may need multiple runs to complete the initial backfill

Conclusion

Connecting Facebook Ads to Databricks doesn't require a custom engineering project. With OWOX, the entire setup – from Databricks storage configuration to the first data import – takes about 15 minutes. No custom scripts, no token rotation, no ongoing maintenance.

And because the connectors are open-source, your data team keeps full control. Audit the code, extend it when needed, and build analytics pipelines on top of reliable, governed data.

Ready to get your Facebook Ads data into Databricks? Sign up for OWOX and follow the steps above – you'll be querying campaign data in your Lakehouse in minutes.

FAQ

Frequently asked questions

How do I connect Facebook Ads to Databricks?
+
Do I need a Facebook developer app to connect Facebook Ads to Databricks?
+
What Facebook Ads data can I import into Databricks?
+
How often should I refresh Facebook Ads data in Databricks?
+
Can I connect multiple Facebook ad accounts to Databricks?
+
Is the OWOX Facebook Ads connector open-source?
+
What can I do with Facebook Ads data in Databricks?
+
On this page
From the blog

Learn how teams ship analytics faster

Deep dives on data marts, governance, and modern reporting workflows.

See all articles →
What users are saying

Not testimonials. Comment threads.

From people who actually use the product. Each quote is attached to a specific claim.

A1
· re: warehouse integration
KP
Katya P.
BI Manager

Finally, a tool that doesn't ask business users to learn a new dashboarding UI. Our marketing team already knows Sheets. OWOX just delivers the right data.

C3
· re: governance
MR
Marco R.
Head of Data

Joinable data marts concept was the thing that sold us. We can now use the semantic layer without building one.

E7
· re: open source
JC
James C.
Data Analyst

Self-hosted the OSS version on Digital Ocean. Zero vendor lock-in. Contributed a Shopify connector back in week two.

Google Sheets in modern analytics

Google Sheets, powered by governed data marts

Google Sheets were never designed to be a system of record. With OWOX Data Marts, Sheets becomes a trusted analysis layer — powered by governed data marts defined upstream in your warehouse.

Business teams keep the flexibility they love
Data teams retain control over logic and definitions
No more fragile joins duplicated across spreadsheets
See how it works
/* Full Width Images in RichText */