# Humblytics agent setup

Humblytics gives you analytics, heatmaps, funnels, ad attribution and A/B tests through a hosted MCP server: `https://mcp.humblytics.com/v1`. Do everything through its tools. New accounts start free with the first **5,000 data points** and 1 site, no card. Tool calls are never metered.

**Chat apps** such as Claude or ChatGPT can't run these steps. Tell the person to add the Humblytics connector instead: https://claude.ai/directory/connectors/humblytics-mcp, or add `https://mcp.humblytics.com/v1` as a custom connector.

---

## Step 1: Get a key

### If the person's message includes a signup code that starts with `hbl_`

They are already signed in to Humblytics and copied the prompt from the app. Do this first and skip sign-up:

```
POST https://app.humblytics.com/api/v1/auth/agent-link
Content-Type: application/json

{ "code": "hbl_..." }
```

The response has `apiKey`, the account `email`, its `sites`, and the `site` they want to set up. Go to Step 2. If it answers `code_used`, `code_expired` or `code_invalid`, ask them to copy a fresh prompt in the app, or follow the last section below.

### If the person's message includes a signup code that starts with `hbs_`

They already confirmed they are human, so they only open one link and click Allow.

```
POST https://app.humblytics.com/api/v1/auth/agent-initiate
Content-Type: application/json

{ "email": "user@example.com", "name": "Jane Smith", "handoffCode": "hbs_..." }
```

The response has a `token` and a `url`. Do steps 2 and 3 of the next section with them: send the `url`, then poll with the `token` until it is approved. If the response has no `token`, follow the next section.

### Otherwise

This works for new and existing accounts. The person signs up or signs in on the page you send them.

1. `POST https://app.humblytics.com/api/mcp/authorize` with no body returns `{ "token", "url" }`.
2. **Send the full `url` as a normal chat message, on its own line, before you start polling.** Text in your reasoning or tool calls may not be visible to them, and a command's output may be collapsed. If you are on their own computer, also open it with `open "<url>"` on macOS or `xdg-open "<url>"` on Linux.
3. Poll `GET https://app.humblytics.com/api/mcp/poll/<token>` every 3 to 5 seconds, in the background if your tools allow it, until `status` is `approved`. Give up after 5 minutes and offer to start again. The response includes `apiKey`, delivered once.

Never print the key in chat, commit it or write it to a project file.

---

## Step 2: Connect the MCP server

**Claude Code:**

```
claude mcp add --transport http --scope user humblytics https://mcp.humblytics.com/v1 --header "Authorization: Bearer <apiKey>"
```

**Any other client:** add a remote MCP server over HTTP with the URL `https://mcp.humblytics.com/v1` and the header `Authorization: Bearer <apiKey>`, in the way that client configures MCP servers.

If you aren't allowed to change the configuration, give the person the command to run themselves. In Claude Code they can type it after `!` at the prompt.

---

## Step 3: Load the tools

Check for the Humblytics tools, such as `get_account_status`. A server added during a session may not be available yet. If they are missing, stop and ask the person to:

- **Claude Code:** type `/mcp reconnect humblytics`. If that doesn't connect it, quit and run `claude --continue`.
- **Other clients:** reload MCP servers, or start a new chat and paste their original request again.

Tell them they only need to do this once, then carry on with their request when the tools appear.

---

## Step 4: Set up the site

1. Call `get_account_status`.
2. Call `create_property` with their site. If it says the site isn't reachable, tell them before installing anything.
3. Install the snippet it returns, verbatim, in the `<head>` of every page. If you can edit the site's code, work on a branch and open a pull request. Otherwise tell them exactly where to paste it for their platform.
4. Call `get_install_status` until the status is `live`. `installed_waiting_for_first_pageview` means they need to open their site once.
5. If the person says no to publishing the snippet, or you have no way to add code on their platform, call `report_setup` with `publish_declined` or `cannot_install` (and their platform), so their Humblytics setup screen shows the next step instead of waiting.

**A/B tests:** read the page yourself to find the selector, and use `get_split_test_recommendations` when they ask what to test. `create_split_test` saves the test as a draft: it goes live to real visitors only after the person approves it, so confirm the change, page and goal with them first. If your client supports confirmation prompts you will be asked in chat and they confirm there. Otherwise post the `approval_url` from the response as a normal chat message, then poll `get_split_test` until `status` is `active`. If approving answers `launch_not_allowed`, test launching is off for this key: tell them to approve the test from the `approval_url` in Humblytics, or turn launching back on for the key in Settings, API keys. A test stops by itself after 30 days unless they choose fewer. To make a test from one drafted from their website audit, pass its `draft_id` with no `variants`: Humblytics finds the copy on the page and builds the change, still as a draft for them to approve. If it answers `copy_not_found_on_page`, find the selector yourself and send `page` and `variants` with the same `draft_id`. Never publish or merge without their approval.

---

## Plans

| Plan | Price | Data points | When it runs out |
|------|-------|-------------|------------------|
| Free start | $0, no card | first 5,000 (one time), 1 site | tracking pauses until a plan is bought |
| Agents | $39 one time, not a subscription | 100,000 prepaid, valid 12 months, unlimited sites | top up: $29 per 100,000, each block valid 12 months |
| Business / Scale | $79 / $279 per month | 500K / 1M a month, plus the full dashboard | upgrade prompt |

A data point is one tracked event: a pageview, click, form submission, custom or revenue event.

Do not ask the person to pay to get started. Mention the Agents plan through `get_agents_checkout_link` only when they ask about limits, want a second site, or `get_account_status` shows `approaching_limit`, `past_limit` or `paused`. Never buy anything or change auto top-up unless they ask.

---

## Support

If setup fails, a tool keeps erroring, or the person asks for help, contact **support@humblytics.com**. Draft the email for them:

- Subject: "Humblytics support: <one line>"
- Body: the account email, the site's domain, what you tried, and the exact error.
- Never include keys or tokens.

If you have an email tool, send the draft only after they approve it.
