finds.dev

DP6/Marketing-Attribution-Models

Python Class created to address problems regarding Digital Marketing Attribution.

View on GitHubHomepage ↗

★ 365PythonApache-2.0updated Apr 2026

// the take

A Python class implementing multi-channel marketing attribution models — both heuristic (last click, first click, linear, time decay, position-based) and algorithmic (Shapley value, Markov chains). Aimed at digital marketing analysts who want to move beyond Google Analytics' default last-click attribution without building the math themselves. Installable via pip with a pandas-centric API.

The Markov chain implementation returns the full transition matrix and removal effect table, not just the final attribution numbers — useful for actually understanding channel dependencies. The `conversion_value_as_frequency` parameter for Markov is a practical fix for the memory blowup that hits anyone working with real-scale clickstream data. The random DataFrame generator makes it easy to try the models before wiring in real data. Built-in `group_by_channels_models` accumulates results across model runs, so side-by-side comparison is one `.plot()` call away.

The entire library lives in a single 1000+ line file (MAM.py) with no internal modularity — debugging the Shapley implementation means scrolling through everything else. The Shapley `size` parameter silently truncates journey length, which can significantly distort results for long funnels; the README mentions this but doesn't quantify the error. No support for fractional or revenue-weighted conversion values in the heuristic models without workarounds. Last meaningful commit activity suggests maintenance is stagnant — open issues and PRs appear to sit unaddressed, which matters if you hit an edge case with your data format.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
365
Forks
87
Language
Python
License
Apache-2.0
Last commit
28 Apr 2026

// nearby

If Marketing-Attribution-Models isn't quite it.

All repos →