Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Custom Traits


Custom traits are user or account traits collected from the Identify calls you send to Segment. For example, these could be demographics like age or gender, account-specific like plan, or even things like whether a user has seen a particular A/B test variation. From your sources, send custom traits as pieces of information that you know about a user in an Identify call.

As opposed to computed traits which are computed from your source data, or SQL Traits which are computed from warehouse data, custom traits are created from source events you pass into Segment and have no trait limits.


Comparing trait types

comparing-trait-types page anchor

View the table below to better understand how Segment collects custom, computed, and SQL traits.

You can use the Profile explorer (Unify > Profile explorer) to view traits attached to a profile.

Trait typeDescription
Custom traitsTraits created from source events you pass into Segment. From your sources, send custom traits as pieces of information that you know about a user in an Identify call.
Computed traitsTraits collected from computations off of event and event property data from your sources. Create user or account-level calculations like most_viewed_page or total_num_orders for a customer. Learn more by viewing types of computed traits.
SQL traitsTraits created by running SQL queries on data in your warehouse. SQL traits are a type of computed trait. SQL traits help you import traits from your data warehouse back into Segment to build audiences or enhance data that you send to other destinations.

Here's the payload of a typical Identify call with custom traits (with most common fields removed):

1
{
2
"type": "identify",
3
"traits": {
4
"name": "John Smith",
5
"email": "john@example.com",
6
"plan": "premium",
7
"logins": 5
8
},
9
"userId": "97980cfea0067"
10
}

And here's the corresponding JavaScript event that would generate the above payload:

1
analytics.identify("97980cfea0067", {
2
name: "John Smith",
3
email: "john@example.com",
4
plan: "premium",
5
logins: 5
6
});
(success)

Success!

Any source event where there's a traits object and key value pairs generates custom traits.

Custom traits are mutable and update to the latest value seen by the user's Identify events.

When an audience that previously generated Identify events is deleted, the data for the audience key is still attached to profiles that entered the audience and becomes visible in Segment as a custom trait.


Segment has reserved some custom traits that have semantic meanings for users and handles them in special ways. For example, Segment always expects email to be a string of the user's email address. Segment sends this on to destinations, like Mailchimp, that require an email address for their tracking.

(warning)

Warning

Only use reserved custom traits for their intended meaning.

Reserved custom traits Segment has standardized:

TraitTypeDescription
addressObjectStreet address of a user optionally containing: city, country, postalCode, state, or street
ageNumberAge of a user
avatarStringURL to an avatar image for the user
birthdayDateUser's birthday
companyObjectCompany the user represents, optionally containing: name (String), id (String or Number), industry (String), employee_count (Number) or plan (String)
createdAtDateDate the user's account was first created. Segment recommends using ISO-8601(link takes you to an external page) date strings.
descriptionStringDescription of the user
emailStringEmail address of a user
firstNameStringFirst name of a user
genderStringGender of a user
idStringUnique ID in your database for a user
lastNameStringLast name of a user
nameStringFull name of a user. If you only pass a first and last name Segment automatically fills in the full name for you.
phoneStringPhone number of a user
titleStringTitle of a user, usually related to their position at a specific company. Example: "VP of Engineering"
usernameStringUser's username. This should be unique to each user, like the usernames of Twitter or GitHub.
websiteStringWebsite of a user

To learn more about using an Identify call to tie custom traits to profiles, visit Segment's Identify documentation.