GoodData

Identifying Users

While Gooddata provides anonymous, privacy-friendly web analytics out of the box, you can also use it for product analytics by tying sessions and events to specific logged-in users.

By identifying users, you can track exactly how individuals interact with your application over time, regardless of what device or browser they are using.

The identify Method

To identify a user, call the gooddata.identify() method provided by the client script. You should typically do this right after a user logs into your application.

if (window.gooddata) {
  window.gooddata.identify({
    id: "user_12345", // Required: A unique identifier for the user
    email: "user@example.com", // Optional
    name: "Jane Doe", // Optional
    plan: "Pro" // Optional: Any custom metadata you want to attach
  });
}

Parameters

The identify function accepts an object with the following properties:

  • id (String) Required: A unique, persistent identifier for the user (e.g., from your database).
  • ...metadata (Object) Optional: Any additional key-value pairs you want to associate with this user.

How it Works

When you identify a user, the tracking SDK securely stores the user ID in the browser's memory and automatically attaches it to all subsequent page_view and custom events in that session.

If the same user logs in from a different device and you call identify again, Gooddata will recognize them as the same user, providing a unified view of their journey across devices.