How to Attribute Email Clicks to Subject Lines with marginal
Knowing which subject line earned a click is the difference between guessing and optimizing. This how-to guide walks through using marginal's email MCP server to run a subject line A/B test and tie click activity back to the exact line that drove it — all from your AI agent.
Why attribution starts at the subject line
A subject line's job is to earn the open, but the open alone doesn't tell you whether the line attracted the right reader. By measuring clicks per variant inside a controlled test, you can attribute downstream engagement to the specific subject line that delivered it.
marginal handles the send, the tracking, and the variant bookkeeping for you. Because each recipient is assigned to a single subject line within a test, every tracked click maps cleanly back to its variant — no spreadsheet reconciliation required.
- Opens measure curiosity; clicks measure relevance and intent.
- Per-variant click tracking turns raw numbers into attribution.
- Within-test lift shows the relative impact of one line over another.
Step 1: Generate and launch a subject line A/B test
Connect marginal to your MCP client — Cursor, Claude Desktop, Claude Code, Windsurf, Cline, Continue, Zed, or OpenAI Codex — and authenticate with your Bearer API key. Then prompt your AI agent to draft candidate subject lines and start the experiment.
Use generate_variants to produce a handful of distinct subject lines for the same campaign, then launch_test to send them across a randomized split of your list. marginal manages the send and begins recording opens and clicks immediately.
- Call generate_variants with your campaign goal and audience context.
- Review the candidates, then pass the keepers to launch_test.
- Each variant is sent to a clean, non-overlapping segment for fair attribution.
Step 2: Read click results and attribute the lift
Once recipients start engaging, call get_results to pull open and click metrics broken out by variant. This is where attribution happens: the click-through numbers are already tied to the subject line each recipient received, so you can see exactly which line moved people to act.
marginal reports within-test lift, so you don't just see that Variant B got more clicks — you see how much more, relative to the others in the same send. That comparison is what lets you confidently attribute click performance to a subject line rather than to timing, list quality, or seasonality.
- Compare click-through rate per variant, not just total clicks.
- Use within-test lift to quantify the gap between winning and losing lines.
- Let the data run until differences stabilize before declaring a winner.
Step 3: Let your agent recommend the next move
After attribution, close the loop with recommend_next. Your AI agent reads the click-based results and proposes the next experiment — doubling down on the winning angle, testing a sharper hook, or retiring lines that underperformed.
This turns AI agent email marketing into a continuous cycle: generate, launch, attribute, and iterate. The free tier covers 100 experiments per month, which is plenty to build a reliable picture of what your subject lines actually earn. Full setup details live in the marginal docs.
- recommend_next suggests the follow-up test based on observed click lift.
- Iterate on the winning line's tone, length, or framing.
- Endpoint: https://marginal.sh/mcp · Docs: https://marginal.sh/docs/
Get started with marginal
marginal is a hosted email marketing MCP server at marginal.sh. Sign up free, create an API key, and connect https://marginal.sh/mcp from Cursor, Codex, or Claude Desktop.
- 100 experiments/month on the free tier
- Four MCP tools: generate_variants, launch_test, get_results, recommend_next
- Listed in the MCP Registry as sh.marginal/mcp