Skip to content

Getting Started

This is the shortest path from zero to a working Agent Analytics setup.

The main flow is agent-first: choose Connect as agent, start in the AI agent you already use, let that agent open the browser for you or give you a login link, then have it create the project and wire tracking for you.

Use Connect as human only when you need direct account access yourself, such as billing, cancellation, or manual review. Browser approval and finish-code handoff still belong to the normal agent-owned setup flow.

If your AI agent, such as Claude Code, Cursor, Codex, or OpenClaw, is already installed and you want the clearest create-project, place-snippet, and verify-first-page-view walkthrough, use First Project in 5 Minutes.

If you want your agent to install analytics with product judgment instead of a generic event list, start with Product Growth Scanner. It returns the growth questions, measurement blind spots, minimum viable instrumentation, and what not to measure yet.

If you want to understand the two public skills first, start with Agent Analytics Skill for setup and reporting, then Autoresearch Growth Skill for data-informed variant generation.

If you are here from a Paperclip workflow, start by creating a task for your CEO in Paperclip, then follow Set up Agent Analytics for your Paperclip company for the one-task delegation and finish-code handoff path.

If you are using Paperclip, stop here first and create the CEO task from Set up Agent Analytics for your Paperclip company. That guide covers the one-task delegation path, browser approval, and the finish-code reply flow.

Go to the installation hub and complete the setup for the environment you actually use:

If none of those are a fit, the API reference stays available for direct integration into your own runtime.

2. Open your AI agent in the project directory

Section titled “2. Open your AI agent in the project directory”

Start from the codebase or site you actually want to track.

Then ask your AI agent for the full setup flow:

  • Set up Agent Analytics for this project. Run the website analysis first so you know what my agent should track first. Install only the high-priority recommended events. Open the browser for me or send me the login link, then wait. I will sign in with Google or GitHub, approve it, and paste back any finish code if you need it. Then create the project, add tracking, explain what each event enables, and verify the first useful event.

When the browser approval page opens, sign in with Google or GitHub, approve it, and let the agent continue. That approval creates or connects your account and gives the agent the session it needs.

After your AI agent is connected, ask it to create the first project for you:

  • Create a project called my-site.com
  • Create a project called my-site.com and give me the tracking snippet

If your AI agent has code write access to your site, ask it:

  • Set up analytics for my-site.com. Analyze the public site first, then install only the first recommended events.

Your AI agent should create the project and either:

  • return the tracker snippet for you to paste, or
  • install the tracker itself if it can edit the site

If your AI agent already added the tracker to your site, skip this step.

If it only created the project and returned a snippet, add the script before </body>:

<script defer src="https://api.agentanalytics.sh/tracker.js"
data-project="my-site"
data-token="aat_..."></script>

Page views are tracked automatically. Add custom events later with data-aa-event attributes or window.aa.track().

If your product has login or signup, keep signup for the moment the account is actually created, preferably server-side. After auth succeeds in the browser, call window.aa.identify(account.id) before other post-auth browser events so client and server activity land on the same user.

If your site uses Astro, add is:inline to that tracker tag.

For advanced tracker options like declarative events, cross-domain identity, consent, scroll depth, vitals, and error tracking, use the Tracker.js guide. If your app is a SPA, use SPA and Virtual Page Tracking to understand what Agent Analytics auto-tracks and when to send a manual virtual page_view. If you want your AI agent to launch your first browser-side A/B test after setup, continue with AI Agent Experiment Tracking.

Once the install is working and the tracker is live, ask your AI agent one of these:

  • List my projects
  • How is my-site doing this week?
  • What are the top pages for my-site this week?
  • Show bot traffic for my-site this week

If the setup is correct, the agent should answer without you hand-writing requests or opening a reporting UI.

If you need direct HTTP access for your own runtime, you can still generate an API key from app.agentanalytics.sh. That is the advanced/manual path. CLI, MCP, and agent onboarding should use browser approval and agent sessions instead.