Skip to content

Commit f3184be

Browse files
committed
Update spec doc
1 parent d18f2f2 commit f3184be

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/connections/spec/identify.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Segment recommends that you make an Identify call:
1212
- After a user logs in
1313
- When a user updates their info (for example, they change or add a new address)
1414

15-
The first three examples are pretty self-explanatory, but many might ask: why you would call identify on every page load if you're storing the `userId` in the cookie/local storage?
15+
The first three examples are pretty self-explanatory, but many might ask: why you would call Identify on every page load if you're storing the `userId` in the cookie/local storage?
1616

1717
Calling Identify in one of Segment's [libraries](/docs/connections/sources/) is one of the first steps to getting started with Segment. Refer to library-specific documentation for more details.
1818

@@ -51,6 +51,8 @@ Beyond the common fields, an Identify call has the following fields:
5151
{% include content/spec-field-user-id.md %}
5252
</table>
5353

54+
> info ""
55+
> Note that these traits coming in from your source events are called [custom traits](/docs/unify/traits/custom-traits/).
5456
5557
## Example
5658

@@ -109,7 +111,8 @@ In these cases, you should use an Anonymous ID.
109111

110112
The Anonymous ID can be any pseudo-unique identifier. For example, on your servers you can use a session id. If you don't have any readily available identifier, you can always generate a new random one—Segment recommends [UUIDs](http://en.wikipedia.org/wiki/Universally_unique_identifier){:target="_blank"}.
111113

112-
**Note:** Segment's [browser and mobile libraries](/docs/connections/sources/) **automatically** use Anonymous IDs to keep track of users as they navigate around your website or app, so you don't need to worry about them when using those libraries.
114+
> info ""
115+
> Segment's [browser and mobile libraries](/docs/connections/sources/) automatically use Anonymous IDs to keep track of users as they navigate around your website or app, so you don't need to worry about them when using those libraries.
113116
114117
Here's an example of a JavaScript event for an anonymous user:
115118

@@ -127,17 +130,18 @@ A User ID is usually the unique identifier that you recognize a user by in your
127130

128131
Segment recommends using database IDs instead of simple email addresses or usernames, because database IDs _never_ change. That guarantees that even if the user changes their email address, you can still recognize them as the same person in all of your analytics tools. And even better, you'll be able to correlate analytics data with your own internal database.
129132

130-
**Instead of using an email address or a username as a User ID, send them along as [traits](/docs/connections/spec/identify#traits).**
133+
> success ""
134+
> Instead of using an email address or a username as a User ID, send them along as [custom traits](/docs/unify/traits/custom-traits/).
131135
132-
## Traits
136+
## Custom traits
133137

134-
Traits are pieces of information you know about a user that are included in an Identify call. 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.
138+
[Custom traits](/docs/unify/traits/custom-traits/) are pieces of information you know about a user that are included in an Identify call. 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.
135139

136-
Segment has reserved some traits that have semantic meanings for users, and will handle 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.
140+
Segment has reserved some custom traits that have semantic meanings for users, and will handle 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.
137141

138142
You should **only use reserved traits for their intended meaning**.
139143

140-
Reserved traits Segment has standardized:
144+
Reserved custom traits Segment has standardized:
141145

142146
| **Trait** | **Type** | **Description** |
143147
|---------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -146,7 +150,7 @@ Reserved traits Segment has standardized:
146150
| `avatar` | String | URL to an avatar image for the user |
147151
| `birthday` | Date | User's birthday |
148152
| `company` | Object | Company the user represents, optionally containing: `name` (String), `id` (String or Number), `industry` (String), `employee_count` (Number) or `plan` (String) |
149-
| `createdAt` | Date | Date the user's account was first created. Segment recommends using [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) date strings. |
153+
| `createdAt` | Date | Date the user's account was first created. Segment recommends using [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601){:target="_blank"} date strings. |
150154
| `description` | String | Description of the user |
151155
| `email` | String | Email address of a user |
152156
| `firstName` | String | First name of a user |
@@ -159,6 +163,7 @@ Reserved traits Segment has standardized:
159163
| `username` | String | User's username. This should be unique to each user, like the usernames of Twitter or GitHub. |
160164
| `website` | String | Website of a user |
161165

162-
**Note:** You might be used to some destinations recognizing special traits by slightly different names. For example, Mixpanel recognizes a `$created` trait when the user's account was first created, while Intercom recognizes the same trait as `created_at` instead. Segment attempts to handle all the destination-specific conversions for you automatically. If you need help understanding if a specific field will be converted to a destination, take a look at Segment's [open source integration code](https://github.com/segment-integrations?q=&type=all&language=&sort=){:target="_blank"}, view the destination's documentation, or [contact Segment support](https://app.segment.com/workspaces?contact=1).
166+
> info ""
167+
> You might be used to some destinations recognizing special traits by slightly different names. For example, Mixpanel recognizes a `$created` trait when the user's account was first created, while Intercom recognizes the same trait as `created_at` instead. Segment attempts to handle all the destination-specific conversions for you automatically. If you need help understanding if a specific field will be converted to a destination, take a look at Segment's [open source integration code](https://github.com/segment-integrations?q=&type=all&language=&sort=){:target="_blank"}, view the destination's documentation, or [contact Segment support](https://app.segment.com/workspaces?contact=1){:target="_blank"}.
163168
164169
**You can pass these reserved traits using camelCase or snake_case**, so in JavaScript you can match the rest of your camel-case code by sending `firstName`, while in Ruby you can match your snake-case code by sending `first_name`. That way the API never seems alien to your code base. Keep in mind that not all destinations support these reserved traits, so sending these traits in camelCase and snake_case can result in two sets of traits in other destinations.

0 commit comments

Comments
 (0)