Documentation
Everything you need to install UserSesh, track user behavior, and connect your AI development workflow.
Quick Start
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.
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.
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" });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:
Guides
JavaScript SDK
Full API reference for the tracker script. Auto-tracking, custom events, user identification, and configuration options.
Events & Identification
Track custom events, identify users, and add data attributes for richer click tracking.
Conversion Tracking
Track signups, purchases, and trial starts. Connects to ad platforms for ROAS reporting.
MCP Server
Connect UserSesh to Cursor, Claude Code, or Windsurf so your AI coding agent can read analytics data.