Respuesta rápida
- Qué es
- attribution es una skill de Corey Haines (licencia MIT) que le enseña a Claude a responder qué esfuerzos de marketing causan de verdad tus ventas, cuando Meta, Google, Analytics y tu CRM dan números distintos.
- Qué le das
- La decisión que quieres tomar, los números que reporta cada plataforma, tu CRM o sistema de ventas y cómo es tu ciclo de venta
- Qué te devuelve
- Un informe de atribución con la fuente de verdad, lo que dice cada fuente, la comparación de modelos, las zonas ciegas y una recomendación de inversión con su nivel de confianza
- Autor
- Corey Haines
- Licencia
- MIT
- Repositorio
- coreyhaines31/marketingskills
- En GitHub
- 60,6 mil estrellas · actualizada el
- Revisada por Claura
Instálala en una línea para todos tus proyectos, en Claude Code, Cursor, Codex y más:
npx skills add coreyhaines31/marketingskills --skill attribution -g
Funciona en
~/.claude/skills/~/.agents/skills/~/.agents/skills/~/.agents/skills/Pedidos para probarla
Con la skill instalada, copia uno y pégaselo a tu agente tal cual, o cambia los datos por los tuyos.
Meta dice que trajo 120 ventas y Google 90, pero vendimos 150: explícame por qué no suman y cómo leerlo.
Arma una forma simple de saber qué canal trae los clientes de mi estudio de arquitectura, con lo que tengo hoy (GA4 y un formulario).
Propón una pregunta de «cómo nos conociste» para el formulario y cómo cruzarla con los datos de las plataformas.
#Qué hace
attribution es la skill de Corey Haines para decidir qué canales merecen el presupuesto. Separa dos trabajos. El primero, de interpretación, sirve a cualquiera: una tabla de siete modelos (primer contacto, último contacto, último contacto no directo, lineal, decaimiento en el tiempo, por posición con 40 % al primero, 40 % al último y 20 % al medio, y basado en datos) con para qué sirve cada uno y cómo miente; tres formas de medir (atribución por recorrido del usuario, modelos de mezcla de medios que piden de 2 a 3 años de datos semanales, y pruebas de incrementalidad con zonas o grupos que no ven los anuncios); la encuesta de cómo te conoció; y un método de seis pasos para conciliar fuentes que no coinciden. Marca también las zonas ciegas donde se esconden las ventas: el tráfico directo, las búsquedas de tu marca, lo compartido por mensajes y lo que llega desde asistentes de IA.
El segundo trabajo es para quien controla su web y quiere armar su propia atribución. Explica cómo unir la navegación anónima con la conversión llamando a la función identify() en cada venta o registro, y cómo hacerlo cuando la conversión ocurre en un dominio que no controlas (una reserva en Calendly o Cal.com, un pago en Stripe): se pasa el identificador anónimo en el enlace, la herramienta lo devuelve en su aviso automático y tu servidor une las dos cosas. Trae reglas de seguridad para no mezclar perfiles (nunca pasar un correo en la URL) y para que las redirecciones de pago o de inicio de sesión no pisen el origen real. El ejemplo resuelto usa PostHog y SavvyCal, pero la idea sirve con cualquier herramienta.
Distingue además por tipo de negocio (B2B de ciclo largo contra ecommerce de ciclo corto) y entrega un informe con formato fijo: la pregunta, la fuente de verdad, lo que dice cada fuente sin sumarlas, la comparación de modelos, las zonas ciegas y la recomendación. El detalle está en cuatro archivos de referencia: modelos, formas de medir, playbooks por tipo de negocio y atribución propia.
#Cómo aplicarla a tu negocio
Caso de ejemplo: una pyme de software contable en México que capta demos con Google Ads, Meta, LinkedIn y un webinar mensual. En un mes, Google reclama 40 demos, Meta 35 y LinkedIn 12, pero el CRM registra 45 demos reales (cifras de ejemplo). El dueño quiere saber dónde poner el presupuesto del próximo trimestre.
- Una fuente de verdad. La skill fija el CRM como el número que manda: fueron 45 demos, no 87. Lo que reclaman las plataformas se presenta al lado, sin sumar, con la explicación de por qué se superponen (cada una cuenta con su propia ventana y cuenta también a quien solo vio el anuncio).
- Dos modelos lado a lado. Con los datos del CRM compara primer y último contacto. En el ejemplo, LinkedIn aparece mucho más como primer contacto que como último: inicia conversaciones que después cierra una búsqueda de marca en Google.
- La pregunta que faltaba. Se suma al formulario de demo «¿cómo nos conociste?», con opciones y un campo libre. En las primeras semanas aparece una respuesta que ningún panel mostraba: recomendación de un contador por WhatsApp.
- Recomendación con confianza. El informe cierra con un reparto sugerido, el nivel de confianza de cada parte y la prueba que vale la pena correr para desempatar, por ejemplo apagar LinkedIn durante un mes en una región y comparar.
#Cómo instalarla
Es una skill que corre en cualquier agente, con cuatro archivos de referencia en su carpeta.
- Con una línea, para cualquier agente:
npx skills add coreyhaines31/marketingskills --skill attribution -gla deja instalada en todos tus proyectos. - A mano: copia la carpeta
skills/attribution/completa a~/.claude/skills/para Claude Code, o a~/.agents/skills/para Cursor, Codex y Gemini CLI. - App de Claude: comprime la carpeta en un ZIP y súbela desde Customize, Skills, «Upload a skill».
La parte de interpretación no necesita nada más: alcanza con pegarle los números. La atribución propia supone que tienes acceso al código de tu web y una herramienta de analítica con identificación de usuarios (PostHog, Segment, Amplitude o GA4 con identificador de usuario). El repositorio documenta conectores para GA4, HubSpot, Dub y Supermetrics. Las instrucciones están en inglés: pídele la salida en español.
El SKILL.md completo (con la licencia y la fuente) está más abajo.
El SKILL.md completo
Skill original de Corey Haines (MIT). Fuente: github.com/coreyhaines31/marketingskills/tree/main/skills/attribution.
El archivo original está en inglés y va tal cual, sin traducir. Lo de arriba de esta ficha es el resumen en español: qué hace, cómo aplicarla y cómo instalarla.
Leer el archivo (234 líneas)
Attribution
You help users answer the hardest question in marketing: which of my efforts actually caused this conversion and this revenue? Attribution is where marketers lose the most money — to channels that look good in one dashboard and terrible in another, to "direct" and "branded search" that hide the real source, and to models that quietly encode an opinion as if it were fact.
This skill has two pillars. Know which one the user needs before you dive in:
- (A) Interpretation — choosing an attribution model, picking a measurement approach, and reconciling the conflicting numbers your tools report. This applies to everyone, even with zero engineering.
- (B) Own your attribution (first-party) — instrumenting and stitching attribution yourself when you control the site/app. This is the build track. Use it when the user says "I want to track this myself" or is hitting a conversion that lives on a domain they don't own.
Most requests start with (A). Reach for (B) only when they control the surface and want to build.
Product context: check for .agents/product-marketing.md and read it if present — business type, sales cycle, and primary conversion drive almost every recommendation here.
Boundaries — what this skill does NOT own
State these up front so you don't rebuild neighboring skills:
- General event tracking, tracking plans, UTM setup, GA4/GTM → analytics. Attribution assumes tracking exists. The line: analytics = "what events and how to fire them"; attribution = "how touches join to conversions and survive to revenue."
- Ad-platform pixels, CAPI, server-side conversion tracking → conversion-tracking. Attribution consumes platform-reported numbers and corrects for their bias; it doesn't set up the pixels.
- Pipeline stages, lead lifecycle, CRM revenue dashboards → revops. Attribution feeds pipeline data; it doesn't define stages.
- Showing up in / measuring AI search → ai-seo. Attribution names AI traffic as a blind spot only.
Pillar A — Interpretation
1. What attribution can and can't tell you
Set expectations before touching a number:
- Attribution is directional, not truth. It's a model of causality built from incomplete data (cookies expire, sessions fragment, offline touches vanish, people research on one device and buy on another). Treat it as a strong hint, never a verdict.
- Every model is an opinion. "First-touch" says the first ad gets all the credit; "last-touch" says the closing click does. Both are wrong in opposite directions. Choosing a model is choosing whose story to believe — say so out loud.
- The attribution gap is normal, so separate outcomes from credit. The sum of channel-reported conversions almost always exceeds real conversions, because every platform claims the same sale under its own attribution window and view-through rules. Count real conversions once, deduplicated against one source of truth, and explain platform credit separately. The two won't tie out, and a modeled allocation never replaces the conversion ledger.
When a user demands one true number, reframe: "We can get you a defensible, consistent number and a read on which channels are trending up. A single objective truth doesn't exist — here's why, and here's what we use to make decisions anyway."
2. Attribution models
The classic rule-based set plus data-driven — and when each one lies. Last non-direct is a last-touch variant (skip the junk drawer), not a separate school of thought.
| Model | Credit rule | Best for | How it lies |
|---|---|---|---|
| First-touch | 100% to the first known touch | Top-of-funnel / demand-gen valuation; short cycles | Ignores everything that closed the deal; over-credits awareness channels |
| Last-touch | 100% to the last touch before conversion | Direct-response, quick e-comm | Over-credits bottom-funnel + branded search/direct; ignores what created demand |
| Last non-direct | 100% to last touch, skipping "direct" | A cheap fix for direct pollution | Still single-touch; just moves the blind spot |
| Linear | Equal credit to every touch | Long, multi-touch journeys where every step matters | Treats a throwaway visit like a demo; flatters high-frequency channels |
| Time-decay | More credit to touches nearer conversion | Longer cycles where recency matters | Under-credits the top of funnel; still an assumption, not a measurement |
| Position-based (U-shaped) | 40% first, 40% last, 20% middle | B2B with clear "created" + "closed" moments | The 40/40/20 split is arbitrary; middle touches get shortchanged |
| Data-driven (algorithmic/Shapley) | Credit from modeled marginal contribution | High-volume accounts with enough conversions | A black box; needs volume; can't see offline/dark touches it was never fed |
Platform availability note: Google Ads and GA4 retired first-click, linear, time-decay, and position-based as selectable reporting models (2023). Those UIs offer data-driven and last-click (plus GA4's paid-channels last-click variant). Teach the full table as concepts and as models you can compute on your own event path / CRM / warehouse — not as Google dropdown options.
Rules of thumb:
- Never report a single model in isolation for a long sales cycle. Show first-touch and last-touch side by side — the truth lives between them, and the gap between them is the insight.
- Data-driven attribution needs volume. Google Ads historically gated DDA behind ~3,000 ad interactions and ~300 conversions in 30 days; hard minimums are gone and DDA is the default, but Google still recommends ~200 conversions and ~2,000 ad interactions in 30 days for quality. Below that, DDA often collapses toward last-click priors — noise dressed as science. On Google/GA4 when thin: prefer last-click (or accept that DDA ≈ last-click). Elsewhere (first-party / CRM / warehouse): compute position-based or first+last side by side.
- The model matters far less than being consistent and pairing it with an out-of-model sanity check (Pillar A §4, self-reported).
For the model math, worked examples of one journey scored six rule-based ways, and Shapley explained plainly, see references/attribution-models.md.
3. The three measurement paradigms
Models split credit within your tracked data. Paradigms are how you get at causality — increasingly rigorous, increasingly expensive:
| Paradigm | What it is | Answers | Needs | Watch out |
|---|---|---|---|---|
| MTA (multi-touch attribution) | Stitch user-level touches, apply a model | "Which touchpoints appear on converting journeys?" | Clean cross-device user-level tracking | Cookie loss + privacy gut user-level data; click-paths systematically over-weight search/direct and under-weight impression channels |
| MMM (media/marketing mix modeling) | Top-down regression of spend vs. outcomes over time | "What's each channel's aggregate contribution, including offline/brand?" | 2–3 yrs of weekly data, spend variation | Correlational; slow to react; needs real budget swings to learn |
| Incrementality (geo holdout, PSA, ghost ads, on/off) | Controlled experiment: exposed vs. withheld | "Did this channel cause lift I wouldn't have gotten anyway?" | Ability to withhold; enough volume for significance | The gold standard, but you can only test a few things at a time |
How to choose: small budget / short cycle → good UTM + last-non-direct + a self-reported survey beats a fancy model. Mid budget, several channels → MTA for day-to-day + periodic incrementality tests on your biggest line items. Large budget, offline + brand spend → MMM for the portfolio + incrementality to validate MMM's coefficients. Incrementality is the tiebreaker whenever two channels both claim the same conversions.
Decision table by budget × sales cycle × channel count, and how to read a geo-holdout / PSA test (not a stats tutorial), in references/measurement-paradigms.md.
4. Self-reported attribution
The most underused signal, and often the most honest for long cycles and dark social. A post-conversion "How did you hear about us?" survey catches what tracking structurally cannot: podcasts, word of mouth, Slack communities, a founder's tweet, "a friend told me."
- When it beats tracking: long consideration cycles, high word-of-mouth, brand/community-led, or heavy dark-social (see §5). If a big slice of your journeys are "direct," you have a self-reported-shaped hole.
- Ask at the moment of conversion (signup, first purchase, demo request) — highest recall, before memory fades.
- Wording: open-ended ("How did you first hear about us?") captures dark social; a short pick-list is easier to quantify but pre-biases the answer. Best practice: pick-list of your known channels plus a free-text "other/tell us more."
- Treat it as a triangulation input, not gospel — recall is fuzzy and people credit the memorable touch, not the first. Discount survey share when turning it into credit (e.g. 22% recall of YouTube is evidence of awareness, not a claim that YouTube deserves 22% of conversions). Pair with incrementality / platform deltas before writing an allocation rule.
- On the build side, this is a form field written to your CRM/analytics as a person property — see Pillar B and
references/first-party-tracking.md.
5. Reconciling conflicting sources
The request behind most attribution work: "Google says 50, Meta says 40, GA says 60, my CRM says 35 — who's right?" Nobody is. Here's the framework.
Why each source systematically lies:
| Source | Biased toward | Because |
|---|---|---|
| Ad platforms (Google/Meta/LinkedIn) | Over-counts itself | Claims view-through + click conversions in its own window; every platform counts the same sale; motivated to look good |
| GA / web analytics | Last non-direct click | Loses cross-device, loses cookie-blocked users, dumps the unknown into direct |
| CRM | Whatever the rep typed / the form captured | Human entry, lead-source overwrites, offline deals with no digital trail |
| Self-reported survey | The memorable touch | Recall bias; under-counts boring-but-real touches like retargeting |
How to triangulate:
- Pick one source of truth for the conversion count — usually your CRM or backend (the system where money is real). Everything else explains where those came from, they don't get to redefine how many.
- Never sum across platforms. If Google and Meta both claim a conversion, you have one conversion with two claimants, not two conversions. De-dupe against the source-of-truth total.
- Read directional agreement, not absolute match. If every source says paid search is up and organic is down this quarter, that trend is trustworthy even though no two numbers match.
- Use self-reported as the tiebreaker when platforms fight over the same conversions, and incrementality when the stakes justify a test. Do not turn a platform-vs-GA gap into a multiplier rule (Meta claims 2× GA ≠ "double Meta") — investigate windows and view-through, then ground any override in incrementality.
- Expect and budget for the gap. Report "platforms claim N; we can verify M; the delta is over-claiming + view-through + untracked — here's our best allocation."
- Operationalize triangulation as rules when you can — once you have a holdout or a trusted survey band for a channel, apply a documented channel-level override on reporting (shift credit from Direct/branded into the under-credited channel for the test window) rather than pretending raw MTA is truth. Details in
references/measurement-paradigms.md.
The output is an honest allocation with confidence levels, not a false reconciliation to the decimal.
6. The blind spots
Where conversions hide, making real channels look weak:
- Direct — the junk drawer. Bookmarks and typed URLs, yes, but also stripped referrers, app-to-web, dark social, and any touch your tracking dropped. A large direct share can include genuine direct visits, repeat users, and measurement loss. Investigate its composition before treating it as a tracking defect.
- Branded search — people who discovered you elsewhere and Googled your name. Last-touch hands the credit to paid/organic branded search; the real driver was whatever made them search. Segment branded vs. non-branded or you'll defund the top of funnel.
- Dark social — sharing that carries no referrer: DMs, Slack/Discord, podcasts, newsletters, screenshots. Structurally invisible to tracking; self-reported is the only way to see it (§4).
- AI traffic — assistants and AI search increasingly influence buyers, then send them via branded search or direct, so the AI touch is invisible in analytics. Name it and hand deeper work to ai-seo.
When direct and branded search dominate, the most common explanation is a top of funnel that's working while attribution hides it. Confirm before concluding: rule out existing customers, lost referrers, and offline discovery, then check self-reported attribution or run an incrementality test. It's the most common misread in marketing in both directions, so say which one the evidence supports.
7. Business-type fork
Defaults differ sharply. Summary here; full playbooks in references/by-business-type.md.
- B2B SaaS (long cycle, sales-assisted): journeys span weeks–months and multiple people, so single-touch models mislead badly. Anchor on the CRM as source of truth, use first-touch + position-based side by side, lean hard on self-reported at demo/signup, and treat pipeline/revenue attribution (→ revops) as the real scoreboard. Offline touches (events, sales convos) make MTA weakest and self-reported strongest here.
- Ecommerce / DTC (short cycle, self-serve): fast journeys, high volume, spend concentrated in paid social + search. Anchor on platform ROAS but distrust it (iOS/CAPI inflation), validate with MMM once spend is material and incrementality/geo-holdouts on your biggest channels, and use a post-purchase survey to catch what pixels miss. Last-touch is defensible for quick-turn SKUs; MMM+incrementality is how you allocate the real budget.
Pillar B — Own your attribution (first-party)
Use this when the user controls the site/app and wants to instrument attribution themselves — especially for a conversion that happens on a domain they don't own (a SavvyCal/Calendly/Cal.com booking, a Stripe Checkout page). This pillar is grounded in real production builds; the full runbook with code patterns is in references/first-party-tracking.md. The essentials:
The identity graph
First-party attribution is one idea: join anonymous browsing to the eventual conversion.
- A visitor arrives anonymously; your analytics tool assigns an anonymous
distinct_idand stamps first-touch properties ($initial_referrer,$initial_utm_*) on their events. - At conversion (signup, booking, purchase) you call
identify()with a stable id (email or user UUID). This merges the anonymous history into a known person — first-touch now survives all the way to the conversion. - Every conversion event can now be broken down by first-touch channel. That's the whole game.
Closing the identify() gap
The most common first-party failure: nothing ever calls identify(), so conversions never join to browsing history and every customer looks like they appeared from nowhere. (Framing adapted from Tessa Kriesel's PostHog approach.) The fix is to call identify at each real conversion. Audit first — many SaaS apps already identify at signup; don't rebuild what works. Find the specific un-instrumented conversions and close only those.
Stitching conversions on a third-party domain
The one case that needs real machinery: a conversion that completes on a domain you don't control (a booking tool, a hosted checkout). You can't run your analytics there, so:
- At click time, a capture-phase link decorator appends the visitor's anonymous
distinct_idto the outbound URL via the tool's metadata passthrough (e.g.?metadata[ph_distinct_id]=<id>). One document-level listener covers every CTA — no per-link edits. - The third-party tool stores that metadata and returns it in its webhook.
- Your webhook handler fires an identity merge (
$identifywith the booking email asdistinct_idand the smuggled anonymous id as$anon_distinct_id) plus a conversion event — joining the booking back onto the marketing journey.
Guardrails (do not skip)
- Anonymity guard — fail closed. Only ever smuggle the anonymous id. After
identify(), the current id becomes the user's email/UUID; leaking that into a third-party URL or merging on it corrupts profiles (person A's email folds into whoever books). Reject ids that look like PII (contain@), cap length, and when identity is ambiguous, send nothing. If the app identifies by UUID, testdistinct_id === device_idrather than an@check. - First-touch data quality. Redirects overwrite the true first touch. Exclude OAuth/checkout referrers (
accounts.google.com,checkout.stripe.com,login.*), your own subdomains (self-referrals), and dev hosts (localhost) from referrer classification. This is usually a settings change, not code, and it's the highest-trust-per-effort fix. - Cross-subdomain stitching. Marketing site → app on a subdomain must share one analytics project + a cross-subdomain cookie, or the journey breaks at the handoff. Expect near-zero numbers until the stitch is verified in prod — don't panic at empty data; use a campaign-window heuristic fallback and backfill the pre-stitch cohort in the meantime (details in the reference).
Reporting and the last mile
The first payoff is one insight: your conversion event broken down by first-touch channel ($initial_utm_source / $initial_referring_domain), and — joined to revenue — channel → conversion → revenue. Confirm first-touch vs. last-touch config in the tool (many default to last-touch; first-party attribution wants $initial_*).
But first-touch alone can't run the multi-touch models from §2. Store the full ordered touch path (not just $initial_*) and the build track feeds the interpretation track — you can score your own journeys position-based / linear / time-decay instead of only reading about them.
The last mile — get it into the CRM (production refinement from Tessa Kriesel). A breakdown in an analytics tool is a report; sales and lifecycle act on attribution written onto the record. Sync a source field with confidence and basis (journey-linked vs self-reported vs campaign-window fallback) plus a Paid-vs-Organic read off the medium, rolled up to the account (not just the contact — one B2B org is several people with mixed work/personal emails). How pipeline/lifecycle then use it is revops' job.
The pattern is tool-agnostic: identify + merge exists in PostHog, Segment, Amplitude, and via user-id in GA4; the third-party stitch works with any tool that has a metadata passthrough + webhook. PostHog + SavvyCal are the worked example in references/first-party-tracking.md.
Output format
Deliver an attribution readout, not a data dump:
# Attribution Readout — [date]
## The question
[What decision this informs — e.g. "where should next quarter's budget go?"]
## Source of truth
[Which system defines the conversion count, and why]
## What each source says
| Channel | Platform-reported | GA | CRM | Self-reported | Our read |
|---------|------------------|----|----|--------------|----------|
[De-duped against source of truth; not summed]
## Model comparison (for long cycles)
[First-touch vs last-touch side by side; the gap is the insight]
## Confidence & gaps
[The attribution gap, the blind spots, what we can't see]
## Recommendation
[Allocation call with confidence levels; the tiebreaker test worth running]
Tool Integrations
For implementation, see the tools registry. Key tools:
| Tool | Best For | MCP | Guide |
|---|---|---|---|
| PostHog | First-party attribution, identify/merge, funnels | - | posthog.md |
| GA4 | Web analytics, model comparison, user-id stitching | ✓ | ga4.md |
| Dub | Short-link + click attribution | ✓ | dub-co.md |
| Segment | CDP — route identify/track to every destination | - | segment.md |
| HubSpot | CRM lead-source + self-reported fields | ✓ | hubspot.md |
| Salesforce | CRM as revenue source of truth | - | salesforce.md |
| Supermetrics | Pull platform numbers into one place to reconcile | ✓ | supermetrics.md |
| RB2B | De-anonymize B2B website visitors | - | rb2b.md |
Related Skills
- analytics — event tracking, tracking plans, UTMs, GA4/GTM setup. Do this before attribution.
- conversion-tracking — ad-platform pixels, CAPI, server-side conversion tracking, and tracking audits.
- revops — pipeline stages, lead lifecycle, CRM revenue reporting. Attribution feeds it.
- ai-seo — the AI-search attribution blind spot in depth.
- ab-testing — controlled experiments; the incrementality mindset applied to on-site changes.
Copiar el archivo tal cual
---
name: attribution
description: "When the user wants to work out which marketing drives revenue, or asks whether a channel is really working, which numbers to trust, or how to credit podcasts and dark social: attribution models, platforms that over-claim, MMM, incrementality and holdout tests, self-reported attribution. For tracking and UTMs, see analytics. For pixels and CAPI, see conversion-tracking. For CRM revenue, see revops. For AI search blind spots, see ai-seo."
metadata:
version: 1.1.9
---
<!--
Skill original: attribution, de Corey Haines (https://github.com/coreyhaines31/marketingskills/tree/main/skills/attribution)
Licencia: MIT. Reproducida con atribución según los términos de la licencia.
Copia publicada en claura-ai.com/skills.
-->
# Attribution
You help users answer the hardest question in marketing: **which of my efforts actually caused this conversion and this revenue?** Attribution is where marketers lose the most money — to channels that look good in one dashboard and terrible in another, to "direct" and "branded search" that hide the real source, and to models that quietly encode an opinion as if it were fact.
This skill has two pillars. Know which one the user needs before you dive in:
- **(A) Interpretation** — choosing an attribution model, picking a measurement approach, and *reconciling the conflicting numbers* your tools report. This applies to everyone, even with zero engineering.
- **(B) Own your attribution (first-party)** — instrumenting and stitching attribution *yourself* when you control the site/app. This is the build track. Use it when the user says "I want to track this myself" or is hitting a conversion that lives on a domain they don't own.
Most requests start with (A). Reach for (B) only when they control the surface and want to build.
Product context: check for `.agents/product-marketing.md` and read it if present — business type, sales cycle, and primary conversion drive almost every recommendation here.
## Boundaries — what this skill does NOT own
State these up front so you don't rebuild neighboring skills:
- **General event tracking, tracking plans, UTM setup, GA4/GTM** → **analytics**. Attribution *assumes tracking exists*. The line: analytics = "what events and how to fire them"; attribution = "how touches join to conversions and survive to revenue."
- **Ad-platform pixels, CAPI, server-side conversion tracking** → **conversion-tracking**. Attribution consumes platform-reported numbers and corrects for their bias; it doesn't set up the pixels.
- **Pipeline stages, lead lifecycle, CRM revenue dashboards** → **revops**. Attribution feeds pipeline data; it doesn't define stages.
- **Showing up in / measuring AI search** → **ai-seo**. Attribution names AI traffic as a blind spot only.
---
## Pillar A — Interpretation
### 1. What attribution can and can't tell you
Set expectations before touching a number:
- **Attribution is directional, not truth.** It's a model of causality built from incomplete data (cookies expire, sessions fragment, offline touches vanish, people research on one device and buy on another). Treat it as a strong hint, never a verdict.
- **Every model is an opinion.** "First-touch" says the first ad gets all the credit; "last-touch" says the closing click does. Both are wrong in opposite directions. Choosing a model is choosing whose story to believe — say so out loud.
- **The attribution gap is normal, so separate outcomes from credit.** The sum of channel-reported conversions almost always exceeds real conversions, because every platform claims the same sale under its own attribution window and view-through rules. Count real conversions once, deduplicated against one source of truth, and explain platform credit separately. The two won't tie out, and a modeled allocation never replaces the conversion ledger.
When a user demands one true number, reframe: "We can get you a *defensible, consistent* number and a read on which channels are trending up. A single objective truth doesn't exist — here's why, and here's what we use to make decisions anyway."
### 2. Attribution models
The classic rule-based set plus data-driven — and when each one lies. **Last non-direct** is a last-touch variant (skip the junk drawer), not a separate school of thought.
| Model | Credit rule | Best for | How it lies |
|---|---|---|---|
| **First-touch** | 100% to the first known touch | Top-of-funnel / demand-gen valuation; short cycles | Ignores everything that closed the deal; over-credits awareness channels |
| **Last-touch** | 100% to the last touch before conversion | Direct-response, quick e-comm | Over-credits bottom-funnel + branded search/direct; ignores what created demand |
| **Last non-direct** | 100% to last touch, skipping "direct" | A cheap fix for direct pollution | Still single-touch; just moves the blind spot |
| **Linear** | Equal credit to every touch | Long, multi-touch journeys where every step matters | Treats a throwaway visit like a demo; flatters high-frequency channels |
| **Time-decay** | More credit to touches nearer conversion | Longer cycles where recency matters | Under-credits the top of funnel; still an assumption, not a measurement |
| **Position-based (U-shaped)** | 40% first, 40% last, 20% middle | B2B with clear "created" + "closed" moments | The 40/40/20 split is arbitrary; middle touches get shortchanged |
| **Data-driven (algorithmic/Shapley)** | Credit from modeled marginal contribution | High-volume accounts with enough conversions | A black box; needs volume; can't see offline/dark touches it was never fed |
**Platform availability note:** Google Ads and GA4 retired first-click, linear, time-decay, and position-based as selectable reporting models (2023). Those UIs offer **data-driven** and **last-click** (plus GA4's paid-channels last-click variant). Teach the full table as *concepts* and as models you can compute on your own event path / CRM / warehouse — not as Google dropdown options.
**Rules of thumb:**
- Never report a single model in isolation for a long sales cycle. Show **first-touch and last-touch side by side** — the truth lives between them, and the gap between them *is* the insight.
- Data-driven attribution needs volume. Google Ads historically gated DDA behind ~3,000 ad interactions and ~300 conversions in 30 days; hard minimums are gone and DDA is the default, but Google still recommends ~**200 conversions and ~2,000 ad interactions** in 30 days for quality. Below that, DDA often collapses toward last-click priors — noise dressed as science. On Google/GA4 when thin: prefer last-click (or accept that DDA ≈ last-click). Elsewhere (first-party / CRM / warehouse): compute position-based or first+last side by side.
- The model matters far less than being **consistent** and pairing it with an out-of-model sanity check (Pillar A §4, self-reported).
For the model math, worked examples of one journey scored six rule-based ways, and Shapley explained plainly, see `references/attribution-models.md`.
### 3. The three measurement paradigms
Models split credit *within* your tracked data. Paradigms are how you get at *causality* — increasingly rigorous, increasingly expensive:
| Paradigm | What it is | Answers | Needs | Watch out |
|---|---|---|---|---|
| **MTA** (multi-touch attribution) | Stitch user-level touches, apply a model | "Which touchpoints appear on converting journeys?" | Clean cross-device user-level tracking | Cookie loss + privacy gut user-level data; click-paths systematically over-weight search/direct and under-weight impression channels |
| **MMM** (media/marketing mix modeling) | Top-down regression of spend vs. outcomes over time | "What's each channel's aggregate contribution, including offline/brand?" | 2–3 yrs of weekly data, spend variation | Correlational; slow to react; needs real budget swings to learn |
| **Incrementality** (geo holdout, PSA, ghost ads, on/off) | Controlled experiment: exposed vs. withheld | "Did this channel *cause* lift I wouldn't have gotten anyway?" | Ability to withhold; enough volume for significance | The gold standard, but you can only test a few things at a time |
**How to choose:** small budget / short cycle → good UTM + last-non-direct + a self-reported survey beats a fancy model. Mid budget, several channels → MTA for day-to-day + periodic incrementality tests on your biggest line items. Large budget, offline + brand spend → MMM for the portfolio + incrementality to validate MMM's coefficients. Incrementality is the tiebreaker whenever two channels both claim the same conversions.
Decision table by budget × sales cycle × channel count, and how to *read* a geo-holdout / PSA test (not a stats tutorial), in `references/measurement-paradigms.md`.
### 4. Self-reported attribution
The most underused signal, and often the most honest for long cycles and dark social. A post-conversion "How did you hear about us?" survey catches what tracking structurally cannot: podcasts, word of mouth, Slack communities, a founder's tweet, "a friend told me."
- **When it beats tracking:** long consideration cycles, high word-of-mouth, brand/community-led, or heavy dark-social (see §5). If a big slice of your journeys are "direct," you have a self-reported-shaped hole.
- **Ask at the moment of conversion** (signup, first purchase, demo request) — highest recall, before memory fades.
- **Wording:** open-ended ("How did you first hear about us?") captures dark social; a short pick-list is easier to quantify but pre-biases the answer. Best practice: pick-list of your known channels **plus a free-text "other/tell us more."**
- **Treat it as a triangulation input, not gospel** — recall is fuzzy and people credit the *memorable* touch, not the first. **Discount survey share when turning it into credit** (e.g. 22% recall of YouTube is evidence of awareness, not a claim that YouTube deserves 22% of conversions). Pair with incrementality / platform deltas before writing an allocation rule.
- On the build side, this is a form field written to your CRM/analytics as a person property — see Pillar B and `references/first-party-tracking.md`.
### 5. Reconciling conflicting sources
The request behind most attribution work: **"Google says 50, Meta says 40, GA says 60, my CRM says 35 — who's right?"** Nobody is. Here's the framework.
**Why each source systematically lies:**
| Source | Biased toward | Because |
|---|---|---|
| **Ad platforms** (Google/Meta/LinkedIn) | Over-counts *itself* | Claims view-through + click conversions in its own window; every platform counts the same sale; motivated to look good |
| **GA / web analytics** | Last non-direct click | Loses cross-device, loses cookie-blocked users, dumps the unknown into direct |
| **CRM** | Whatever the rep typed / the form captured | Human entry, lead-source overwrites, offline deals with no digital trail |
| **Self-reported survey** | The *memorable* touch | Recall bias; under-counts boring-but-real touches like retargeting |
**How to triangulate:**
1. **Pick one source of truth for the conversion count** — usually your CRM or backend (the system where money is real). Everything else explains *where those came from*, they don't get to redefine *how many*.
2. **Never sum across platforms.** If Google and Meta both claim a conversion, you have one conversion with two claimants, not two conversions. De-dupe against the source-of-truth total.
3. **Read directional agreement, not absolute match.** If every source says paid search is up and organic is down this quarter, that trend is trustworthy even though no two numbers match.
4. **Use self-reported as the tiebreaker** when platforms fight over the same conversions, and **incrementality** when the stakes justify a test. Do **not** turn a platform-vs-GA gap into a multiplier rule (Meta claims 2× GA ≠ "double Meta") — investigate windows and view-through, then ground any override in incrementality.
5. **Expect and budget for the gap.** Report "platforms claim N; we can verify M; the delta is over-claiming + view-through + untracked — here's our best allocation."
6. **Operationalize triangulation as rules when you can** — once you have a holdout or a trusted survey band for a channel, apply a documented **channel-level override** on reporting (shift credit from Direct/branded into the under-credited channel for the test window) rather than pretending raw MTA is truth. Details in `references/measurement-paradigms.md`.
The output is an honest allocation with confidence levels, not a false reconciliation to the decimal.
### 6. The blind spots
Where conversions hide, making real channels look weak:
- **Direct** — the junk drawer. Bookmarks and typed URLs, yes, but also stripped referrers, app-to-web, dark social, and any touch your tracking dropped. A large direct share can include genuine direct visits, repeat users, and measurement loss. Investigate its composition before treating it as a tracking defect.
- **Branded search** — people who discovered you elsewhere and Googled your name. Last-touch hands the credit to paid/organic *branded* search; the real driver was whatever made them search. Segment branded vs. non-branded or you'll defund the top of funnel.
- **Dark social** — sharing that carries no referrer: DMs, Slack/Discord, podcasts, newsletters, screenshots. Structurally invisible to tracking; self-reported is the only way to see it (§4).
- **AI traffic** — assistants and AI search increasingly influence buyers, then send them via branded search or direct, so the AI touch is invisible in analytics. Name it and hand deeper work to **ai-seo**.
When direct and branded search dominate, the most common explanation is a top of funnel that's working while attribution hides it. Confirm before concluding: rule out existing customers, lost referrers, and offline discovery, then check self-reported attribution or run an incrementality test. It's the most common misread in marketing in both directions, so say which one the evidence supports.
### 7. Business-type fork
Defaults differ sharply. Summary here; full playbooks in `references/by-business-type.md`.
- **B2B SaaS (long cycle, sales-assisted):** journeys span weeks–months and multiple people, so single-touch models mislead badly. Anchor on the **CRM as source of truth**, use **first-touch + position-based** side by side, lean hard on **self-reported at demo/signup**, and treat **pipeline/revenue** attribution (→ revops) as the real scoreboard. Offline touches (events, sales convos) make MTA weakest and self-reported strongest here.
- **Ecommerce / DTC (short cycle, self-serve):** fast journeys, high volume, spend concentrated in paid social + search. Anchor on **platform ROAS but distrust it** (iOS/CAPI inflation), validate with **MMM once spend is material** and **incrementality/geo-holdouts** on your biggest channels, and use a **post-purchase survey** to catch what pixels miss. Last-touch is defensible for quick-turn SKUs; MMM+incrementality is how you allocate the real budget.
---
## Pillar B — Own your attribution (first-party)
Use this when the user **controls the site/app** and wants to instrument attribution themselves — especially for a conversion that happens on a **domain they don't own** (a SavvyCal/Calendly/Cal.com booking, a Stripe Checkout page). This pillar is grounded in real production builds; the full runbook with code patterns is in `references/first-party-tracking.md`. The essentials:
### The identity graph
First-party attribution is one idea: **join anonymous browsing to the eventual conversion.**
1. A visitor arrives anonymously; your analytics tool assigns an **anonymous `distinct_id`** and stamps **first-touch properties** (`$initial_referrer`, `$initial_utm_*`) on their events.
2. At conversion (signup, booking, purchase) you call **`identify()`** with a stable id (email or user UUID). This **merges** the anonymous history into a known person — first-touch now survives all the way to the conversion.
3. Every conversion event can now be broken down by first-touch channel. That's the whole game.
### Closing the `identify()` gap
The most common first-party failure: **nothing ever calls `identify()`**, so conversions never join to browsing history and every customer looks like they appeared from nowhere. (Framing adapted from Tessa Kriesel's PostHog approach.) The fix is to call identify at each real conversion. **Audit first** — many SaaS apps already identify at signup; don't rebuild what works. Find the *specific* un-instrumented conversions and close only those.
### Stitching conversions on a third-party domain
The one case that needs real machinery: a conversion that completes on a domain you don't control (a booking tool, a hosted checkout). You can't run your analytics there, so:
1. **At click time**, a capture-phase link decorator appends the visitor's anonymous `distinct_id` to the outbound URL via the tool's **metadata passthrough** (e.g. `?metadata[ph_distinct_id]=<id>`). One document-level listener covers every CTA — no per-link edits.
2. The third-party tool stores that metadata and returns it in its **webhook**.
3. Your **webhook handler** fires an **identity merge** (`$identify` with the booking email as `distinct_id` and the smuggled anonymous id as `$anon_distinct_id`) plus a **conversion event** — joining the booking back onto the marketing journey.
### Guardrails (do not skip)
- **Anonymity guard — fail closed.** Only ever smuggle the *anonymous* id. After `identify()`, the current id becomes the user's email/UUID; leaking that into a third-party URL or merging on it corrupts profiles (person A's email folds into whoever books). Reject ids that look like PII (contain `@`), cap length, and when identity is ambiguous, **send nothing**. If the app identifies by UUID, test `distinct_id === device_id` rather than an `@` check.
- **First-touch data quality.** Redirects overwrite the true first touch. Exclude OAuth/checkout referrers (`accounts.google.com`, `checkout.stripe.com`, `login.*`), your own subdomains (self-referrals), and dev hosts (`localhost`) from referrer classification. This is usually a settings change, not code, and it's the highest-trust-per-effort fix.
- **Cross-subdomain stitching.** Marketing site → app on a subdomain must share one analytics project + a cross-subdomain cookie, or the journey breaks at the handoff. Expect **near-zero numbers until the stitch is verified in prod** — don't panic at empty data; use a campaign-window heuristic fallback and backfill the pre-stitch cohort in the meantime (details in the reference).
### Reporting and the last mile
The first payoff is one insight: your **conversion event broken down by first-touch channel** (`$initial_utm_source` / `$initial_referring_domain`), and — joined to revenue — **channel → conversion → revenue**. Confirm first-touch vs. last-touch config in the tool (many default to last-touch; first-party attribution wants `$initial_*`).
But first-touch alone can't run the multi-touch models from §2. **Store the full ordered touch path** (not just `$initial_*`) and the build track feeds the interpretation track — you can score your own journeys position-based / linear / time-decay instead of only reading about them.
**The last mile — get it into the CRM** (production refinement from Tessa Kriesel). A breakdown in an analytics tool is a report; sales and lifecycle act on attribution *written onto the record*. Sync a **`source` field with `confidence` and `basis`** (journey-linked vs self-reported vs campaign-window fallback) plus a **Paid-vs-Organic read** off the medium, **rolled up to the account** (not just the contact — one B2B org is several people with mixed work/personal emails). How pipeline/lifecycle then *use* it is **revops**' job.
The pattern is tool-agnostic: identify + merge exists in PostHog, Segment, Amplitude, and via user-id in GA4; the third-party stitch works with any tool that has a metadata passthrough + webhook. PostHog + SavvyCal are the worked example in `references/first-party-tracking.md`.
---
## Output format
Deliver an **attribution readout**, not a data dump:
```markdown
# Attribution Readout — [date]
## The question
[What decision this informs — e.g. "where should next quarter's budget go?"]
## Source of truth
[Which system defines the conversion count, and why]
## What each source says
| Channel | Platform-reported | GA | CRM | Self-reported | Our read |
|---------|------------------|----|----|--------------|----------|
[De-duped against source of truth; not summed]
## Model comparison (for long cycles)
[First-touch vs last-touch side by side; the gap is the insight]
## Confidence & gaps
[The attribution gap, the blind spots, what we can't see]
## Recommendation
[Allocation call with confidence levels; the tiebreaker test worth running]
```
## Tool Integrations
For implementation, see the [tools registry](https://github.com/coreyhaines31/marketingskills/blob/main/tools/REGISTRY.md). Key tools:
| Tool | Best For | MCP | Guide |
|------|----------|:---:|-------|
| **PostHog** | First-party attribution, identify/merge, funnels | - | [posthog.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/posthog.md) |
| **GA4** | Web analytics, model comparison, user-id stitching | ✓ | [ga4.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/ga4.md) |
| **Dub** | Short-link + click attribution | ✓ | [dub-co.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/dub-co.md) |
| **Segment** | CDP — route identify/track to every destination | - | [segment.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/segment.md) |
| **HubSpot** | CRM lead-source + self-reported fields | ✓ | [hubspot.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/hubspot.md) |
| **Salesforce** | CRM as revenue source of truth | - | [salesforce.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/salesforce.md) |
| **Supermetrics** | Pull platform numbers into one place to reconcile | ✓ | [supermetrics.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/supermetrics.md) |
| **RB2B** | De-anonymize B2B website visitors | - | [rb2b.md](https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/rb2b.md) |
---
## Related Skills
- **analytics** — event tracking, tracking plans, UTMs, GA4/GTM setup. Do this *before* attribution.
- **conversion-tracking** — ad-platform pixels, CAPI, server-side conversion tracking, and tracking audits.
- **revops** — pipeline stages, lead lifecycle, CRM revenue reporting. Attribution feeds it.
- **ai-seo** — the AI-search attribution blind spot in depth.
- **ab-testing** — controlled experiments; the incrementality mindset applied to on-site changes.
Preguntas frecuentes sobre la skill attribution
¿Qué es la skill attribution y para qué sirve?
attribution es una skill de Corey Haines (github.com/coreyhaines31/marketingskills, licencia MIT) para la pregunta más difícil del marketing: qué causó esta venta. Tiene dos partes. La primera es de interpretación y no pide programar: elegir un modelo de atribución, elegir cómo medir (atribución por recorrido, modelos de mezcla de medios o pruebas de incrementalidad) y conciliar números que no coinciden. La segunda es para quien controla su web y quiere armar la atribución propia, unir la visita anónima con la venta y llevar el origen al CRM. Su punto de partida: la atribución orienta, no es la verdad.
¿Cómo la aplico cuando Meta, Google y mi CRM dicen cosas distintas?
Es el caso para el que está hecha. Primero eliges una sola fuente de verdad para contar las ventas, casi siempre el CRM o el sistema donde entra el dinero. Las demás explican de dónde vinieron, pero no cambian cuántas fueron. Nunca sumas lo que dice cada plataforma: si Google y Meta reclaman la misma venta, es una venta con dos candidatos. Lees la tendencia en la que coinciden, no el número exacto, y usas una encuesta de «¿cómo nos conociste?» o una prueba de incrementalidad para desempatar. Lo que sale es un reparto honesto con nivel de confianza. Antes de esto necesitas la medición en orden, que es el trabajo de analytics.
¿En qué se diferencia del modelo que trae Google Analytics?
GA4 y Google Ads ya solo ofrecen el modelo basado en datos y el de último clic: los de primer clic, lineal, por tiempo y por posición se retiraron en 2023. La skill te explica los siete modelos como conceptos que puedes calcular con tus propios datos y cómo miente cada uno, y te pide mostrar primer y último contacto lado a lado en ciclos largos, porque la diferencia entre los dos es lo que importa. También avisa que el modelo basado en datos necesita volumen: Google recomienda unas 200 conversiones y 2.000 interacciones en 30 días, y por debajo de eso se parece mucho al último clic.
¿Sirve si vendo por WhatsApp o mis clientes llegan por recomendación?
Sí, y ahí es donde más ayuda. La skill llama «tráfico social oscuro» a lo que se comparte sin dejar rastro: mensajes directos, grupos, podcasts, capturas. En Latinoamérica y España, WhatsApp es justo eso. La única forma de verlo que propone es la atribución autodeclarada: una pregunta de cómo te conoció al momento de la compra o la consulta, con una lista de canales y un campo libre, guardada en el CRM. Pide no tomarla como verdad absoluta (la gente recuerda el contacto más memorable) y cruzarla con otras fuentes. La skill está en inglés: pídele el informe en español. Para montarlo con nosotros, mira analítica de marketing.
Más skills de Automatización

analytics: armar el plan de medición de tu web con GA4, GTM y UTMs
Arma o audita el plan de medición de tu web: qué eventos medir, cómo nombrarlos, cómo instalarlos en GA4 o GTM y cómo etiquetar los enlaces con UTMs.

cro: encontrar por qué tu página no convierte y qué cambiar primero
Analiza una página o un formulario y te dice por qué no convierte, qué cambiar primero y qué vale la pena probar antes de darlo por hecho.

marketing-loops: armar rutinas de marketing que un agente corre solo y con frenos
Convierte tareas de marketing que haces a mano (y olvidas) en rutinas que un agente corre cada semana o ante un evento, con un control antes de actuar, memoria entre corridas y un punto donde se frena.
Para seguir con este tema
- Guía de Ventas y CRMEl orden para empezar y las notas de este tema.Guía
- Skills de Claude y ChatGPT para analítica y reportesLas skills de Claude para analítica y reportes: plan de medición en GA4, conversiones de anuncios, atribución, KPIs y tableros. Cómo usarlas en Claude y en ChatGPT.Skill
- Sistema de contenido y CRM: leads medibles antes de lanzarAntes de lanzar tu marca, un sistema de contenido y CRM ya puede mostrarte cuántos leads reales entran y quedan registrados, con casos verificables.Nota
AI KID
RE/MAX Patagon
Mateo Caño