Identify User
Associates a known web user with Braze and sets custom user attributes.
Code Example
braze.changeUser("user_98765");
const user = braze.getUser();
user.setCustomUserAttribute("loyalty_tier", "gold");
user.setCustomUserAttribute("preferred_store", "store_042");
user.setCustomUserAttribute("marketing_opt_in", true);
Event Properties
| Property | Type | Constraints | Examples | Description |
|---|---|---|---|---|
| userId | string | required | | The unique external identifier for the user. |
minLength: 1 | ||||
| loyalty_tier | string | enum: [bronze, silver, gold] | | The user's loyalty tier. |
| preferred_store | string | | The user's preferred store or fulfillment location. | |
| marketing_opt_in | boolean | | Whether the user has opted into marketing communication. |
View Raw JSON Schema
{
: "https://json-schema.org/draft/2020-12/schema",
: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/braze/identify-user.json",
"title": "Identify User",
"description": "Associates a known web user with Braze and sets custom user attributes.",
"x-tracking-targets": [
"web-braze-js"
],
"x-method": "identify",
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The unique external identifier for the user.",
"minLength": 1,
"examples": [
"user_98765",
"usr_12345"
]
},
"loyalty_tier": {
"type": "string",
"description": "The user's loyalty tier.",
"enum": [
"bronze",
"silver",
"gold"
],
"examples": [
"gold",
"silver"
]
},
"preferred_store": {
"type": "string",
"description": "The user's preferred store or fulfillment location.",
"examples": [
"store_042",
"berlin_mitte"
]
},
"marketing_opt_in": {
"type": "boolean",
"description": "Whether the user has opted into marketing communication.",
"examples": [
true,
false
]
}
},
"required": [
"userId"
]
}