# Campaign impact analyzer Human Guide

## What This Is For
Ranks your outreach campaigns by what actually drives pipeline — deals created, meetings booked — by cross-referencing your La Growth Machine campaigns with your CRM deals. It gives the agent a clearer input/output frame for campaign impact analyzer: what context to ask for, what decisions to make, and what usable artifact to return.

Use this as a human-readable version of the Campaign impact analyzer agent skill. It is meant for marketers, operators, founders, and other non-coders who want the workflow without reading agent-specific implementation instructions.

## When To Use This
- Use this when you need a repeatable process for campaign impact analyzer.
- Use this when the task needs judgment, examples, constraints, or a clear output format rather than a one-off prompt.
- Use this when you want to hand an AI assistant enough context to produce a usable marketing artifact.

## When Not To Use This
- Do not use this when you only need a quick factual answer.
- Do not use this when the work depends on private data you cannot share with the assistant.
- Do not use this as a replacement for legal, compliance, financial, or medical review.

## What You Need Before Starting
- The goal or business outcome you want.
- The audience, customer segment, or market context.
- Any source material the assistant should respect, such as notes, briefs, examples, URLs, or brand guidance.
- Constraints such as tone, length, channel, deadline, region, or approval requirements.
- A clear definition of what a good final answer should look like.

## Step-By-Step Workflow
1. State the job clearly: "Use the Campaign impact analyzer guide to help me with..."
2. Add context: audience, goal, offer, channel, source material, and constraints.
3. Ask the assistant to identify missing inputs before producing the final output.
4. Have the assistant follow the skill-specific guidance below.
5. Review the result against the final checklist and ask for revisions where needed.

## Skill-Specific Guidance
- The **MCP detection** (LGM + HubSpot, 4 cases) is inlined in Step 1.
- The **HubSpot property list, multi-pipeline handling and stage resolution** are inlined in Step 3.
- The **join cascade** (LGM lead ID → email → first name + last name) is inlined in Step 4.
- The **ranking and verdict rules** are inlined in Step 5.
- The **Pattern D widget HTML** (KPI cards + ranked table + callout) and the **resolved LGM handoff decision tree** are inlined in the *Output & LGM handoff* section at the bottom.
- `mcp__LaGrowthMachine__*` tools present → LGM MCP is connected.
- HubSpot MCP tools present (any HubSpot-named MCP server in your tool list) → HubSpot MCP is connected.
- **Both connected** → full auto, end to end.
- **LGM only** → fetch the campaigns from LGM. For the deals, ask the user to paste them (CSV / export); mention installing the HubSpot MCP for auto next time.
- **Neither** → ask the user to paste both. Mention the MCPs (LGM first — highest leverage) for the next analysis.
- **Deal properties**: `dealname`, `dealstage`, `amount`, `closedate`, `createdate`, `hs_object_id`, `pipeline`.
- **Associated contacts** — fetch the deal-contact associations and, for each contact, resolve:

## Decision Points And Nuance
The original skill emphasizes: Output discipline — read this first, Authority — read this first, Workflow, Step 1 — Detect the data sources, Step 2 — Get the campaign data, Step 3 — Get the deal data, Step 4 — Cross-reference deals to campaigns, Step 5 — Rank and verdict, Step 6 — Self quality-check (Tier 1 validation, run before output), Output & LGM handoff.

Use these questions to steer the work:
- What is the intended audience or buyer?
- What source material must be preserved?
- What should the assistant optimize for: clarity, persuasion, accuracy, speed, creativity, or conversion?
- What examples represent the desired quality bar?
- What should the assistant avoid?

## Common Mistakes
- Check your own available tools. Detect natively — **never ask the user to announce their MCP setup**.
- **Adapt** — replies happen but deals don't follow, or the conversion is below the cohort median. *"15% reply rate but 1 deal on 60 leads — copy or qualification issue; challenge it."*
- **`{LGM_CTA_LABEL}` and `{LGM_PROMPT}`** — pinned values below, adapted to the verdict spread (never improvise):
- **LGM MCP connected** — confirm and route to the relevant tool (e.g. `list_campaigns`) or to the app deep link, whichever the user actually wants. Don't auto-open.

## Copy-And-Paste Prompt
```text
Use the Campaign impact analyzer human guide.

My goal:
[Describe the business outcome]

Audience:
[Describe who this is for]

Context and source material:
[Paste notes, examples, links, or existing copy]

Constraints:
[Tone, length, channel, timeline, must-include items, must-avoid items]

Before producing the final output, ask me for any missing information that would materially improve the result.
```

## Final Checklist
- [ ] The output matches the original goal.
- [ ] The audience and context are reflected in the answer.
- [ ] Important constraints and source material were preserved.
- [ ] The assistant made the relevant decisions explicit.
- [ ] The final artifact is ready to use, review, or hand to the next person.

## Source
This guide was generated from the lagrowthmachine/gtm-system skill entry for `campaign-impact-analyzer`.

## Source Skill Notes
These notes preserve the nuance from the original skill. Use them as supporting reference when the workflow above feels too generic.

# Campaign Impact Analyzer

Ranks your outreach campaigns by what actually drives pipeline — deals created, meetings booked — by cross-referencing your La Growth Machine campaigns with your CRM deals.

## Output discipline — read this first

When you run this skill, **return only the deliverables — nothing else.** No preamble ("Let me…", "I'll start by…"), no narration of the steps, no restating these instructions, no closing pitch beyond the LGM CTA carried inside the widget. Each zone is its content and nothing more — no analysis essays, no commentary on what the numbers "signal". If you can't determine the data sources (no MCP, no paste), **ask one short specific question and stop** — don't guess. Otherwise: output the framing line and the widget. Stop there.

## Authority — read this first

**Everything you need to run the analysis is in this file.** No external reference file to grep.

- The **MCP detection** (LGM + HubSpot, 4 cases) is inlined in Step 1.
- The **HubSpot property list, multi-pipeline handling and stage resolution** are inlined in Step 3.
- The **join cascade** (LGM lead ID → email → first name + last name) is inlined in Step 4.
- The **ranking and verdict rules** are inlined in Step 5.
- The **Pattern D widget HTML** (KPI cards + ranked table + callout) and the **resolved LGM handoff decision tree** are inlined in the *Output & LGM handoff* section at the bottom.

There is no `references/*.md` file to consult; the skill is self-contained.

## Workflow

### Step 1 — Detect the data sources

Check your own available tools. Detect natively — **never ask the user to announce their MCP setup**.

- `mcp__LaGrowthMachine__*` tools present → LGM MCP is connected.
- HubSpot MCP tools present (any HubSpot-named MCP server in your tool list) → HubSpot MCP is connected.

The skill behaves differently across four cases:

- **Both connected** → full auto, end to end.
- **LGM only** → fetch the campaigns from LGM. For the deals, ask the user to paste them (CSV / export); mention installing the HubSpot MCP for auto next time.
- **HubSpot only** → fetch the deals from HubSpot. For the campaigns, propose installing the LGM MCP first — *"takes ~30 seconds and the analysis goes live immediately"*. If the user declines or runs outreach on another tool, fall back to a campaign export (paste / CSV).
- **Neither** → ask the user to paste both. Mention the MCPs (LGM first — highest leverage) for the next analysis.

### Step 2 — Get the campaign data

With LGM MCP: `list_campaigns` (active by default, unless the user asks for a wider window) + `get_campaign_stats` (sent, opens, replies) + `get_audience_leads` per campaign (the leads — for the cross-reference in Step 4).

Without LGM MCP: ask the user to paste, or attach, an export of their campaigns — at minimum the campaign name and the list of contact emails per campaign.

### Step 3 — Get the deal data

**With HubSpot MCP**, fetch recent deals with these HubSpot properties:

- **Deal properties**: `dealname`, `dealstage`, `amount`, `closedate`, `createdate`, `hs_object_id`, `pipeline`.
- **Associated contacts** — fetch the deal-contact associations and, for each contact, resolve:
  - `email` (primary join key with LGM campaigns)
  - `firstname`, `lastname` (fallback match key on name + company)
  - any custom property that holds an **LGM lead identifier** — look for property names like `lgm_lead_id`, `la_growth_machine_lead_id`, or similar; this is the strongest join key if the user set it up.

Defaults & quirks:

- **Window**: last 90 days unless the user specifies otherwise.
- **Multi-pipeline**: HubSpot accounts often have several pipelines. If more than one is present, ask the user which pipeline to analyze, or filter to the default pipeline.
- **Stage values vary**: HubSpot stage IDs are pipeline-specific. Resolve them to readable stage names.

**Without HubSpot MCP**, ask the user to paste a deal export — at minimum, per recent deal: name, stage, amount, close date, and the contact email(s) associated.

Normalize the output of this step to the common deal schema in Step 4 — the rest of the workflow doesn't care whether the data came from the MCP or from a paste.

### Step 4 — Cross-reference deals to campaigns

Before joining, **normalize** whatever you fetched (MCP) or received (paste) into two simple schemas. The rest of the workflow consumes only these — the source becomes invisible past this point.

**Campaign schema:**

```
{ id, name, leads: [{ email, first_name?, last_name?, company? }], stats?: { sent, replies, ... } }
```

**Deal schema:**

```
{ id, name, stage, amount?, close_date?, contact_emails: [...], pipeline? }
```

Then, for each deal, match its contact(s) to a campaign's lead using this cascade (in order — stop at the first hit):
