Combine your PostgreSQL order database with Facebook Ads
Businesses with their own website or sales app usually keep orders in PostgreSQL, while ad spend sits in Facebook Ads. Marketing reads ROAS in Ads Manager, the data team reads revenue in the database, and the two numbers never match. DataxLand loads the order tables from Postgres (incremental or CDC) and daily Facebook Ads spend into one warehouse, and computes blended ROAS, the gap between reported and actual revenue, ad cost per order and profit after ads, with one definition for both teams.
Free plan with no time limit · No card required · Sample workspace ready in minutes
Why combine
- Revenue in the database is the real number; the revenue Meta reports follows its attribution window.
- The data team no longer rewrites the ROAS report every time marketing changes campaigns.
- CDC keeps revenue close to real time, so you can set alerts during the day.
Metrics you only get by combining
| Metric | How it is computed |
|---|---|
| Blended ROAS | Net revenue from Postgres ÷ Facebook Ads spend, same period |
| Ad-reported vs actual revenue gap | Platform-reported conversion value − net revenue |
| Net profit after fees and ads | Contribution margin − allocated ad spend |
| Average order value | Order line revenue ÷ valid orders |
Standard metrics from the analytics packs
Once both sources map to the same model, these metrics run on the joined data with one definition.
| Metric | Definition | Unit |
|---|---|---|
| Net revenue | Line value after line discounts and allocated order vouchers, minus refunds to buyers. Refunds are deducted only here. | Currency |
| Ad spend | Total advertising cost by report date. Filtering by channel or platform uses the destination channel the ads drive traffic to. | Currency |
| Blended ROAS | Actual net revenue divided by ad spend for the same channel and period.= Net revenue / Ad spend | Number |
| Ad-reported vs actual revenue gap | Ad-platform-reported revenue minus actual net revenue for the same channel and period. Positive means the platform reports more than reality.= ad_conversion_value - Net revenue | Currency |
| Net profit after fees and ads | Net revenue received minus COGS, marketplace fees, payment fees, shipping, return costs and advertising.= Contribution margin - allocated_ad_spend | Currency |
| Average order value | Line revenue after discounts divided by valid orders.= line_net_total / Valid orders | Currency |
Questions you can answer
| Question | Facebook Ads only | PostgreSQL + Facebook Ads combined |
|---|---|---|
| What is the real revenue from ads? | Based on the pixel | Net revenue in the database |
| Blended ROAS? | No | Yes |
| How fresh is it? | Whenever Meta updates | On schedule, down to 15 minutes when every source is incremental |
Steps
- 1
Connect PostgreSQL
Enter the host, database and a read-only user; choose the tables and the sync mode (full, incremental or CDC).
- 2
Connect Facebook Ads
Paste an access token with ads read permission and your ad account ID; DataxLand reads campaigns, ad sets, ads and daily metrics.
- 3
Review Si's mapping
Si investigates the order table with read-only queries and proposes the status, amount, date and channel columns and how they join ad spend; you approve.
- 4
Build and read the dashboards
The Ads and P&L overview dashboards share one definition for marketing and data; set an alert on blended ROAS.
Frequently asked questions
Do I need to write SQL or dbt models?
No. Si proposes how your tables map to the standard retail model, and DataxLand generates the transformation models from the approved mapping. You edit the mapping, not code.
What is the fastest refresh schedule?
15 or 30 minutes when every source in the workspace syncs incrementally or by CDC and your plan allows it; sources on full sync refresh at most every hour. Facebook Ads is read incrementally by report date.
Which plan can combine two sources?
The Free plan accepts a single Excel file. Combining two or more sources needs the Starter plan (up to 3 sources) or above; see pricing for the number of sources and the refresh schedule of each plan.
Dashboard templates that use this source
Connect PostgreSQL →Connect Facebook Marketing →Ask Si about your PostgreSQL data →Ask Si about your Facebook Marketing data →
Other combinations
- Combine PostgreSQL with Google Sheets: system data plus targets and costs
- Combine Excel orders with Facebook Ads for shops that sell through a fan page
- Combine HubSpot with Facebook Ads to get real CPL and CAC
- Combine Shopee with Facebook Ads to see your blended ROAS
- Combine Shopify with Facebook Ads to see profit after advertising
- Combine TikTok Shop with Facebook Ads when Meta ads send buyers to TikTok
Combine PostgreSQL and Facebook Marketing in minutes
Free plan with no time limit · No card required · Sample workspace ready in minutes