September 01, 2025
By PyMC Labs
Marketing teams consistently report that data wrangling consumes the majority of their Marketing Mix Modeling efforts, leaving little time for the insights that actually drive decisions. This fundamental challenge affects everyone from teams building their first MMM to those optimizing existing ones. What modern growth teams really want are two things: speed to first insight and confidence in the data and methods behind the numbers
Through our strategic partnership with Fivetran, we're changing that equation entirely. Fivetran and dbt already standardize multi-platform advertising and commerce data, removing weeks of ad-hoc wrangling. PyMC-Marketing now turns those standardized tables into a production-grade Bayesian MMM complete with uncertainty quantification, adstock/saturation effects, and budget optimization without forcing teams to rebuild plumbing they already have.
In concrete terms, Fivetran's ad_reporting dbt package harmonizes spend, impressions, clicks, and conversion metrics from major channels (Google, Meta, LinkedIn, TikTok, Amazon, etc.) into a unified schema (e.g., ad_reporting_ad_report). Crucially, it also supports unioning multiple connections, say, multiple markets or brands, so analysts can analyze blended performance while still tracing each record back to its origin via a source_relation field. That "many sources, one shape" design is exactly what a robust MMM pipeline needs.
PyMC-Marketing then picks up where your warehouse leaves off. Based on that data, our Bayesian MMM API estimates channel effects with proper uncertainty, handles carryover (adstock) and saturation, and supports budget allocation, calibration to experiments, and time-varying dynamics. These capabilities are difficult to bolt onto a spreadsheet or rules-based approach.
As part of our collaboration with Fivetran, PyMC-Marketing now includes data loaders that transform Fivetran/dbt outputs into MMM-ready inputs in a few lines (illustrated here with Shopify, but extensible to any e-commerce platform):
process_fivetran_ad_reporting(...) turns long-format ad reporting tables into a wide, date-indexed design matrix (X) by platform and metric (e.g., impressions or spend).
process_fivetran_shopify_unique_orders(...) converts Shopify orders into a clean target series (y) for modeling conversions/revenue.
from pymc_marketing.data.fivetran import (
process_fivetran_ad_reporting,
process_fivetran_shopify_orders_unique_orders,
)
campaign_df = pd.read_sql("SELECT * FROM <schema>.<any_fivetran_ad_report>", con=conn)
orders_df = pd.read_sql("SELECT * FROM <schema>.<shopify_report>", con=conn)
x = process_fivetran_ad_reporting(
campaign_df,
value_columns="spend",
rename_date_to="date"
)
# Result: date | facebook_ads_spend | google_ads_spend | ...
# Process conversion data (orders) as target variable
y = process_fivetran_shopify_unique_orders(orders_df)
# Result: date | orders
# Use in MMM model
mmm = MMM(...)
mmm.fit(X=x, y=y["orders"])
You can browse the "MMM Fivetran Connectors" example notebook in our docs to see the end-to-end flow from querying standardized tables to fitting an MMM and inspecting outputs. The notebook demonstrates switching between metrics (e.g., impressions vs. spend), handling missing dates, and producing the wide matrix expected by the model.
Fivetran connectors land raw platform data; and Fivetran’s quickstart data models (dbt based) transform it into consistent reporting layers such as ad_reporting_ad_report, alongside platform-specific rollups. The package explicitly supports unioning multiple accounts/regions/brands. The resulting models include a source_relation column for lineage. This is ideal for MMM use cases that span multiple markets or portfolios.
Our loaders aggregate by platform and date, pivot to wide format, fill gaps if requested, and rename columns to MMM-friendly conventions (e.g., facebook_ads_spend). A corresponding target loader processes Shopify orders to a daily series. With X and y prepared, you can fit a Bayesian MMM immediately.
The MMM API provides carryover and shape (saturation) effects, full posterior uncertainty for ROAS and contributions, budget optimization and scenario analysis, plus optional time-varying effects and experiment calibration.
For teams managing multiple brands or regions, the framework scales to multidimensional approaches without sacrificing individual market insights.
The result is a clean, auditable pipeline: connect → standardize (dbt) → load (PyMC-Marketing) → infer (Bayesian MMM) → act.
Start here: Walk through the MMM Fivetran Connectors notebook to see the complete workflow and copy/paste starter code.
Go deeper: Review what the new Fivetran data loaders do in the corresponding PyMC-Marketing pull request.
Are you new to Fivetran's Ad Reporting? Check out the package README, especially the section on unioning multiple connections, to learn about supported platforms, models, and configurations.
This work builds on Fivetran's standardization efforts in the dbt ecosystem and PyMC-Marketing's growing MMM toolkit. We're excited to help teams go from raw connectors to Bayesian decisioning with minimal friction.