Identifying users and passing traits

With our Javascript SDK, you can now identify your users—even when they don’t send you feedback. In addition, you can set user traits that will allow you to analyze user satisfaction, feedback and support requests by account, plan, lifetime value, and other traits.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
UserVoice.push(['identify', {
  email:      'john.doe@example.com', // User’s email address
  name:       'John Doe', // User’s real name
  created_at: 1364406966, // Unix timestamp for the date the user signed up
  id:         123, // Optional: Unique id of the user (if set, this should not change)
  type:       'Owner', // Optional: segment your users by type
  account: {
    id:           123, // Optional: associate multiple users with a single account
    name:         'Acme, Co.', // Account name
    created_at:   1364406966, // Unix timestamp for the date the account was created
    monthly_rate: 9.99, // Decimal; monthly rate of the account
    ltv:          1495.00, // Decimal; lifetime value of the account
    plan:         'Enhanced' // Plan name for the account
  }
}]);

Most local environments do not support the cookies needed for our .identify feature to work. We strongly recommend testing in a live environment.

User traits:

User trait Type Default value Description
email string User’s unique email address.
name string User’s real name
created_at int (If not set, UserVoice will assume the first time we see the user is when they were created at.) Unix timestamp (epoch seconds) for the date the user first signed up for your service. Also useful for autoprompting users.
id string or int Unique id of the user (if set, this should not be changed).
type string Segment your users by type. For example, “Designer”, “Developer”, “Teacher”.
account object* Group users by account and pass in specific account-related traits.

Account traits:

Account trait Type Default value Description
id string or int Unique id of the account. Allows you to associate multiple users with a single account. If not set, other account traits will be attributed to the single user.
name string Account name
created_at int The date the account was created.
monthly_rate number Monthly rate of the account.
ltv number Lifetime value of the account.
plan string Plan name for the account.

Related topics