Code Snippet Library / Lead Gen

Attribution Model Config Library

The Attribution Model Config Library is a free code snippet providing six real attribution models, last-click through Markov-chain removal-effect, as ready-to-plug functions against your own conversion-path data.

↗ View on GitHub ⬇ Download Full Repo (.zip)
MIT
License
JSON
Language
Aug 14, 2026
Last updated
README.md View raw ↗

What this is (and isn’t)

Pure functions you call against your own path data, not a hosted service or an analytics integration. Runs entirely in your own environment.

Files

FilePurpose
attribution-models.jslastClick(), firstClick(), linear(), timeDecay(), positionBased(), markovRemovalEffect(), plus the exported solveLinearSystem() Gaussian-elimination solver — zero dependencies
test.js19-test suite, including hand-verified exact cases for the Markov removal-effect solver

The Markov removal-effect model, precisely

Builds a first-order transition model from your paths, then for each channel measures the removal effect: rebuild the model with that channel’s traffic truncated right before it, recompute overall conversion probability via an exact linear solve, and take the drop. This is the standard definition, simplified to work from converting-path data alone.

FAQ

Is this free to use?

Yes. Free to download and use. MV3 charges $175/hr only if you want help wiring these into your real GA4/BigQuery export data.

Which six models are included?

Last-click, first-click, linear, time-decay, position-based (U-shaped), and a simplified Markov-chain removal-effect model.

Does my conversion data get sent to MV3?

No. Every function runs entirely in your own environment against data you supply.

Is the Markov model a full implementation?

It is a real, exact linear-algebra solve (not a Monte Carlo approximation), simplified to work from converting-path data alone rather than requiring a separate non-converting-path dataset.

What input format do the functions expect?

An array of paths, each an ordered list of channel touchpoints plus a numeric conversion value, e.g. { channels: ['Organic Search', 'Email'], value: 500 }.

JR
Jordan Reeves
ABM & Outbound Pipeline, MV3 Marketing