Identify User
Associates a user with traits via the identify() call. userId is optional — omit it for anonymous users and the SDK will use its own anonymousId.
Code Example
- Segment (JS)
- RudderStack (JS)
- Hightouch (JS)
analytics.identify("usr_12345", {
"email": "jane@example.com",
"name": "Jane Doe",
"plan": "free",
"created_at": "2024-01-15T10:30:00Z"
});
rudderanalytics.identify("usr_12345", {
"email": "jane@example.com",
"name": "Jane Doe",
"plan": "free",
"created_at": "2024-01-15T10:30:00Z"
});
htevents.identify("usr_12345", {
"email": "jane@example.com",
"name": "Jane Doe",
"plan": "free",
"created_at": "2024-01-15T10:30:00Z"
});
Event Properties
| Property | Type | Constraints | Examples | Description |
|---|---|---|---|---|
| $schema | string | required | | Defines the structure of the event. |
const: "https://tracking-docs-demo.buchert.digital/schemas/analytics-js/identify-user.json" | ||||
| userId | string | | The unique identifier for the user in your database. Optional — omit for anonymous users. | |
string | | The email address of the user. | ||
| name | string | | The full name of the user. | |
| plan | string | enum: [free, pro, enterprise] | | The subscription plan of the user. |
| created_at | string | | ISO 8601 timestamp of when the user account was created. |
View Raw JSON Schema
{
: "https://json-schema.org/draft/2020-12/schema",
: "https://tracking-docs-demo.buchert.digital/schemas/analytics-js/identify-user.json",
"title": "Identify User",
"description": "Associates a user with traits via the identify() call. userId is optional — omit it for anonymous users and the SDK will use its own anonymousId.",
"x-tracking-targets": [
"web-segment-js",
"web-rudderstack-js",
"web-hightouch-js"
],
"x-method": "identify",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "Defines the structure of the event.",
"const": "https://tracking-docs-demo.buchert.digital/schemas/analytics-js/identify-user.json"
},
"userId": {
"type": "string",
"description": "The unique identifier for the user in your database. Optional — omit for anonymous users.",
"examples": [
"usr_12345",
"user@example.com"
]
},
"email": {
"type": "string",
"description": "The email address of the user.",
"examples": [
"jane@example.com",
"john.doe@company.com"
]
},
"name": {
"type": "string",
"description": "The full name of the user.",
"examples": [
"Jane Doe",
"John Smith"
]
},
"plan": {
"type": "string",
"description": "The subscription plan of the user.",
"enum": [
"free",
"pro",
"enterprise"
],
"examples": [
"free",
"pro",
"enterprise"
]
},
"created_at": {
"type": "string",
"description": "ISO 8601 timestamp of when the user account was created.",
"examples": [
"2024-01-15T10:30:00Z",
"2023-06-01T00:00:00Z"
]
}
},
"required": [
"$schema"
]
}