agentlyticsby measuremy.site

Connect your AI agent

Not set up yet? Paste this and your agent does everything below
Add agentlytics analytics to this project. Follow the instructions at measuremy.site/llms.txt

Each site has a read key. Your agent uses it to read that site's analytics over MCP (Model Context Protocol) and to create campaign links. It can't change your account or billing. The key is shown once when you add a site; generate a new one any time from the site's Setup tab, which also shows these commands with your key filled in.

Claude Code

claude mcp add --scope user --transport http agentlytics https://a.measuremy.site/mcp --header "Authorization: Bearer YOUR_READ_KEY"

Restart Claude Code, or run /mcp to reconnect. claude mcp list should show agentlytics as connected. --scope user makes it available in every project.

If a tool call says the server rejected the Authorization header, the read key in your config is out of date (it changes when you rotate it on the Setup tab or re-run agent setup for the same domain). Run claude mcp remove agentlytics, add it again with the new key, then /mcp to reconnect. A running session keeps the old key until you do.

Cursor

Add to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects:

{
  "mcpServers": {
    "agentlytics": {
      "url": "https://a.measuremy.site/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_READ_KEY"
      }
    }
  }
}

Codex

Add to ~/.codex/config.toml:

[mcp_servers.agentlytics]
url = "https://a.measuremy.site/mcp"
bearer_token_env_var = "AGENTLYTICS_READ_KEY"

and run export AGENTLYTICS_READ_KEY=YOUR_READ_KEY in the shell that starts codex.

Share your analytics: /make-public

Agent setup through /llms.txt adds two slash commands. /make-public publishes a dashboard of your traffic, spikes and what caused them at https://measuremy.site/share/your-domain; growth actions, campaigns and setup stay private. /make-private turns it off. To add them by hand, save the text below as .claude/commands/make-public.md (Claude Code), .cursor/commands/make-public.md (Cursor) or ~/.codex/prompts/make-public.md (Codex, run as /prompts:make-public):

Make this site's agentlytics analytics public: call the agentlytics MCP tool set_public_dashboard with public=true. Then give me the public link and say in one line that it shows traffic, spikes and what caused them, while growth actions stay private.

Without the command, just ask: "make my analytics public". In Claude Code it's also available as /mcp__agentlytics__make-public.

What to ask

  1. Understand. "Give me an overview of the last 30 days and explain the biggest traffic spike."
  2. Ask about visitors. "How many iOS visitors from the US did we get last week?" "Where do my Firefox users come from?" "Show the last 10 signups with their country and browser." The agent calls query_visits and recent_visits.
  3. Plan. "Use the plan_marketing prompt" or "Plan this week's marketing from what's working."
  4. Execute. "Write the posts, make a tracked link for each, and log what we ship." The agent calls create_tracked_link and add_annotation, and can edit pages in your repo directly.
  5. Measure. A few days later: "Which campaigns worked?" The agent calls get_campaign_results and suggests what to repeat or stop.

Ask about your visits

Two tools answer questions about who visits and what they do. query_visits counts the pageviews (or custom events) and unique visitors that match your filters, and can break the result down. recent_visits lists the latest individual visits. Your agent picks the arguments from your question, so you can just ask in plain words.

ArgumentWhat it does
rangeHow far back: 24h, 7d, 30d (up to 90d). Default 7d.
countryA code such as US or a name such as United States. XX or Unknown is traffic whose country isn't known.
browser, osBrowser: Chrome, Firefox, Safari, Edge, Opera, Samsung Internet. System: Windows, macOS, iOS, Android, Linux, ChromeOS. Visits from before this was tracked are Unknown.
source, referrerThe UTM source (else the referring site, else (direct)), or just the referring site such as news.ycombinator.com.
pageAn exact path like /pricing, or a prefix ending in * like /blog/*.
event, typeA custom event name such as signup. type is pageview, event or any.
group_byquery_visits only: country, browser, os, source, referrer, page, event, day or hour.
limitRows to return, up to 50.

Examples: signups per country is event=signup, group_by=country. Where Safari visitors come from is browser=Safari, group_by=source. Daily views of the pricing page is page=/pricing, group_by=day.

Only counts and the details above come back. agentlytics stores no IP addresses or user agents, so your agent can't see them. Each visit row has a short visitor code that changes every day: it shows which rows on the same day came from one browser, nothing more.

All tools

get_overviewVisitors, pageviews and change vs the previous period. Start here.
get_timeseriesTraffic by hour or day
find_traffic_spikes / explain_spikeEvery jump, with the sources, pages and events behind it, plus the AI explanation
top_sources / top_pages / list_eventsRanked breakdowns
top_countries / top_browsers / top_systemsWhere visitors are from and what they use, as on the dashboard
query_visitsCount visits and visitors that match filters (country, browser, OS, source, page, event), optionally grouped by one of them or by day or hour
recent_visitsThe latest individual visits, with the same filters. No IP addresses or user agents are stored
get_whats_workingChannels ranked by conversions and growth, growing pages, recurring spike causes
get_growth_actionsA ranked action list built from your own numbers
create_tracked_linkA tracked link for every post, email or ad your agent ships
set_public_dashboardShare a public dashboard of traffic, spikes and their causes, or make it private again. Also available as the make-public and make-private prompts
get_campaign_resultsWhat each campaign actually brought in
add_annotationLog a deploy, launch, post, email or ad so spikes are attributed to it

Plus the plan_marketing prompt, which walks the agent through evidence → plan → execute → measure.