Skip to content

Pouyasharp/meta-price-campaign-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meta Price-Campaign Winner Analysis — Process & Methodology

Process documentation for the recurring "which price wins" decision on Meta Ads. Companion to the meta-price-test-analysis code repo — this repo explains how and why, the code repo implements the current best version of it.


The three tests (always run all three)

The methodology is locked: every Meta price-test analysis runs the same three tests in one image.

# Test What it measures Method
1 Profitability ROAS Return per $1 spent Point = Σrevenue / Σspend. CI = day-level resample (n=3,500 or 10,000 per request), recompute ratio each iter, percentile(2.5, 97.5).
2 SARIMAX 60-day forecast Trajectory of daily purchases Auto-select order via pmdarima.auto_arima. Forecast 60 days forward, plot with 95% CI.
3 Purchase Rate (CVR) Purchases / clicks Point = Σpurchases / Σclicks. CI = day-level resample, recompute ratio, percentile(2.5, 97.5).

The synthesis rule (when to call a winner): 2 of 3 must hold:

  • Bayesian P(treat > ctrl) > 0.95
  • MC P(treat > ctrl) > 0.70
  • |Cohen's d| > 0.2

See meta-price-test-analysis repo for the full Bayesian / MC pipeline (this repo documents the methodology; the code repo ships the working implementation).


What's in this repo

meta-price-campaign-analysis/
├── README.md                   # this file
├── SKILL.md                    # trigger conditions, three-test rule, pitfalls
├── LICENSE                     # MIT
├── .gitignore
├── requirements.txt
├── references/
│   ├── bootstrap_on_ratios.md     # why you can't naive-bootstrap ROAS or CVR
│   ├── meta_export_layout.md      # the column-index trap that bites every time
│   └── sarimax_model_selection.md # the decision tree for short price-campaign series
└── templates/
    └── analyze_template.py        # the reusable 3-test template

The three references — read these in order

  1. meta_export_layout.md — the single most important document in this repo. Meta's export xlsx has two header rows and the integer column index is offset from the column name position. Get this wrong and every number in your report is wrong, in a way that passes your own eyeball checks.

  2. bootstrap_on_ratios.md — why you cannot naive-bootstrap a ratio metric (ROAS, CVR). The short version: bootstrap-of-the-mean-of-the-ratio is biased; you must resample days and recompute the ratio each iter.

  3. sarimax_model_selection.md — training series lengths vary from 20 days (Denton) to 121 days (Waukesha). Default auto_arima will happily fit SARIMA on 20 days and give garbage. The decision tree in this document is the one that actually works.

The template

templates/analyze_template.py is a drop-in 3-test script you can adapt to any new Meta price-test data. Set FILES at the top to point at your xlsx exports, set N_BOOT per the user's request, run, get a 3-panel horizontal viz per city.


When to use this

The user almost always asks for the same three tests in one image; multi-city runs (3-4 cities in one session) are now standard. Trigger conditions are spelled out in SKILL.md.


Companion repos


License

MIT. See LICENSE.

About

Process documentation for the Meta Ads price-test workflow: the 3-test rule, the column-index trap, bootstrap-on-ratios, and a reusable analyze_template.py. Companion to meta-price-test-analysis.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages