Documentation

Everything you need to install UserSesh, track user behavior, and connect your AI development workflow.

Quick Start

1

Add the tracker script

Add this to your root HTML <head>. It loads async and won't block rendering.

<script
  src="https://usersesh.com/tracker.js"
  data-site-id="YOUR_SITE_ID"
  async
></script>

For Next.js, use <Script strategy="afterInteractive" /> instead. See the SDK reference for all framework examples.

2

Identify your users

After a user logs in or signs up, call identify() to link sessions to a user.

usersesh.identify("user_123", {
  email: "jane@example.com",
  name: "Jane Doe",
  plan: "pro"
});

Call usersesh.reset() on logout. See Events & Identification.

3

Track custom events

The tracker auto-captures page views, clicks, scroll depth, errors, and more. Use track() for business-specific actions.

usersesh.track("signed_up", { method: "google" });
usersesh.track("feature_used", { feature: "export" });
usersesh.track("cta_clicked", { name: "hero-signup", location: "hero" });
4

Connect your AI IDE (optional)

Add the MCP server so Cursor, Claude Code, or Windsurf can read your analytics and help fix UX issues.

// .cursor/mcp.json
{
  "mcpServers": {
    "usersesh": {
      "command": "npx",
      "args": ["-y", "usersesh-mcp"],
      "env": {
        "USERSESH_API_KEY": "YOUR_KEY_HERE",
        "USERSESH_URL": "https://usersesh.com"
      }
    }
  }
}

See the full MCP setup guide for Claude Code and Windsurf instructions.

What's auto-tracked

The tracker script automatically captures all of this without any code:

Page views & sessions
Unique visitors & bounce rate
Every click (element, text, position)
Scroll depth (25%, 50%, 75%, 90%)
Rage clicks
JavaScript errors
Web vitals (LCP, CLS, FCP, TTFB)
Session recordings
Heatmaps (click, scroll, movement)
SPA navigation
UTM parameters
Ad click IDs (Google, Meta, X, LinkedIn, TikTok)

Guides