Agent Analytics Agent Analytics Agent-ready analytics
Guide

🦞 Know Who Your Users Are

Anonymous visitor lands on your site. They sign up. Now what? Identity stitching connects the before and after — one user, one story.

🦞 Know Who Your Users Are

Everyone starts anonymous.

Someone lands on your site from a Google search. They read the pricing page, click around, come back the next day, and finally sign up. In your analytics, that looks like two different people — a mystery visitor with a random ID, and a registered user with an email.

But it’s the same person. And the whole story of why they signed up just got lost.

What Is Identity Stitching?

When a user identifies themselves — signs up, logs in, enters their email — all their previous anonymous activity gets linked to their real identity. One user, one complete journey.

How identity stitching connects anonymous and known users

Before: Your analytics sees two strangers — an anonymous visitor who browsed your pricing page, and a signed-up user who activated a feature. No connection between them.

After: One person. You can see the full path: they found you through Google, read pricing, came back the next day, signed up, and used the core feature within an hour.

How It Works

The Agent Analytics tracker gives every visitor an anonymous ID and records their activity. When they identify themselves, you add one line:

window.aa.identify("[email protected]")

That’s it. Behind the scenes:

  • Every past event gets linked to the real identity
  • Every future event uses the real user ID
  • Sessions, funnels, and retention all update automatically

No query-time joins. No special configuration. The data just gets corrected — and every analysis your agent runs reflects the true picture.

When to Use It

The most natural place is right after your user logs in or signs up. If you’re using OAuth (Google, GitHub), call it when they land back on your site. For email/password login, call it after authentication succeeds.

Your agent can help you wire this up — just tell it:

“Add identity stitching after login on my app”

Works Across Subdomains Too

If your product spans multiple subdomains — app.example.com, docs.example.com, blog.example.com — identity stitching ties the whole journey together.

A user reads your blog, visits the marketing site, signs up on the app, and reads the docs. With identity stitching, that’s one continuous story — not four fragmented visitors across four subdomains.

Server-Side Identify

Sometimes the browser isn’t the right place. The most common case: OAuth callbacks.

When someone clicks “Sign in with Google,” they leave your site entirely. The OAuth flow redirects them to Google, then back to your server. At that moment, your server knows who the user is — but the browser tracker hasn’t caught up yet.

Agent Analytics has a server-side identify endpoint for exactly this. Your backend can call it directly during the auth callback, connecting the anonymous visitor to the authenticated user before the page even finishes loading.

What Gets Stitched

Everything:

  • Funnels count anonymous page views and the signup as the same person’s journey
  • Retention tracks users from their first anonymous visit, not from when they signed up
  • Unique counts don’t double-count the same person before and after auth
  • Session history shows the complete picture — what they looked at before deciding to sign up

Why This Matters for AI Agents

Without identity stitching, your agent sees fragmented data. “How many users signed up and then used feature X?” becomes unreliable because the signup happened under one ID and the feature usage under another.

With stitching, your agent sees one continuous user journey. It can trace the exact path from first visit → signup → activation → retention — and give you real answers about what’s working and what isn’t.

Your agent can finally answer questions like:

  • “What pages do users visit before signing up?”
  • “How long from first visit to signup?”
  • “Do users who read the docs convert better?”
  • “What’s the most common path to activation?”

These answers are only possible when anonymous and authenticated activity are connected.

Get Started

Identity stitching is available now. One line of JavaScript, one API call from your server — and your analytics tells the full story.


Previously: Funnels: See Where Users Drop Off · A/B Testing Your AI Agent Can Actually Use

Related posts