# incrementality.ai for AI agents

You're an agent (for example Claude Code with a customer's codebase). This is how to work with incrementality.ai: connect its MCP server, instrument a website or app the way it expects, answer questions from the data, and build reports and dashboards the team then sees in the app.

## How incrementality.ai thinks
- **People do things over time.** A person (one profile, joined across devices and tools by their IDs) does **events** (`signed_up`, `post_read`, `order_completed`). **Traits** describe the person (`plan`, `company`) and are kept over time.
- **An event is a name plus its properties, and the properties are the point.** `song_played { song_name: "Creep", band_name: "Radiohead", seconds: 238 }`: the name says what happened, the properties say which one and how. Every question asked later is a property question (plays by song, revenue by plan, signups by offer), so an event without the properties that tell one from another can't be broken down and is nearly useless. Never put the detail in the name (`creep_played`); put it in a property. The message that reached the person is a property too (`offer`, `campaign`, `subject`).
- **Journeys are the core.** A journey is a product's or program's own stages (Aware → Interested → Converted → Engaged → Loyal, named your way). Each stage is reached by events from any source: the site, the app, the server, email tools, CSV imports, even daily counts like ad impressions. Journeys split by the message (a property) and the audience (a trait) to show which message moved whom.
- **Experiments** compare a test group with a control: the product sets a trait (e.g. `checkout_test`) and shows each group its experience; incrementality.ai measures lift and significance.
- **Sources:** the pixel (websites; page views and campaigns are automatic), the collect API (servers, mobile apps), CSV imports, webhook sources (Marketo, SendGrid, Stripe, Shopify…), and daily counts.
- **Test and live:** every source has a **test key** (`pk_test_…`) and a **live key** (`pk_live_…`); the data lands in test or live accordingly, and every query picks one. Test data is free (10,000 messages a day per account, kept 7 days). Live data needs an Analytics plan and counts toward it. Develop with test.
- **Plans:** UTM links are free. Analytics starts on Free: 100k live events a month and 30 days of event history, no card. Then a 90-day free trial (1M live events, card up front) and Startup or Growth, usage-based with a spending cap. Past the allowance, live events are refused (429) until it resets; test data always works.

## Connect
1. A project admin opens the project in incrementality.ai → **Settings → API keys → Create API key**, and picks **Read** (look, instrument and preview links) or **Read & build** (also create links, set up UTM conventions, and create reports, dashboards, journeys and experiments). The key (`ik_live_…`) is shown once.
2. Add the MCP server.

Claude Code:
```
claude mcp add --transport http incrementality https://www.incrementality.ai/api/mcp --header "Authorization: Bearer ik_live_…"
```

Any MCP client (JSON config):
```json
{
  "mcpServers": {
    "incrementality": {
      "type": "http",
      "url": "https://www.incrementality.ai/api/mcp",
      "headers": { "Authorization": "Bearer ik_live_…" }
    }
  }
}
```
Keep the key out of the codebase (an environment variable or the client's secret store). Write keys for sending events (`pk_test_…`, `pk_live_…`) are different: they're publishable and do go in the site or app.

## MCP tools
**Any key (read):**
- `get_project`: start here: the project, its sources (each with its test and live keys), this month's events, the plan, what this key can do, and links into the app.
- `get_usage`: the account's plan, limits, this period's live events and where they're heading (projected events, the date the limit would be reached, the projected bill), today's test messages, and advice. Check it before instrumenting and before going live.
- `get_tracking_plan`: events with their properties, and traits. Read before adding events.
- `recommend_events`: a starter plan by journey stage for a kind of product (content, saas, ecommerce, marketplace, mobile_app, lead_gen), merged with what's already tracked; with `monthly_active_users` it estimates monthly volume against the plan.
- `check_events`: check planned events against the rules and the tracking plan. Fix every error and warning.
- `instrumentation_guide`: install and send code for html, nextjs, react, vue, node, python, server, ios, android, react-native or flutter.
- `estimate_volume`, `send_test_event`, `recent_events`: size the plan, send a test, confirm it arrived.
- `list_saved`: dashboards, reports, journeys, experiments and cohorts, with links.
- `suggest_values`: the values people actually have for a property or trait.
- `run_table`, `run_trend`, `run_funnel`, `run_retention`, `run_journey`, `run_experiment`: answer questions with the same reports as the app; each result has a link that opens it there.
- `get_utm_conventions`: the UTM fields, approved values and pairings (sources under each medium), formatting, URL format and shared link conventions. Start here for links.
- `build_link`: preview a link from named values (no save): the URL, the ad suffix, or exactly what's wrong with the closest approved values.
- `list_links`: saved links, searchable, with short links.

**Build keys also:**
- `create_report`, `create_dashboard`, `add_to_dashboard`, `create_journey`, `create_experiment`: build things the team then sees in the app (they belong to the admin who made the key).
- `describe_event`: document an event in the tracking plan.
- `create_source`: a website or server source, with its test and live keys.
- `create_links`: save tracked links (one, or one per source with `vary`), with short links and ad suffixes; all or nothing.
- `add_values`, `add_channels`: add approved values, or library channels with their usual sources paired to them.
- `update_utm_settings`: fields (on/off, required, list or text, pairing), custom fields, formatting and the URL format.

Keys never delete, send data to other tools, import, roll keys, change domains or members, or send live events. Analytics settings stay with people; build keys can set up UTM naming conventions.

## Working with the person
- **Read before you ask.** Use the code, the site and the tools (get_project, get_tracking_plan, get_utm_conventions, list_saved) first; only ask what they can't tell you.
- **Ask little, with defaults.** One short list at a time, at most five questions, each with your suggestion: "I'll treat a paid order as the conversion unless you say otherwise." Skip what doesn't matter yet.
- **Plan, then act.** Say what you're about to do in a few lines and wait for a yes before anything lasting: new events in their code, new approved values, UTM settings, saved reports and dashboards.
- **Lead with the answer.** The finding or result first, then the evidence: numbers, dates, test or live, and the link. Plain words; explain a term once (attribution, lift) if it matters.
- **Be honest about limits.** Pass on the result's notes in a line (small numbers, a period still in progress, test data, attribution is a model). Say what you couldn't do and why.
- **One next step.** Offer the single most useful thing to do next, not a menu.

## Instrumenting a website or app
Be the tracking-plan expert: propose a small set of events that mark real progress through the journey, follow the rules below, and size it to the plan. Ask before guessing.
1. `get_project`, `get_usage` and `get_tracking_plan`: what exists, the plan and its limits, what this key can do.
2. Ask the person, in one short list, only what the code can't tell you: what they sell and what counts as a conversion; B2B or B2C; web, app or both, and whether there's a server; roughly how many people a month; where users are (consent: EU/UK need opt-in, see the privacy docs); the production domain.
3. `recommend_events` for the kind of product, with `monthly_active_users`. Keep the volume within the plan; cut events that fire on every interaction.
4. Place each event where it really happens in the code; drop what doesn't apply; rename product-specific events. **No codebase?** Read the live site: fetch its pages, map pages, forms, buttons and checkout steps to events, and hand over tag-manager-ready snippets.
5. `check_events` on the final list. Fix every error and warning.
6. `instrumentation_guide` for the stack (web: html, nextjs, react, vue; servers: node, python, server; apps: ios, android, react-native, flutter), and add the code. No website or server source yet? `create_source` with a build key, or ask an admin.
7. `send_test_event` / run it locally, then `recent_events` (test) to confirm what arrived.
8. Going live: the production domain is on the website source (a person adds it under Analytics → Sources), servers and apps use the live key in production, and the plan has room (`get_usage`). Near Free's monthly allowance? Tell the person they can start the 90-day free trial or choose a plan in Account → Billing.
9. With a build key: `describe_event` for each new event, `create_journey` with the stages, and a first dashboard, so the team sees it in the app. Summarise what you added, where, and the expected monthly volume.

## Rules for events
- Name events object first, past tense, snake_case: `signed_up`, `order_completed`. Reuse names already in the tracking plan.
- Every event carries the properties that tell one from another: `plan_selected { plan: "pro" }`, `song_played { song_name, band_name }`, `order_completed { order_id, revenue, currency, items }`. Details go in properties, never in names. One type per property, snake_case names, the same name for the same thing across events (`plan` everywhere, not `plan_name` here and `tier` there). Money events always carry `revenue` and `currency`.
- Track decisions and outcomes, not every interaction: no scrolls, mouse moves or polling. Every live event counts toward the plan, so size the plan with `get_usage` and `recommend_events` (monthly_active_users) before adding events.
- Page views are automatic with the pixel; don't track `page_viewed` yourself.
- Identify once at signup and login with your own stable user ID (never an email as the ID). Personal data goes on the person as traits, never on events. To join email tools, also send `externalId: { kind: "email_sha256", value: sha256(lowercased email) }` from your server.
- Never send passwords, tokens, card numbers or government IDs.
- Payments and anything that must be exact: send from the server, with the order ID as `messageId` so retries count once.
- Websites: one snippet with both keys and the site's domains; it sends live on those domains and test anywhere else (localhost, staging). The live key is refused from other sites (403 `domain_not_allowed`). Servers and apps: test key in development, live key in production, from configuration; never ship the test key to production.
- On 429: a limit was reached (the message says which: per-minute, daily, the account's test allowance, or the plan's live events). Slow down, don't retry in a loop, and tell the person; if there's no plan, ask an admin to start the trial in Account → Billing.

## UTM links
UTM links are free, with or without Analytics. Every project has naming conventions: which fields a link has, which are required, the approved values (sources paired to mediums), how typed text is formatted, and how the values are written into the URL. Agents build links from them, never around them.
1. `get_utm_conventions` and `list_links`: the conventions, and links that already exist.
2. Ask what's being promoted, the landing page, and every placement it'll run in.
3. `build_link` each placement; it names unapproved or unpaired values and suggests the closest. Propose missing values and wait for a yes (`add_values`, `add_channels`).
4. `create_links` (build key), with `vary` for one link per source, then hand back placement → URL, short link, ad suffix.
5. Setting conventions up: ask the channels, sending tools and analytics platform, propose channels, sources, required and custom fields, formatting and URL format, and apply them once agreed (`update_utm_settings`), then show an example link.

## Rules for UTM links
- Build links only from the project's conventions (`get_utm_conventions`): approved values, by code or name. Never invent a value; propose it, wait for a yes, then `add_values` (or `add_channels` for standard channels with their usual sources).
- **Medium** is the visitor's mindstate or channel type (email, paid_social, organic_social, affiliate…); **source** is the specific place (newsletter, linkedin, a partner); **campaign** is the initiative; **content** tells variants of the same placement apart. An influencer's video is not a display ad.
- One link per placement. Search `list_links` first and reuse a link that exists for the same placement.
- Never tag links between pages of the same site: it starts a new visit and steals the credit from the real source.
- No personal data in UTMs (no emails or names).
- Google Ads and Meta: use the link's parameters as the account's Final URL suffix / URL parameters (the `ad_suffix`) rather than tagging each ad.
- Short links are for bios, print, QR codes and SMS. They only redirect; visits are measured by the analytics on the landing page, never by the link.
- URL format: separate utm_ parameters suit GA4 and most tools; one combined code (e.g. Adobe's `cid`) for tools that split one code; one ID for strict privacy (the Campaign IDs page maps IDs back).
- UTM settings changes (fields, formatting, URL format) apply to every future link: confirm with the person first, then `build_link` an example. Nothing is ever deleted; a code or ID set aside by a format switch comes back when switching again. Projects that follow shared link conventions change conventions there (an account admin).

## Answering questions and building for the team
## Rules for insights
- Start from the decision the person is making; if it isn't clear, ask what they'd do differently depending on the answer.
- Compare like with like: the same length of period, full days, the same mode (live for real results).
- Look for change and concentration: what moved against the previous period, the biggest drop in a journey or funnel, and which channel, message or audience drives it (break it down).
- Size before significance: say how many people a difference rests on. Below about 30, it's a hint, not a finding.
- Attribution is a model, not proof: compare models before moving budget, and propose an experiment when the decision is big.
- Experiments: report lift with its 95% range and the verdict; never call a winner the verdict doesn't; check guardrails.
- Give at most three insights, each with its evidence, why it matters, and one action. Offer to save what answers the question on a dashboard.

- Learn the names first (`list_saved`, `get_tracking_plan`, `suggest_values`), then run the matching report. Most questions are about a property of an event (plays by `song_name`, revenue by `plan`): use `prop:<name>` as the dimension or breakdown and a `where` on the property, and `suggest_values` for the exact spellings. Lead the answer with the numbers, say what was measured and over which dates, and include the link.
- Experiments: `run_experiment` returns each group against the control with lift, a 95% range, the p-value and a verdict. Don't call a result a win when it says "too early" or "no clear difference".
- With a build key, save what answers the question and put it on a dashboard (`create_dashboard`, `add_to_dashboard`); share the link.

## First prompts
Website:
```
Use the incrementality MCP server to instrument this site. Read get_project, get_usage and get_tracking_plan, ask me what you can't tell from the code, run recommend_events for our kind of product with our monthly users, place the events in our code, run check_events and fix everything, follow instrumentation_guide for our stack, then confirm with send_test_event and recent_events. Tell me what's needed to go live. Describe each new event and create a journey with the stages.
```
Campaign links:
```
Use the incrementality MCP server to make the tracked links for our spring launch: read get_utm_conventions and list_links, ask me where it'll run, propose one link per placement (ask before adding any new value), create them, and give me a table with each URL, short link and ad suffix.
```
No codebase (just the site):
```
Use the incrementality MCP server to plan tracking for https://our-site.com. Crawl the site, map pages, forms, buttons and checkout steps to events, check them with check_events, and give me tag-manager snippets with the right keys.
```
Mobile app:
```
Use the incrementality MCP server to instrument this app (iOS/Android/React Native/Flutter). Same steps; use instrumentation_guide for our platform, keep an anonymousId on the device, identify on sign-in, and batch events.
```
Analysis:
```
Using incrementality, which message moved the most people from signup to paid last month, and for whom? Build a dashboard with what you find.
```

## More
- Every docs page: https://www.incrementality.ai/llms.txt (index) and https://www.incrementality.ai/llms-full.txt (all of it). Any page as Markdown: https://www.incrementality.ai/learn/<page>.md
- Collect API: https://www.incrementality.ai/learn/collect-api.md · Connect your tools: https://www.incrementality.ai/learn/connect-tools.md
