Unlock the Power of Media Mix Modeling for Effective Advertising Unlock the Power of Media Mix Modeling for Effective Advertising
Editor’s note: Hajime Takeda is a speaker for ODSC East this May 9th-11th. Be sure to check out his talk, “Media... Unlock the Power of Media Mix Modeling for Effective Advertising

Editor’s note: Hajime Takeda is a speaker for ODSC East this May 9th-11th. Be sure to check out his talk, “Media Mix Modeling: How to Measure the Effectiveness of Advertising in Python,” there!

Advertising is a crucial aspect of marketing strategies, and businesses often grapple with determining the effectiveness of their marketing channels. Due to lifestyle changes caused by COVID-19, the diversification of digital media, and the increase in digital advertising costs caused by privacy regulations, companies are facing new challenges in marketing spending. This is where media mix modeling (MMM) comes to the rescue, helping businesses understand and optimize the impact of different media channels on sales. 

In this blog, I will provide a quick overview of media mix modeling and how you can get started with it.

What is Media Mix Modeling (MMM)?

MMM is a statistical approach that quantifies the impact of various marketing inputs on sales. Its primary goals are to understand and measure the return on investment (ROI), simulate the impact of changes in spending, and optimize media budgets to maximize sales.

Key Challenges in Media Spending Optimization:

You might wonder why it is so difficult to measure ROI. Or “Why not just check ROI on the report issued by each media? These are good questions, but the reality is a little more complicated.

1. Multiple media touchpoints. 

Let’s assume a customer saw a product on TV and Instagram, clicked on a paid search ad, and then made a purchase. In this case, 3 touchpoints contributed to the conversion. And all three media should get credits for this conversion.

2. Data tracking limitation

Offline media channel influence such as TV, Out-of-home ads is hard to track. What is worse, even in the digital world, privacy regulations such as GDPR and Apple’s IDFA deprecation have been impacting tracking accuracy.

3. Randomized experiments

The gold standard for answering a causal question is to perform randomized experiments, also known as a lift test. However, halting or restricting the volume of advertisements solely for experimental purposes is impractical, because this could lead to lost opportunities.

What data is needed?

The image below is a quick preview of the input data for the media mix modeling model.

To begin with media mix modeling, you need to collect time-series data, including sales, media spending data, non-media marketing data, and external factors. Typically, two to three years of weekly-level data is required for accurate modeling.

Modeling Concept:

Linear regression is a simple first step – A quick and easy method, but it does not account for key marketing principles: “Adstock” and “Saturation”. 

Adstock refers to the phenomenon where the advertising effect on sales may not be immediate, as it can lag behind the initial exposure and extend for several weeks. This is primarily because consumers generally remember ads for an extended period of time. Imagine a soft drink company launches a new advertising campaign for one of its products. The first time the customers see the ad, they might not immediately go out and buy the soft drink. However, as they continue to see the ad repeatedly over time, the message starts to accumulate in their minds. 

Another key concept when modeling is saturation. The more money you spend on one media channel advertisement, the less effective it is. For example, let’s say you invested $10K in YouTube ads, and as a result, you were able to reach 1 million people. Now, if you were to increase your ad budget by ten times, how many people do you think you could reach? 10 million people? That is probably not correct, and it would likely be less than 10 million. This demonstrates what saturation is.

Google researchers Jin et al. proposed a Bayesian method that integrates these principles.

Useful MMM Libraries:

Here, let me introduce two great OSS libraries that will help you to try MMM: LightweightMMM, a Python-based library developed mainly by Google developers, and Robyn, an R-based library developed by Meta. Both solutions account for adstock and saturation functions.

LightweitMMM uses Numpyro and JAX for Probabilistic Programming, which makes the modeling process much faster. While Robyn makes use of Meta’s AI library ecosystem. Nevergrad is used for hyperparameter optimization, and Prophet is adopted for handling time series data.

The image below is an example of LightweightMMM’s output. Sales are attributed to baseline sales and the individual impact of each media channel.


MMM is a powerful tool for quantifying the impact of marketing channels on sales. 

Starting with LightweightMMM or Robyn is a good first step. If you are interested in learning more, attend my upcoming talk at ODSC East 2023 or connect with me on LinkedIn! I will offer in-depth information on data collection, modeling approaches, demonstrations, result interpretation, and useful practical tips.

About the author/ODSC East 2023 speaker:

Hajime is a data professional with five years of expertise in marketing, retail, and eCommerce, working across Japan and the United States. As a Data Analyst at Procter and Gamble and MIKI HOUSE Americas, Hajime has led data-driven strategy formulation and implemented technology initiatives such as e-commerce expansion, advertising optimization, and the identification of growth opportunities. As an organizer of PyData NYC, Hajime is dedicated to fostering a vibrant community centered around the exchange of knowledge on open-source technologies in New York. 

ODSC Community

The Open Data Science community is passionate and diverse, and we always welcome contributions from data science professionals! All of the articles under this profile are from our community, with individual authors mentioned in the text itself.