Abstract
Markov Chain Attribution is an open-source Digital Marketing & SEO project. A PoC for a fractional attribution model leveraging first order Markov Chains. This is a proof-of-concept I built out that leverages a first order Markov chain to reallocate conversions in the manner explained by Anderl, Eva and Becker, Ingo and Wangenheim, Florian V. and Schumann, Jan Hendrik in " Mapping the Customer Journey: A Graph-Based Framework for Online Attribution Modeling". It is built using Python. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building a Digital Marketing & SEO mini project or final-year project.
1. Introduction
This is a proof-of-concept I built out that leverages a first order Markov chain to reallocate conversions in the manner explained by Anderl, Eva and Becker, Ingo and Wangenheim, Florian V. and Schumann, Jan Hendrik in " Mapping the Customer Journey: A Graph-Based Framework for Online Attribution Modeling"
If this concept is new, check out the post on markov chain attribution modeling.
There is an amazing R package called ChannelAttribution which does this as well as higher-order models very well. My day-to-day workflow is centered around Python so I wanted to build out a version to A) have something I can go-to for connecting directly to SQL tables to path journeys and B) better understand the process by which these attribution models are generated. ChannelAttribution makes it very easy to faceroll a fractional attribution model without really understanding what's going on. Which is great! But if you want to understand better, building your own tends to help.
2. Objective
A PoC for a fractional attribution model leveraging first order Markov Chains.
This project demonstrates how Python can be applied to a real-world Digital Marketing & SEO problem.
4. Technology Stack
5. System Requirements
General requirements for this technology stack — check the README for exact versions.
- Python 3.8 or later
- pip / virtualenv for dependencies
- VS Code, PyCharm or Jupyter Notebook
- Git (to clone the repository)
6. Installation & Setup
git clone https://github.com/jerednel/markov-chain-attribution.git
cd markov-chain-attributionpip install markov-model-attributionFull setup instructions are in the project README.
7. Future Enhancements
Suggested extensions you can add to make this your own project.
- Export reports to Google Sheets or PDF
- Schedule weekly automated reports
- Add competitor comparison
8. Viva / Review Questions
Common questions examiners ask for projects in this domain.
- Which marketing or SEO problem does this tool solve?
- Which data sources or APIs does it use (Search Console, Analytics, social platforms)?
- Which metrics or KPIs does it report and how are they calculated?
- How could the output help a business make decisions?
- How would you schedule it to run automatically?
9. Source Code & License
This project is developed by jerednel and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.
Want to build this as your internship project?
Work on a Digital Marketing & SEO project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.
Apply for Digital Marketing & SEO Internship