attribution

A command for building a channel-attribution report from specified dashboard data. Attribution estimates how different marketing channels contributed to visits, conversions, or revenue.

In plain words
What is it for?
Use it to create a React dashboard showing channel sessions, conversions, revenue, cost per click, attribution shares, and related comparisons.
Why use it?
It keeps the report tied to the required source values and clearly distinguishes stored dashboard data from optional live platform data.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/eduardocornelsen/full-funnel-ai-analytics/attribution
Clone the repo
git clone --depth 1 https://github.com/eduardocornelsen/full-funnel-ai-analytics

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 582 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00582
Opus 5 $0.00000 $0.00291
Sonnet 5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

Measured yesterday against content hash 46347e4a0550, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

attribution scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/attribution.md · 26 lines

How it starts

The opening of the file, as written. The whole thing — 26 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Data sourcing (mandatory)

Read dashboards/golden_metrics.jsonwindowed_90d.attribution_by_channel and windowed_90d.channel_performance; copy exact values — never recalculate (CLAUDE.md §14).

  • Attribution shares must sum to 100% — normalise before any pie/donut (§4).
  • Label revenue figures Linear attribution · 90d; first/last-touch columns are for model comparison only.
  • Freshness badge in the header: _meta.window_start_meta.window_end · Data as of _meta.generated_at.

Live MCP variant — only if the user appends -mcp or asks for "live" / "real-time" / "raw platform" data: query the ga4, google-ads, meta-ads MCP servers instead, passing dates from _meta.window_start / _meta.window_end, add the badge ⚡ Live MCP — may differ from golden layer, and use dashboards/js/metrics.js canonical formulas for any computed metric.

Artifact

Build a channel attribution deep-dive React artifact using Recharts.

Design: dark theme (#0d0d1a bg, #1a1a2e cards), coral #f87171, blue #60a5fa, amber #fbbf24, green #34d399.

Include these 7 sections:

  1. Attribution summary cards — Sessions, Conversions, Revenue, Avg CPC per channel
  2. Multi-channel waterfall — grouped bar chart: impressions, clicks, conversions by channel side by side
  3. Efficiency scatter plot — X axis: spend, Y axis: ROAS, bubble size: conversions. One bubble per campaign.
  4. Top/Bottom performers table — top 5 and bottom 5 campaigns by ROAS with color-coded badges
  5. Channel mix over time — stacked area chart showing share of spend by channel week over week
  6. Key insight callout — a highlighted text box summarizing the single biggest optimization opportunity
  7. AI Insights panel — a dark card at the bottom with a "✦ AI Insights" header containing 4–5 bullet points synthesized from attribution data. Each bullet must be specific, quantified, and actionable. Cover: (a) which channel has the best ROAS and is under-allocated relative to spend share, (b) which channel has the worst efficiency and should be cut or restructured, (c) the biggest gap between first-touch and last-touch credit (which channel drives awareness vs closes deals), (d) a CVR anomaly across channels worth investigating, (e) a concrete budget shift recommendation with estimated impact. Write in plain English as if briefing a paid media manager.

Read the full file on GitHub · 26 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 26 lines · 0 tokens per session scan A 46347e4a0550

Subscribe to this mod's changes

attribution is a command published in the GitHub repository eduardocornelsen/full-funnel-ai-analytics (21 stars, last pushed 22d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 582 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.