User types refer to data types representing personal information, such as user profiles, usage statistics, and other user traits.
This summary provides an overview of the user-related types:
|User||General information about the user.|
|Gender||The enumeration of genders.|
|User statistics||Aggregate statistics about the user.|
The user type represents an individual, such as a customer, user, or anonymous visitor. It stores the profile, statistics, and other personal information.
The user profile has predefined properties that are common to all users. In addition, it can be extended with custom properties to store any additional information about the user, called custom attributes. These attributes are not listed below as they are not part of the type definition, but they can be accessed similarly to any other property.
For example, if you have a custom property called plan that stores the user's subscription plan, you can access it like this:
When accessing a property, if there is a custom attribute and a predefined attribute with the same name, the custom attribute takes precedence. However, it does not overwrite the predefined attribute — it simply hides it. Removing the custom attribute would make the predefined attribute visible again.
These are the predefined properties of the user profile:
The user's unique identifier provided by the application, such as a UUID or a username.
The name of the user as a combination of their first and last name, separated by a space. For instance, "John Doe".
This property is virtual, meaning it is not stored in the user profile. Instead, it is derived from the first and last name.
The first name of the user. For example, "John".
The last name of the user. For example, "Doe".
The age of the user. For example, 30.
The birth date of the user. For example, 1990-01-01.
This property is virtual, meaning it is not stored in the user profile. Instead, it is derived from the age.
The gender of the user.
The email address of the user. For example, "email@example.com".
The alternate email address of the user, such as a work email address or a secondary email address.
The phone number of the user. For example, "+1 555 555 5555".
The alternate phone number of the user, such as a work phone number or a secondary phone number.
The address of the user.
The URL of the user's avatar image.
The company the user works for.
The URL of the company the user works for.
The job title of the user.
The set of interests the user demonstrates, with no duplicates. For example, "ab testing", "analytics", "data science", etc.
The set of activities the user performs, with no duplicates. For example, "ab testing", "analytics", "data science", etc.
The aggregate statistics about the user.
A custom attribute, where /*<attribute>*/ is the name of the attribute.
This type is an enumeration that indicates the gender of a user.
Additional values may be added in the future to include other genders. Therefore, this enumeration is not guaranteed to support backward compatibility.
These are the possible values and what they represent:
|neutral||Neither male nor female gender.|
|unknown||An unspecified gender.|
The user-statistics type represents the aggregate statistics and numbers related to a user's behavior and activity across sessions.
These are the available properties: