Identifying users and passing fields

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 fields.

Some things to note when passing fields:

  • Fields passed via the widget only show in UI once the user has interacted with UserVoice.
  • Only standard fields show in NPS report (not custom fields)
  • You can only pass one account and it’s fields with a user. To pass multiple accounts for a user, you will need to use the API.

**denotes a required field

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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, // Unique id of the user (if set, this should not change)
  type:       'Owner', // Optional: segment your users by type
  cf_customfieldkey: 'custom field value' // Optional: segment your users by predefined custom fields
  account: {
    **id:           123, // 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
    cf_customfieldkey:'custom field value'// Optional: segment your accounts by predefined custom fields
  }
}]);

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

User fields:

User field Type Default value Description
email string User’s unique email address. Required.
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 (when set, this should not be changed).Required.
type string Segment your users by type. For example, “Designer”, “Developer”, “Teacher”.
custom field string, text, number, boolean or timestamp See API documentation
account object* Group users by account and pass in specific account-related fields.

Account fields:

Account field Type Default value Description
id string or int Unique id of the account. Allows you to associate multiple users with a single account. When set, other account fields will be attributed to the single user. Required.
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.
custom field string, text, number, boolean or timestamp See API documentation

Related topics