Skip to content

Identify users

Tie events to your own user IDs so you can see how many people an issue affects and look up a specific user's problems.

Users tab on Growth and Scale

identify works on every plan and keeps issue user counts accurate. The Users tab and per-user history are included on the Growth and Scale plans. See User tracking & monitoring.

Identify and reset

Kotlin
import com.codeskop.sdk.core.Codeskop // After a successful login or sign-upCodeskop.identify(    userId = user.id,                       // your stable internal id    traits = mapOf("plan" to user.plan),    // optional, non-personal attributes) // On logoutCodeskop.reset()

Every event captured after identify carries that user. After reset, events are anonymous again.

Call it at login and on launch

Since 0.3.1 the SDK saves the user on the device (in encrypted storage) and restores it when the app restarts. Calling identify on launch as well keeps older versions right and picks up a user who signed in some other way. So call it in two places:

  1. right after a user logs in or signs up, and
  2. when your app starts and restores an existing session.
MyApplication.kt
class MyApplication : Application() {    override fun onCreate() {        super.onCreate()        CodeskopAndroid.init(this, CodeskopConfig(apiKey = BuildConfig.CODESKOP_KEY))         // Re-identify a user who is already signed in from a previous session        sessionStore.currentUser()?.let { user ->            Codeskop.identify(userId = user.id, traits = mapOf("plan" to user.plan))        }    }}

Calling identify again with the same ID is expected and harmless. Codeskop updates the same user and doesn't create a duplicate.

Choosing a user ID

  • Use a stable ID from your own system, such as your database's user ID.
  • Don't use an email address, phone number or name. Codeskop never needs them.
  • Keep traits non-personal. Plan, account tier or cohort are good. Values are sent as text.

Traits are sent as you pass them

Traits aren't redacted. Don't put anything in them you wouldn't want stored.

Before a user signs in

Anonymous events aren't lost. Every install has a random install ID (not tied to the device's hardware or advertising ID, and stored encrypted), and every event carries it. From 0.4.0 events also carry an anonymous ID, and anonymous events carry no user ID. When identify runs, what that anonymous ID did earlier (sign-up screens, failed logins, the first visit) is linked to the user in product analytics: funnels, retention, paths and the user's journey. reset clears the user, keeps the install ID and starts a new anonymous ID, so the next person on a shared phone isn't linked to the last one. More in Core concepts and the event model.

How users are counted

Each issue on the dashboard shows how many distinct users it affected. Codeskop counts your user ID when there is one, and otherwise the install. So calling identify makes these numbers match real people: one customer on two phones counts once, not twice.

What you see in the Users tab

The dashboard's Users tab lists the people using your app over the last 30 days: sessions, crashes, device, OS, country (from the device locale) and app version, plus each user's recent sessions and events.

  • Without identify, every install appears as an Anonymous install. Counts are still right per install, but one person on two phones shows up twice.
  • With identify, the row shows your user ID, and every install that person signs in on is grouped under it.

No extra setup is needed for the Users tab. It fills in from the events your app already sends. Only the user ID is stored for display; traits travel with events but aren't shown there.

Next steps