The user object

The user object contains information about a logged-in user, like their internal ID, email address, postal address, and so on.

Important

The user object can be placed in the context object or directly in the value object. We recommend that you place it in context, as the value.user object is deprecated.

The following are the attributes supported by the user object:

NameTypeDescriptionValue
idstringRequired.Any persistent ID you use to identify the user. Can be a primary key in a user database, or an ID in any system used to manage user info.Importantid is different from the uuid or user_id attributes, which are anonymous.n/a
emailstringOptional.User's email address.n/a
fbidstringOptional.User's Facebook ID.n/a
eidstringRequired when using email.User's opaque email ID as identified by your email service provider.n/a
addressAddress objectOptional.User's postal address information. This is usually also the billing address.NoteThis can be different from the shipping_address attribute, which is provided as part of the checkout object.n/a
groupsarray of stringsOptional.Custom groups or group segments that are assigned to the user. Strings are free-form.n/a
genderstringOptional.User's gender.malefemaleother
addn_attributesobjectOptional.A map of customer-specific user attributes.n/a

The following is an example of the user object:

"user": {
  "id": "user-1234",
  "email": "[email protected]",
  "eid": "<email_identifier>",
  "address": {
    "address_line_1": "123 Main Street",
    "address_line_2": "apartment 123",
    "state": "CA",
    "zip": "90210",
    "country": "US"
  },
  "groups": ["group1", "group2"],
  "gender": "female",
  "addn_attributes": {
    "<attr_key1>": "<attr_value1>",
    "<attr_key2>": "<attr_value2>",
    ...
  }
}
If you have suggestions for improving this article, let us know!