A User ID is a unique identifier for each user that cannot change and is optional. We strongly suggest setting a User ID once the user has created an account, logged in, or is otherwise identified in your product.
Notes:
- A user can only have one User ID and if it is changed, then Amplitude will treat that new User ID as a different user. It is fine to not set a User ID -- you should not set a User ID for anonymous users
- If you do not have a system of assigning User IDs (either client or server-side) then skip this section
Table of Contents
Overview
This is part of our Getting Started with Amplitude Series! You are currently on Part 3 of 7 in the series: Identifying Users. We are invested in your success and wrote this guide to help you set up Amplitude in the quickest and most optimal manner. This Quick Start Guide will walk through the data structure and what data you should send to Amplitude. Specifically, it will cover:
- Introduction & Getting Started
- Instrumentation Pre-Work: what you should think about before deciding what data to send
- Identifying Users: what is required to properly track unique users for your product
- Event Data: what events or user actions you should track
- User Properties & Event Properties: what attributes you should send to upscale your analytics
- Cross Platform Instrumentation vs. Separate Platform Instrumentation: when you should do either way of instrumentation
- Using the Amplitude Platform: helpful definitions
If you are a developer or product manager who will be responsible for instrumenting Amplitude, then you should also read our Getting Started Guide for Developers as well.
Assigning User IDs
Products that have some kind of login system can track users even if they switch devices. Though assigning User IDs is optional, we recommend that products with a login system or a UUID (unique user identifier) system assign a User ID.
With a User ID, Amplitude can match events across multiple devices under the same user (same User ID). Furthermore, a User ID does not need to be assigned immediately. A user's event data will be merged on the backend so that all anonymous events up to the point of User ID assignment will be connected to the assigned User ID (assuming the Device ID is consistent).
We recommend reading more on how we count unique users, to get a full understanding of how we identify and merge users.
Important Recommendations on Setting User IDs
- Do not set User ID if there isn't one. For example, setting a User ID to the string 'None' to multiple users will group all events under that 'None' User ID together (e.g. any user with the 'None' User ID is assumed to be the same single user). You can always set the User ID later, and Amplitude has a built-in logic that will merge the anonymous events to the later identified user (see Example 2).
- Do not assign a User ID that might change. If someone’s email can change within your app, then it is not a good idea to set it as a User ID as Amplitude will mark the person as a new user if they change their email.
- User IDs are case-sensitive. If you set a user's User ID with a different casing, that user will have two separate profiles.
- Assigning User IDs properly can be tricky if you have a system that does it server-side. If you feel that you are running into issues assigning User IDs, then please contact us here.
Sending Data to Amplitude
Find specific information on how to send data to Amplitude here:
- Amplitude SDKs: Find our list of SDKs here.
- Amplitude HTTP API: Use our HTTP API to send server-side event data.
- Segment.io: See Segment / Amplitude Integration for more information.
- mParticle: See mParticle / Amplitude Integration for more information.