User

User object (visitor to the site). One of the major system objects.

Standard object fields

  • id: ID
    Unique user identifier.

  • user_id: string
    Unique string identifier of a lead in your application. It is used for user merging and user import.

  • removed: Optional[datetime]
    User removal datetime. User can be removed as a result of merging or full removal (GDPR). If user is not removed, return null.

  • map_url: Optional[str]
    Google-map url with user's location

Optional fields

  • props: Dict[str, Any]
    Contains system properties (for example: name $name, email $email, sessions count $sessions). System user properties.

  • props_custom: Dict[str, Any]
    Contains custom user properties. Custom property names can not start with $ character.

  • props_events: Dict[str, Any]
    Contains event-driven properties.
    After user performs an event (for example, event with ID=123), he will obtain 3 properties for this event:

    • $event_123_first - date, when event was first tracked for the user
    • $event_123_last - date, when event was last tracked for the user
    • $event_123_count - number of tracked events with this name
  • email_status: EmailStatus
    Object representing user's email status: EmailStatus object. If email is not set, returns null.

  • presence: str
    User status (can be online, idle, offline).

  • presence_details: Dict[str, Any]
    Additional info on user status (only for online or idle). User status description.

  • segments: Array[Segment]
    Array of segments (Segment objects), containing this user.

  • notes: List[Note]
    Array of notes (Note objects). Administrators can add notes.

  • tags: Array[UserTag]
    Array of UserTag objects.

  • events: Dict[uint64, Dict[Literal["event_type", "first", "last", "count"], Any]
    Contains same data as props_events, but more convenient:

    • event_type — extended information on event (EventType objects)
    • first, last — dates, when the event was first and last tracked (unix timestamp)
    • count — number of tracked events with this name
  • timezone_offset: Optional[float]
    Timezone offset in minutes from UTC. If user location is not determined, NULL is returned.

Example

{
  "id": 15131846,
  "user_id": "54784",

  "presence": "online",
  "presence_details": {
    ...
  },

  "props": {
    "$name": "Maksim",
    ...
  },

  "props_custom": {
    "project_key": "new-5832-44",
    ...
  },

  "props_events": {
    "$event_123_first": "2015-10-31T14:51:33",
    ...
  },

  "events": [
    {
      "event_type": {
        "id": 7322,
        "name": "My Event",
        "score": 12
      },
      "count": 21,
      "first": 1441105717,
      "last": 1448976199
    },
    ...
  ],

  "segments": [
    {
      "id": 732,
      "name": "segment-reg",
      "filters": "[{\"property_name\":\"$last_seen\",\"cls\":\"dt\",\"type\":\"daysless\",\"value\":{\"value\":\"30\"}}]"
    },
    ...
  ],

  "notes": [
    {
      "id": 954,
      "author": {
        "id": 12711,
        "name": "Maks",
        "avatar": "https://files.dashly.app/avatars/1446185805093-d6o6rtiq.jpg",
        "type": "admin"
      },
      "body": "Cool, bro!",
      "created": 1442675162
    },
    ...
  ],
}