Agent Analytics

Analytics your AI agent can actually use. Track, analyze, run A/B experiments, and optimize across all your projects via CLI. Includes a growth playbo

What Is Agent Analytics?

Agent Analytics is a modern analytics platform designed specifically for AI agents and developers who need actionable insights across multiple projects. Unlike traditional analytics tools, Agent Analytics focuses on providing data your agent can directly interpret, track, and use to optimize performance, run A/B experiments, and drive growth—all from a developer-friendly CLI interface. The tool is intentionally lightweight, prioritizing meaningful metrics over exhaustive data collection, making it ideal for those who want to know if their project is alive and growing without being overwhelmed by data noise.

Why Use Agent Analytics?

Many analytics platforms offer detailed event tracking, but few are designed for autonomous use by AI agents themselves. Agent Analytics fills this gap by enabling your AI agent to:

  • Track key events and user behaviors relevant to growth and engagement.
  • Analyze project health with actionable, high-signal metrics.
  • Run A/B experiments on site elements like headlines or calls-to-action, directly from the CLI.
  • Optimize projects continuously with minimal developer intervention.
  • Access a built-in growth playbook, guiding your agent on what to measure and how to grow.

This approach is particularly suited to developers managing multiple projects, or those building AI agents that need to monitor and adapt their own performance in production environments.

How to Get Started

Agent Analytics is straightforward to integrate and use. Here’s how to set it up for your AI agent or project:

1. Prerequisites

  • Node.js and npx installed.
  • An Agent Analytics API key (obtainable from agentanalytics.sh).
  • The environment variable AGENT_ANALYTICS_API_KEY set with your API key.

2. Installation

Agent Analytics is distributed as a CLI tool. You do not need a global install; simply use npx:

npx agent-analytics init

3. Event Tracking

Integration

Add tracking code to your web app or service. For example, to track a page view or custom event:

import { trackEvent } from 'agent-analytics-sdk';

trackEvent('page_view', {
  page: '/landing'
});

trackEvent('signup', {
  method: 'email'
});

You can choose 3-5 key custom events per project, such as signups, purchases, or specific conversions, in addition to automatic page views.

4. Running the

CLI

Use the CLI to check analytics and run experiments:

npx agent-analytics status
npx agent-analytics ab-test --headline "Try Free" --variant "Start Now"

Key Features

Agent Analytics offers a set of targeted features designed for actionable insights and continuous optimization:

  • Minimal, High-Impact Tracking: Track only the most important events—usually 3-5 per project—reducing noise and focusing on growth signals.
  • CLI-Driven Interface: Analyze, experiment, and optimize projects directly from the command line, enabling rapid iteration and agent-driven workflows.
  • A/B Testing: Easily run A/B tests on headlines, CTAs, or user flows, and get statistically significant results for optimization.
  • Growth Playbook: A built-in playbook helps your agent not only track what matters but also understand how to grow, recommending next steps based on data.
  • Funnel & Cohort Analysis: Get insights into user journeys, retention, and drop-off points, helping to identify bottlenecks and opportunities.
  • Traffic & Engagement Reporting: Instantly check traffic sources, engagement metrics, and conversion rates for any project.
  • Multi-Project Support: Manage analytics across all your projects from a single CLI, perfect for agencies or developers with multiple deployments.

Best Practices

To get the most value from Agent Analytics, consider the following recommendations:

  • Track Only What Matters: Resist the urge to log every event. Focus on high-leverage actions (e.g., signups, purchases, key feature usage) that answer the question, "Is this project alive and growing?"

  • Integrate Early: Add Agent Analytics tracking early in your project lifecycle to establish baselines and monitor growth from day one.

  • Automate Reporting: Use the CLI to set up regular status checks or integrate into your CI/CD for automated health monitoring.

  • Iterate with Experiments: Run A/B tests on impactful elements. For example:

    npx agent-analytics ab-test --headline "Try Free" --variant "Start Now"
  • Review the Growth Playbook: Use the recommendations in the growth playbook to guide your next optimization steps.

  • Protect Privacy: Only track events necessary for growth analysis, respecting user privacy and minimizing data collection.

Important Notes

  • Not a Replacement for Full Analytics Suites: Agent Analytics is intentionally minimal. It is not meant to replace platforms like Mixpanel or Google Analytics for deep-dive analysis.
  • API Key Security: Always keep your AGENT_ANALYTICS_API_KEY secure—never expose it in public repositories or client-side code.
  • CLI-Focused Workflow: The primary interface is the CLI, designed for developers and agents. Ensure your workflow accommodates command-line usage.
  • Documentation and Updates: Refer to the official documentation at docs.agentanalytics.sh for the latest integration guides and best practices.
  • Open Source: The source code and plugin can be found at Agent Analytics GitHub and Build with Claude skills repository.

Agent Analytics provides a pragmatic, agent-first approach to analytics, enabling actionable insights and continuous growth with minimal overhead. By focusing on what truly matters, it empowers your AI agents and development teams to make data-driven decisions quickly and efficiently.