- Home
- Skills
- Marketing & SEO
- Markov Multi-Touch Attribution & Budget Reallocation
More screenshots
Works with the AI Agents you already use
Markov Multi-Touch Attribution & Budget Reallocation
Turn a CSV of customer touchpoints into channel attribution: Markov vs journey-filter vs last-click credit, plus CPA, ROI and a suggested budget split. Cleans bots first and flags where the methods disagree.
Free
Markov Multi-Touch Attribution & Budget Reallocation
Example session with this skill installed
Run an attribution analysis on assets/sample/sample_touchpoints.csv and sample_campaign_spend.csv. Conversion value is 50,000 and the conversion event is Purchase. Which channels deserve credit, and how should I reallocate the budget?
- Read your context and instructions
- Compiled the markov multi-touch attribution
I ran the attribution on the sample files (2 brands, 5 channels, synthetic data). Last-click gives YouTube 27.5% of the credit, but the journey-filter method gives it only 5.2%, while Influencer Blog jumps from 14.9% (last-click) to 43.2%.
Credit by channel (all brands, weighted by conversions)
| Channel | Last-click | Markov | Filter |
|---|---|---|---|
| Google Search | 22.8% | 21.1% | 26.5% |
| Influencer Blog | 14.9% | 15.5% | 43.2% |
| 20.9% | 22.5% | 13.6% | |
| Marketplace | 13.9% | 15.5% | 11.5% |
| YouTube | 27.5% | 25.4% | 5.2% |
Key findings
Methods disagree: in both brands Markov and filter name a different top channel (Markov: YouTube; filter: Google Search for B01, Influencer Blog for B02), so treat those rankings as uncertain.
Efficiency: in brand B01, YouTube gets the largest Markov share but takes 40% of the spend (3,000,000 of 7,500,000), so it has the highest CPA.
- Bot filtering: removed 125 of 3,280 users (3.8%) flagged by the behavior rules.
Brand B01: CPA and ROI (conversion value 50,000, Markov credit)
| Channel | Spend | CPA | ROI |
|---|---|---|---|
| Google Search | 1,000,000 | 28,494 | +75.5% |
| Influencer Blog | 800,000 | 36,470 | +37.1% |
| 1,500,000 | 41,698 | +19.9% | |
| Marketplace | 1,200,000 | 45,189 | +10.6% |
| YouTube | 3,000,000 | 70,687 | -29.3% |
Brand B01: suggested budget (1/CPA weighting, 60% cap, 5% floor)
| Channel | Current | Suggested | Change |
|---|---|---|---|
| Google Search | 1,000,000 | 2,143,879 | +1,143,879 |
| Influencer Blog | 800,000 | 1,675,026 | +875,026 |
| 1,500,000 | 1,465,036 | -34,964 | |
| Marketplace | 1,200,000 | 1,351,846 | +151,846 |
| YouTube | 3,000,000 | 864,214 | -2,135,786 |
Next steps
1.
Test the shift: move part of YouTube's budget to Google Search and Influencer Blog for a few weeks and compare CPA.
2. Holdout, not a hard cut: pause YouTube in one region and check whether sales really drop.
3. Review bot rules: if 3.8% seems high for your data, adjust --bot-fast-seconds or --bot-click-rate.
Connects securely to your tools. The creator never sees your data.
About this skill
Marketing teams often rely on last-click attribution, which overvalues the final touchpoint and ignores the channels that actually started the customer journey. This leads to inefficient budget allocation and inflated CPA.
What it does
- Multi-method attribution calculates credit using Markov chains, a journey-filter method, and traditional last-click for comparison.
- Bot filtering cleans your event logs using rule-based behavior thresholds so non-human traffic doesn't skew ROI.
- CPA and ROI calculation maps attributed conversions against actual spend to find the true cost of acquisition per channel.
- Budget reallocation generates a data-driven spending plan using 1/CPA weighting with configurable caps and floors.
- Cross-method validation flags discrepancies between the Markov and filter models to show where channel value is uncertain.
How it works
- Data ingestion reads your touchpoint and spend CSVs, mapping custom columns for users, channels, timestamps, and brand IDs.
- Path processing identifies conversion events, filters bots, and builds transition matrices for the Markov model.
- Execution runs the
attribution.pyscript to generate CSV and JSON results including credit shares and budget shifts. - Synthesis compares the methods to find where last-click is most misleading and produces a reallocation table.
Frameworks & tools
Runs on Python 3 using pandas and numpy for the matrix calculations. It processes local CSV files and can optionally generate charts via matplotlib.
Why this beats prompting it yourself
Attribution maths is easy to get wrong when an LLM improvises it. This skill runs a fixed Python script, so results are repeatable on every run. It also builds in guardrails a generic prompt would likely miss, such as flagging where two methods disagree and never recommending a channel cut to zero without a holdout test.
Use cases
- Identify top-of-funnel channels that drive awareness but get little credit in last-click models.
- Rebalance a monthly ad spend across 5+ channels based on conversion efficiency.
- Audit event logs for bot activity that might be inflating performance numbers.
- Check a new channel's performance using a data-backed CPA instead of anecdotal evidence.
Works best with
A few hundred conversions per brand or more. Treat the budget plan as a data-backed starting point, and confirm big moves with a small spend shift before committing.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Marketing & SEO.
Ignores market saturation and seasonality. Requires Python environment with pandas/numpy. Results are noisy for datasets with very few conversions.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 4 days ago
- Free with an Agensi account
- Software
- Python 3.9+ with pandas and numpy
- Optional
- matplotlib and seaborn.
Permissions
File Scopes
Runs a local Python script on your CSV files and writes result tables to an output folder. No network access.