Home
cd ../playbooks
Marketing & ContentAdvanced

Marketing Attribution Analyst

Model multi-touch attribution, analyze campaign ROI, and build MMM frameworks using Bayesian and Markov chain methods.

15 minutes
By davila7/claude-code-templates
#attribution#marketing-mix-modeling#campaign-roi#bayesian#markov-chain#multi-touch#analytics

Your CEO asks which channel drove last quarter's revenue and you say 'Google Ads' because that's where last-click attribution points. But the customer actually saw a LinkedIn ad, read your blog, attended a webinar, then Googled your name. You're crediting the wrong channel.

Who it's for: growth marketers building multi-touch attribution models, marketing analysts moving beyond last-click attribution, CMOs justifying channel budgets to the board, data scientists building marketing mix models, performance marketers optimizing cross-channel spend

Example

"Build a multi-touch attribution model for our marketing channels" → Markov chain attribution model comparing first-touch, last-touch, and data-driven attribution, channel contribution analysis showing true ROI, and budget reallocation recommendations

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add marketing-attribution-analyst
# Marketing Attribution Analyst

## Role
You are a marketing attribution analyst specializing in multi-touch attribution modeling, marketing mix modeling (MMM), and campaign ROI analysis. You build quantitative models using Markov chains, Shapley values, Bayesian inference, and time-decay methods to determine true channel contribution. All recommendations must be data-backed with confidence intervals where applicable.

## Framework

### Data Requirements
Before building models, validate the data:
- **Touchpoint data**: user_id, channel, campaign, timestamp, interaction_type
- **Conversion data**: user_id, conversion_date, conversion_value, conversion_type
- **Spend data**: channel, campaign, date, spend_amount

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Turns Claude into a marketing attribution analyst that builds multi-touch attribution models, runs marketing mix modeling (MMM), and calculates true campaign ROI. Instead of defaulting to last-click and hoping for the best, you get Shapley value, Markov chain, and Bayesian approaches that reveal which channels actually drive conversions.

Based on davila7's marketing-attribution-analyst agent.


The Problem

Most marketing teams rely on last-click attribution, which massively over-credits bottom-of-funnel channels and under-credits awareness campaigns. Google Analytics says paid search gets all the credit. Facebook says Facebook gets all the credit. Nobody knows what's actually working, so budget allocation is based on vibes, not evidence.


The Fix

A structured attribution workspace where Claude ingests your touchpoint data, builds multiple attribution models side by side, and shows you exactly where each model agrees and disagrees. You get data-backed budget reallocation recommendations instead of platform-biased reporting.


Quick Start

Step 1: Download the Template

Click Download above to get the CLAUDE.md file.

Step 2: Prepare Your Data

attribution-analysis/
├── CLAUDE.md
├── data/
│   ├── touchpoints.csv          # user_id, channel, timestamp, conversion
│   ├── campaign_spend.csv       # channel, campaign, date, spend
│   └── conversions.csv          # user_id, conversion_date, value
├── models/
└── reports/

Step 3: Run Your First Attribution Analysis

claude

Say: "Analyze my touchpoint data and compare attribution models"


Example Commands

"Build a Markov chain attribution model from my touchpoint data"
"Compare last-click, linear, time-decay, and Shapley value attribution"
"Which channels are overvalued by last-click attribution?"
"Run a marketing mix model using my spend and conversion data"
"Calculate the incremental ROAS for each channel"
"What's the optimal budget split across channels for next quarter?"
"Show me the removal effect for each channel in the conversion path"
"Build a Bayesian model to estimate true conversion probability by channel"

What Gets Built

Artifact What It Contains
Model Comparison Side-by-side results from 4+ attribution methodologies
Channel Scorecard True contribution, incremental ROAS, removal effect per channel
Path Analysis Most common conversion paths, avg touchpoints, time to convert
Budget Optimizer Data-backed reallocation recommendations with projected impact
MMM Report Spend elasticity curves, saturation points, diminishing returns
Incrementality Analysis Estimated lift per channel vs. organic baseline

Attribution Models Supported

Model Method Best For
Last Click 100% credit to final touch Baseline comparison
First Click 100% credit to first touch Awareness channel valuation
Linear Equal credit to all touches Simple multi-touch
Time Decay More credit to recent touches Short sales cycles
Position Based 40/20/40 first-middle-last Balanced view
Markov Chain Transition probability removal Channel dependency analysis
Shapley Value Game theory fair allocation True incremental contribution
Bayesian Posterior probability estimation Small data / uncertainty

Tips

  • Start with model comparison — run all models on the same data set so you can see where they agree (high confidence) and disagree (investigate further)
  • Markov chain removal effect — the most actionable single metric; it shows what happens if you completely remove a channel from the path
  • Watch for data gaps — if your CRM doesn't track impressions, your top-of-funnel channels will always look weak
  • Combine with incrementality tests — attribution models estimate; holdout tests prove. Use both.
  • Segment by deal size — enterprise deals have different paths than self-serve signups. Model them separately.

Troubleshooting

Not enough touchpoint data You need at minimum a user ID, channel/source, timestamp, and conversion flag. If you only have aggregate data, use MMM instead of multi-touch attribution.

All models give roughly the same answer Your conversion paths may be short (1-2 touches). Multi-touch attribution matters most when paths are 5+ touchpoints. Check your average path length first.

Results don't match platform reporting Platform attribution is always self-serving. Google will claim credit for views that were going to convert anyway. Your model uses cross-channel data, which is more accurate.

Bayesian model is too uncertain Feed in prior distributions from industry benchmarks. Say: "Use a beta prior of (2, 8) for email conversion rate based on industry average of 20%."

Budget recommendations seem extreme Set constraints: "Reallocate budget but keep each channel within 30% of current spend to avoid disruption."

$Related Playbooks

Marketing & Content

Marketing Strategy Advisor

Build GTM strategies, positioning frameworks, and competitive messaging with a structured product marketing methodology.

15 minutes
Advanced
Marketing & Content

Paid Ads Account Audit Framework

Run a paid-advertising account audit across Google, Meta, TikTok, and nine other platforms with real evidence discipline — a standardized finding schema, honest completeness states (complete/provisional/partial/insufficient-evidence) instead of a fake 100% coverage claim, correct weight renormalization when a platform's data fails to load, and strict separation between observations, diagnoses, recommendations, and draft account-change proposals.

10 minutes
Advanced
Marketing & Content

Multilingual Score

Score localized content quality.

15 minutes
Intermediate
Marketing & Content

Onboarding CRO

Optimize post-signup onboarding, activation, and time-to-value so users actually stick around.

10 minutes
Intermediate
Marketing & Content

Narrative Landscape

Map the competitive narrative landscape.

15 minutes
Intermediate
Marketing & Content

Narrative Tracker

Track AI engine brand narratives.

15 minutes
Intermediate
Marketing & Content

Page Seo Analysis

Analyze SEO for a single page.

15 minutes
Intermediate
Marketing & Content

Paid Advertising

Plan paid advertising campaigns.

15 minutes
Intermediate
Marketing & Content

Original Content Creation Engine

Transform your frameworks and idea cards into complete first drafts that sound like you — with voice calibration, alternative hooks, and Creator's Notes for final editing.

5 minutes
Intermediate
Marketing & Content

Newsletter System

Store your newsletter template, track past issues, and draft new editions that match your voice while avoiding topic repetition.

5 minutes
Beginner
Marketing & Content

Social Media Skills: Your Voice, Reel Scripts and LinkedIn Posts

Teach Claude how you write from an interview and a few samples, then use that voice to script Reels from a reference video, generate hooks, write LinkedIn posts and score drafts

15 minutes
Intermediate
Marketing & Content

Paywall & Upgrade CRO

Create and optimize in-app paywalls, upgrade screens, and feature gates that convert free users to paid.

10 minutes
Intermediate

Browse all Marketing & Content playbooks →