Skip to content
+

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

MetricHow it is computed
Blended ROASNet revenue from Postgres ÷ Facebook Ads spend, same period
Ad-reported vs actual revenue gapPlatform-reported conversion value − net revenue
Net profit after fees and adsContribution margin − allocated ad spend
Average order valueOrder 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.

MetricDefinitionUnit
Net revenueLine value after line discounts and allocated order vouchers, minus refunds to buyers. Refunds are deducted only here.Currency
Ad spendTotal advertising cost by report date. Filtering by channel or platform uses the destination channel the ads drive traffic to.Currency
Blended ROASActual net revenue divided by ad spend for the same channel and period.= Net revenue / Ad spendNumber
Ad-reported vs actual revenue gapAd-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 revenueCurrency
Net profit after fees and adsNet revenue received minus COGS, marketplace fees, payment fees, shipping, return costs and advertising.= Contribution margin - allocated_ad_spendCurrency
Average order valueLine revenue after discounts divided by valid orders.= line_net_total / Valid ordersCurrency

Questions you can answer

QuestionFacebook Ads onlyPostgreSQL + Facebook Ads combined
What is the real revenue from ads?Based on the pixelNet revenue in the database
Blended ROAS?NoYes
How fresh is it?Whenever Meta updatesOn schedule, down to 15 minutes when every source is incremental

Steps

  1. 1

    Connect PostgreSQL

    Enter the host, database and a read-only user; choose the tables and the sync mode (full, incremental or CDC).

  2. 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. 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. 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 and Facebook Marketing in minutes

Free plan with no time limit · No card required · Sample workspace ready in minutes