Skip to content
Main Project

identify() isn't working

Guide

Symptoms

  • The widget always shows "anonymous"

  • New posts targeted to a segment never appear

  • Votes don't stick across sessions

Common causes

1. Called before the script loaded

// ❌ Race condition — script might not be ready yet
window.Releaseo.identify(user);

// ✅ Use optional chaining or wait for ready
window.Releaseo?.identify(user);

2. ID is missing or wrong shape

// ❌ Numbers, booleans, objects — won't work
window.Releaseo?.identify({ id: 8231 });

// ✅ Strings only
window.Releaseo?.identify({ id: '8231' });

3. ID changes between sessions

If your ID is regenerated on every login (e.g. a session token), the widget can't recognize the user as returning. Use a stable user ID — your database primary key, not a session ID.

4. SSR rehydration timing

In Next.js or similar, call identify inside a useEffect, not during render:

useEffect(() => {
  if (user) window.Releaseo?.identify(user);
}, [user]);