# Prompt library for marketing mix modeling

By Mike Taylor, from https://www.vexpower.com/mmm/ai-marketing-mix-modeling

Replace {{business}}, {{outcome}}, {{channels}} and {{period}} with your own context, and paste your data or results where it says [paste here]. Only paste company data into an assistant your company has approved for it.

## Data audit

_Use when: Before any model is fitted. Paste a sample of the weekly file and the data dictionary._

```text
You are a senior marketing scientist auditing a dataset before anyone fits a marketing mix model on it. You are careful, sceptical and specific, and you never guess at values you cannot see.

Context:
- Business: {{business}}
- Outcome we want to explain: {{outcome}}
- Marketing inputs: {{channels}}
- Granularity and period: {{period}}

I will paste the data (or a sample of it) and a data dictionary below. Do not build a model and do not estimate any effects. Your only job is to find problems that would make a model wrong.

Work through these checks in order and report each one, even when it passes:
1. Shape: number of rows, date range, gaps or duplicated dates, and whether the frequency is consistent.
2. Blanks versus zeros: for every spend column, list the periods that are blank and say whether a zero is plausible there. Never treat a blank as zero without flagging it.
3. Units and definitions: currencies, net versus gross spend, impressions versus spend, whether the outcome includes or excludes returns, tax or cancellations. List anything the dictionary leaves ambiguous as a question for me.
4. Outliers and breaks: periods where any column jumps more than three times its usual week-to-week change, and anything that looks like a tracking change, a new market, a stockout or a pricing change.
5. Variation: channels whose spend barely moves, or that always move together (say which pairs look correlated above roughly 0.8 if you can compute it). A model cannot separate what never varies independently.
6. Missing drivers: given the business, what usually moves {{outcome}} that is not in this file (price, promotions, distribution, seasonality, competitor activity, macro factors)?

Format: a table with columns Check, Finding, Severity (blocker / fix before modelling / note), Evidence (row numbers or dates). Then a short list of questions I must answer before modelling. If you computed anything, show the code you ran. If you could not check something from what I pasted, write "not checked" rather than inferring it.

Data and dictionary:
[paste here]
```

## Model spec review

_Use when: After you have a draft model specification but before you trust its outputs._

```text
Act as a reviewer at a measurement team's model sign-off meeting. You are reviewing the specification of a marketing mix model for {{business}}, explaining {{outcome}} with {{channels}} over {{period}}.

I will paste the model specification: variables, transformations (adstock, saturation, lags), controls, priors or constraints, and how it was validated.

Review it in this order:
1. Causal structure: draw (in text) the causal graph the specification implies. Name any variable that is plausibly a confounder (drives both spend and {{outcome}}) and is missing, and any variable included that is probably a mediator or a consequence of the outcome (for example branded search, or retargeting that follows site visits), which would steal credit from upstream media.
2. Identification: for each channel, say what variation in the data the coefficient is actually learned from. Flag channels that only change at the same time as seasonality, promotions or another channel.
3. Transformations: are the adstock and saturation choices plausible for each channel type? Flag carryover longer than about eight weeks for performance channels, and any channel whose current spend sits past the point where the curve has flattened.
4. Priors and constraints: list each prior or bound and whether it is doing the work the data should do. Say what you would expect to change if the prior were loosened.
5. Validation: is there an out-of-sample test, a time-based holdout or experiment calibration? Fit on the training data alone is not evidence.

Rules: do not invent coefficient values or results I have not given you. When you are unsure, say what evidence would settle it. End with the three changes that would most improve the model, ranked by how much they could change the budget decision.

Specification:
[paste here]
```

## Red-team the results

_Use when: a model has produced ROIs or a decomposition and someone wants to act on them._

```text
You are a sceptical CFO's analyst. A marketing mix model for {{business}} has produced the results below ({{outcome}}, channels: {{channels}}, period: {{period}}). Your job is to find the reasons these numbers could be wrong before anyone moves budget on them.

For each channel's result:
1. Plausibility: compare the return to what is typical for that channel type and say whether it is surprising. A media return several times higher than other channels is a reason to look for an omitted variable, not a reason to celebrate.
2. Alternative explanations: list what else moved in the same weeks that the channel could be standing in for (promotions, seasonality, price, distribution, PR, a competitor exiting).
3. Uncertainty: if intervals are given, say whether the decision would change anywhere inside the interval. If no intervals are given, say that the result cannot be acted on until they are.
4. Share of spend versus share of effect: flag channels whose credit is far out of line with their spend, in either direction.
5. Extrapolation: flag any recommendation that moves a channel's spend outside the range it was observed at in the data.

Then write the two or three experiments (geo test, holdout, spend pause) that would most cheaply confirm or overturn the riskiest result, with what each would need to show.

Rules: only use numbers that appear in what I paste. Never compute a new ROI, contribution or coefficient yourself unless you show the arithmetic from the figures given. If a figure is missing, ask for it.

Results:
[paste here]
```

## Explain it to a CFO

_Use when: the model is reviewed and you need a one-page note a finance leader will read._

```text
Write a one-page note to the CFO of {{business}} explaining what our marketing mix model says and what we recommend. The CFO is numerate, short on time, sceptical of marketing claims, and will ask "how sure are you?" about every number.

Model facts (use only these; do not add or round away any number):
[paste: outcome, period, channel contributions, ROIs or cost per outcome with intervals, current spend, recommended change, validation results, experiments used for calibration]

Structure:
1. The decision in one sentence: what we want to change, by how much, and the expected effect on {{outcome}} as a range, not a point.
2. Why we believe it: two or three sentences on the evidence, naming which parts come from experiments and which come only from the model.
3. What could make us wrong: the one or two biggest risks, in plain language.
4. How we will know: the test or the metric we will watch, and the date we will report back.
5. A small table: channel, current spend, proposed spend, expected change in {{outcome}} (low, middle, high).

Style: plain English, no jargon (if you must use "adstock" or "saturation", explain it in a few words in brackets). Talk about profit or margin if the facts include it; otherwise say the analysis is on revenue. No exclamation marks, no adjectives like "incredible". Under 350 words. Do not claim precision the facts do not support.
```

## Write a test plan

_Use when: the model has a result you are unsure of and you want an experiment to settle it._

```text
Help me design an incrementality test for {{business}} to check one result from our marketing mix model.

The result to test: [e.g. "the model says paid social returns 2.1 in revenue per 1 spent, interval 0.9 to 3.4"]
Channels: {{channels}}. Outcome: {{outcome}}. Data available: {{period}}.
Constraints: [budget we can put at risk, markets or regions available, how long we can run it, anything we cannot switch off]

Before proposing a design, ask me up to five questions if any of these are unclear: the decision the test will inform, the smallest effect that would change that decision, how outcomes are measured by region or audience, and seasonality in the test window.

Then write the plan with these sections:
1. Decision and hypothesis: what we will do if the effect is above or below a threshold.
2. Design: geo holdout, matched markets, synthetic control, conversion lift or spend pause, and why this one fits our constraints.
3. Treatment and control: how units are chosen, and how we will check they tracked each other before the test.
4. Duration and power: the minimum detectable effect at this length and size. Show the formula and inputs you used, state assumptions about variance explicitly, and tell me which inputs I need to replace with real numbers.
5. Analysis plan, written before the test runs: the metric, the estimator (for example difference-in-differences), and how carryover after the test will be handled.
6. How the result feeds back into the model as a calibration prior or constraint.
7. Risks: contamination, spillover, holidays, other teams changing spend.

Do not invent historical numbers about our business. Where you need one, write [NEEDED: description].
```

## Write model code

_Use when: you want an agent to draft a Meridian, PyMC-Marketing or plain Python script you will run and check yourself._

```text
Write a Python script that fits a marketing mix model with [PyMC-Marketing / Google Meridian / plain numpy and scipy] on the CSV I describe below. I will run it myself, so it must run end to end without edits.

Data: [file name, columns and types, date column and frequency, which column is the outcome, which are media spend, which are controls]
Business: {{business}}. Outcome: {{outcome}}. Channels: {{channels}}. Period: {{period}}.

Requirements:
1. Check the installed library version at the top of the script and use only APIs that exist in that version. If you are not certain an argument exists, say so in a comment rather than guessing.
2. Validate the data before fitting: no missing dates, no blanks in spend columns, outcome strictly positive if a log transform is used. Stop with a clear error if a check fails.
3. Use geometric adstock and a saturating response for each channel, with priors or bounds written as named constants at the top so I can change them. Explain each default in a one-line comment.
4. Hold out the last [8] weeks to measure out-of-sample error, report it, then refit on all data for the final estimates.
5. Print convergence diagnostics (for Bayesian fits: R-hat, effective sample size, divergences) and stop with a warning if they fail.
6. Output: a contributions table, ROI by channel with intervals, and response curves saved as PNG files. Every number printed must come from the fitted model; no hard-coded results.

Do not choose priors to make any channel look good. After the code, list the assumptions the script makes that I should check against my business.
```

## Narrate a scenario

_Use when: an optimiser or scenario planner has produced budget options and you need to explain the trade-offs._

```text
Below is the output of a budget scenario planner run on our marketing mix model for {{business}} ({{outcome}}, channels: {{channels}}). It compares several budget scenarios.

Write a short narrative that a marketing director could read in two minutes:
1. For each scenario, one paragraph: what changes, the expected effect on {{outcome}} with its range, and the marginal return of the last unit of spend in the channels that move most.
2. Say clearly which recommended moves push any channel beyond the spend levels seen in the historical data, because those are extrapolations the model has never observed.
3. Name the scenario you would pick if the goal is [profit / revenue growth / hitting a target at least cost], and the single assumption that, if wrong, would flip that choice.
4. Note what the scenarios leave out (brand effects beyond the model window, competitor response, creative fatigue, supply constraints).

Use only the figures in the output. Keep the difference between average return and marginal return explicit. If two scenarios are within each other's uncertainty ranges, say that the model cannot tell them apart rather than picking a winner.

Scenario output:
[paste here]
```

## Interview me for priors

_Use when: you are setting up a Bayesian MMM and want to turn team knowledge into explicit, defensible priors._

```text
I am setting priors for a Bayesian marketing mix model for {{business}} ({{outcome}}, channels: {{channels}}, {{period}}). Interview me to turn what our team believes into explicit priors. Ask one question at a time and wait for my answer.

For each channel, find out:
1. What evidence we have about its effect: past experiments (with their results and dates), platform lift studies, previous models, or only opinion. Weight these differently and tell me how.
2. A plausible range for its return per unit of spend, phrased as "you would be surprised if it were below X or above Y".
3. How long its effect plausibly lasts after spend stops (carryover), and whether it peaks immediately or with a delay.
4. Whether we have ever spent far more or less on it than usual, which tells us whether the data can say anything about saturation.

After the interview, produce a table: channel, evidence type, prior distribution and parameters for ROI (or coefficient), prior for carryover, and a one-sentence justification. Then flag any prior that is so tight it will decide the result regardless of the data, and any that is so loose it adds nothing. Do not suggest priors that were not justified by something I said, and never set a prior from what we hope the result will be.
```
