# Stitch anonymous and identified sessions

One person counted as two because their pre-sign-in activity is never linked to their account.

Category: Analytics and tracking
Source: https://letsship.ai/use-cases/stitch-anonymous-and-identified-sessions
Published: 2026-08-25

## Goal

Link anonymous activity to the identified user at sign-in.

## Acceptance criteria

- Pre-sign-in activity is attributed to the user after sign-in
- A test covers the boundary in both directions
- Sign-out does not leak identity into the next anonymous session
- Historical double-counting is quantified

## What lands as proof

A test crossing the sign-in boundary and asserting one person, not two.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Stitch anonymous sessions to identified users

Description: Link anonymous activity to the identified user at sign-in.

Acceptance criteria:
- Pre-sign-in activity is attributed to the user after sign-in
- A test covers the boundary in both directions
- Sign-out does not leak identity into the next anonymous session
- Historical double-counting is quantified

Before you create the issue, check how this repository's analytics handles identity at sign-in and describe what happens today.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: link anonymous activity to the identified user at sign-in. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means identity test across the sign-in boundary, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

The run stops once the plan is written. Somebody reads the approach and approves it before any code exists, which is the cheapest moment to redirect the work.
