Creating a Marketing Mix Model with AI

A Data-Driven Approach to Attribution

In today’s complex marketing landscape, understanding which channels drive conversions is more critical than ever. While last-click attribution gets all the glory, it often misses the bigger picture of how different touchpoints work together to drive results. That’s where Marketing Mix Modeling (MMM) comes in.

In this post, I’ll walk you through building a fully functional Marketing Mix Model that analyzes DMA-level impressions, clicks, and conversions to give you true attribution insights.

What is Marketing Mix Modeling?

Marketing Mix Modeling is a statistical analysis technique that helps marketers understand the impact of various marketing tactics on sales or conversions. Unlike multi-touch attribution, which tracks individual user journeys, MMM uses aggregate data to model the relationship between marketing inputs and business outcomes.

Key advantages of MMM:

  • Works without user-level tracking (privacy-friendly)
  • Captures offline and online channels together
  • Models media effects like adstock and saturation
  • Provides incrementality insights, not just correlation

The Challenge: Multi-Channel Attribution

Modern marketing campaigns run across multiple DMAs (Designated Market Areas), with varying levels of impressions, clicks, and conversions each day. The questions marketers need to answer include:

  • How much do impressions contribute to conversions vs. clicks?
  • What’s the carryover effect of yesterday’s ads on today’s conversions?
  • Are we experiencing diminishing returns at current spend levels?
  • How does performance vary across different markets?

Traditional analytics tools often fall short in answering these questions because they don’t account for media effects like decay and saturation.

Building the Model: Key Components

1. Data Structure

The model requires daily data at the DMA level with these fields:

  • Date – Daily timestamp
  • DMA – Market identifier (e.g., “New York”, “Los Angeles”)
  • Impressions – Number of ad impressions served
  • Clicks – Number of clicks generated
  • Conversions – Number of conversions attributed

2. Adstock Transformation

Adstock models the carryover effect of advertising. When someone sees your ad today, they might not convert immediately, but the ad’s influence persists over time with diminishing impact.

const applyAdstock = (values, decayRate = 0.5) => {
  const adstocked = [values[0]];
  for (let i = 1; i < values.length; i++) {
    adstocked[i] = values[i] + decayRate * adstocked[i - 1];
  }
  return adstocked;
};

The decay rate (typically 0.3-0.7) determines how quickly the ad effect fades. A decay rate of 0.5 means that 50% of yesterday’s impact carries over to today.

3. Saturation Curves

Marketing channels exhibit diminishing returns. The first 1,000 impressions are more valuable than the 10,000th impression. Saturation curves model this effect using a power function:

const applySaturation = (values, alpha = 2, gamma = 0.5) => {
  return values.map(x => {
    const normalizedX = x / Math.max(...values);
    return Math.pow(normalizedX, gamma) / (Math.pow(alpha, gamma) + Math.pow(normalizedX, gamma));
  });
};

4. Regression Analysis

After transforming the data, we run regression models to estimate the contribution of each channel:

  • Dependent variable: Conversions
  • Independent variables: Adstocked & saturated impressions, adstocked & saturated clicks
  • Output: Coefficients showing the impact of each channel

The model calculates contribution by multiplying the coefficient by the transformed media values, giving you the incremental conversions driven by each channel.

Key Metrics & Insights

Model Fit (R²)

The R-squared value indicates how well the model explains variance in conversions. An R² above 0.70 (70%) is generally considered good for MMM, though this varies by industry and data quality.

Media Contribution

The model breaks down conversions into:

  • Impression contribution – Conversions driven by brand exposure
  • Click contribution – Conversions driven by direct response
  • Baseline – Conversions that would happen anyway (organic, brand equity, etc.)

Efficiency Metrics

Beyond attribution, the model calculates operational metrics:

  • Cost per conversion
  • Conversion rate by channel
  • Conversions per 1,000 impressions

Practical Applications

Budget Optimization

Understanding contribution helps you allocate budget more effectively. If impressions contribute 40% of conversions but only consume 20% of budget, you might want to shift spend toward awareness campaigns.

Diminishing Returns Analysis

The saturation curves help identify when you’re over-investing in a channel. If you’re on the flat part of the curve, additional spend won’t drive proportional returns.

Cross-Market Strategy

Comparing performance across DMAs reveals which markets respond better to different tactics. Maybe clicks drive conversions in New York, while impressions work better in smaller markets.

Forecasting & Scenario Planning

Once calibrated, the model can predict outcomes under different spend scenarios, helping you plan campaigns with confidence.

Implementation Considerations

Data Quality

MMM requires clean, consistent data. Common issues include:

  • Missing days or DMAs
  • Inconsistent conversion attribution windows
  • External factors (holidays, competitors) not captured in the data

Minimum Data Requirements

You need sufficient data for statistical significance:

  • At least 30-90 days of daily data
  • Multiple DMAs to capture market variation
  • Adequate conversion volume (ideally 50+ conversions per day)

Model Validation

Always validate your model:

  • Check R² values for model fit
  • Review residuals for patterns
  • Holdout testing with recent data
  • Compare predictions to actual outcomes

Beyond the Basics

This implementation provides a foundation, but advanced MMM includes:

  • Multiple channels – TV, digital, social, search, etc.
  • Seasonality adjustments – Weekly and yearly patterns
  • External variables – Competitors, weather, economic indicators
  • Bayesian methods – For more robust parameter estimation
  • Machine learning – For complex non-linear relationships

The Business Impact

Marketing Mix Modeling transforms marketing from a cost center to an optimization problem. Instead of asking “What happened?” you can ask:

  • “What will happen if we increase impression spend by 20%?”
  • “Which DMA should get more budget?”
  • “Are we at the point of diminishing returns?”
  • “What’s the true incremental value of our paid media?”

Try It Yourself

I’ve built a fully functional Marketing Mix Model dashboard that you can use with your own data. The tool includes:

  • Interactive data upload and filtering
  • Adstock and saturation transformations
  • Statistical regression analysis
  • Contribution attribution breakdowns
  • Time series visualizations
  • Model diagnostics and validation metrics

Upload your campaign data (CSV format with date, DMA, impressions, clicks, conversions) and run the analysis to get immediate insights into what’s driving your conversions.

Conclusion

Marketing Mix Modeling isn’t just for enterprises with million-dollar analytics budgets anymore. With the right approach and tools, any marketer can implement MMM to understand true media contribution, optimize spend, and make data-driven decisions.

The key is starting simple, validating your models, and iterating based on what you learn. As you collect more data and refine your approach, MMM becomes an invaluable tool for strategic planning and tactical optimization.

What’s your biggest challenge with marketing attribution? Have you tried MMM before? Drop a comment below and let me know what insights you’d like to extract from your marketing data.


Ready to build your own Marketing Mix Model? Check out the interactive tool I built, or reach out if you’d like help implementing MMM for your organization.

Posted in , , ,

Leave a Reply

Discover more from Adman Analytics

Subscribe now to keep reading and get access to the full archive.

Continue reading