Set User Attributes

Set attributes for the current user

❗️

Deprecated API Warning

This page documents a no-longer supported version of the Boomtrain JavaScript Library (versions 4.x and below). The new p13n.js library, documented here is the currently supported library for integrating with ZetaHub.

Sets or updates attributes for the currently-identified user. Note that this call will fail if the current user does not have a known user_id or email already, as provided in the Signup or Identify routes. You may also specify a user_id or email as a property of this call itself.

_bt.person.set(attributes, [callback]);

The set call has the following fields:

Field

Description

attributes

Object

An object containing key:value pairs indicating attributes to be set on this user. See Attributes Format below for more information.

callback optional

Function

A function that is executed after this function completes and the attributes have been set for the user.

_bt.person.set({
  'first_name': 'Michael',
  'last_name': 'Bluth',
  'signed_up_at': '2003-11-02T09:00:00+08:00',
  'newsletter': true,
  'favorite_things': ['hard work', 'george michael', 'candy beans']
  'title': 'CEO',
  'company': 'The Bluth Company'
});

Attributes Format

Attributes can be provided to be set as user attributes on the current user. These attributes will be attached to the user's profile in the Boomtrain Marketing Engine.

While attributes can have any form, the following attributes are reserved and specially-handled by Boomtrain:

Attribute

Description

first_name

String

First name of the user.

last_name

String

Last name of the user.

signed_up_at

ISO-8601 Timestamp String

Time at which this user first signed up.

user_id

String

The user_id of this user. When provided, this will identify the user just as it does in the Identify call. Note that this will change the identity of the current user to the provided user_id and set the attributes for this provided user.

email

String

The email of this user. When provided, this will identify the user just as it does in the Identify call. Note that this will change the identity of the current user to the provided email and set the attributes for this provided user.