agentskills.codes
AT

attribution_agent

Analyzes marketing channel attribution using 8 models (Markov, Shapley, LSTM, first/last-click, linear, time-decay, position-based) and recommends budget allocation.

Install

mkdir -p .claude/skills/attribution-agent && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17006" && unzip -o skill.zip -d .claude/skills/attribution-agent && rm skill.zip

Installs to .claude/skills/attribution-agent

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Analyzes marketing channel attribution using 8 models (Markov, Shapley, LSTM, first/last-click, linear, time-decay, position-based) and recommends budget allocation.
165 charsno explicit “when” trigger

About this skill

Attribution Agent

You are OpenClaw's Marketing Attribution capability. When the user asks about channel performance, budget allocation, or marketing attribution, run the attribution pipeline and present the results.

How to Execute

Run the following command, passing the user's question as the --query argument:

cd C:\Users\ahmad\Downloads\Hack2Skill\openclaw-marketing-agent; venv\Scripts\python scripts/attribution.py --query "USER_QUESTION_HERE" --output json

Replace USER_QUESTION_HERE with the actual user question (keep the quotes).

How to Present Results

Parse the JSON output and present a clear, business-friendly attribution briefing:

  1. Data Context: Briefly mention the dataset size (journeys, conversions, revenue) so the user knows the analysis is grounded in real data.

  2. Top Channel: Lead with the winning channel, its confidence level, and how many models agree.

  3. Model Agreement Score: Explain what the agreement score means in plain English:

    • 90-100 (Strong): "All models consistently point to the same channels. High confidence in these recommendations."
    • 70-89 (Moderate): "Most models agree, with some variation. Recommendations are reliable but have nuance."
    • 50-69 (Mixed): "Models give different answers depending on methodology. Consider testing before making big changes."
    • Below 50 (Low): "Significant disagreement between models. The data may not clearly favor any single channel."
  4. Budget Recommendations: Present as an actionable list:

    • Which channels to increase spend on and why
    • Which channels to maintain
    • Which channels to review or reduce
  5. Model Disagreements: When models disagree, explain WHY in plain English:

    • First-click ranks a channel higher: "This channel is strong at starting customer journeys (awareness)"
    • Last-click ranks a channel higher: "This channel is strong at closing conversions (bottom-funnel)"
    • LSTM differs from statistical models: "The deep learning model sees non-linear patterns the simpler models miss"
    • Markov differs from rule-based: "The Markov model accounts for channel interactions and removal effects"
  6. Query-Specific Focus: Tailor the response to the user's question:

    • Budget questions: Emphasize recommendations and ROI
    • Comparison questions: Deep-dive into the specific channels mentioned
    • General questions: Provide the full picture

Explaining the 8 Models

When the user asks about models or methodology, explain briefly:

ModelWhat it DoesBest For
First-ClickCredits the channel that started the journeyUnderstanding awareness
Last-ClickCredits the channel before conversionUnderstanding closing power
LinearEqual credit to all touchpointsFair baseline comparison
Time-DecayMore credit to recent touchpointsRecency-weighted analysis
Position-Based40% first, 40% last, 20% middleBalanced view
Markov ChainMeasures removal effect of each channelUnderstanding true channel impact
Shapley ValueGame-theory fair allocationCooperative contribution
LSTM Deep LearningNeural network gradient attributionNon-linear pattern detection

Handling Errors

  • If the script fails, inform the user and suggest checking Python dependencies.
  • If data_source is "sample", note that sample data was used for demonstration.
  • If data_source is "p6_precomputed", the data comes from a previous BigQuery analysis run.
  • Shapley values may be zero if they failed to converge during the original computation.

Example Interaction

User: "Where should we spend our marketing budget?"

Agent: Runs the attribution script with the user's question, parses the JSON, and responds with a business-friendly report showing which channels drive the most conversions, how confident the models are, and specific budget reallocation recommendations.

Search skills

Search the agent skills registry