For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Missing User IDs after sign-in: engineering solution
Set a stable user_id as soon as your product reliably identifies a person, then include it on every authenticated event. This is an instrumentation change. Data Assistant and the Amplitude UI can't add missing identifiers to events that already arrived, so the fix lives in your code or event pipeline.
Use your Analytics SDK's identity method for client events. If you send events through the HTTP API, include user_id in each authenticated event payload. Start from the confirmed findings in the audit.
Choose the identifier carefully
User IDs are case-sensitive and permanent. Don't use an email address, a username, a value that can change, or a shared placeholder such as None. Amplitude can't merge two established User IDs later, so a bad choice now is expensive to undo.
Update the identity flow
- Choose the immutable account identifier your backend uses for one person.
- Keep the Amplitude SDK anonymous until your authentication system confirms the person's identity.
- Call the SDK's User ID method right after authentication and before you track any post-sign-in event. Follow the identity section of your Analytics SDK documentation.
- For server-side events, send the same canonical value in
user_idon every authenticated event. Follow the HTTP V2 API request schema. - Use exactly the same value and casing across web, mobile, and backend sources.
- Define logout behavior. If another person can use the same device, clear the User ID and generate a new device ID according to your SDK's logout guidance.
Validate the fix
Repeat the audit in a test environment or with a test account. Confirm that anonymous events stay anonymous before authentication, and that every event after authentication carries the canonical user_id.
For the full identity model, refer to Track unique users.
Was this helpful?