Skip to content

Managing Users

Learn how to show in-product surveys to specific users.

Anonymous users

Every visitor to your website is assigned a unique identifier by FeedbackSpark. This identifier is stored in the browser’s local storage and is used to track user feedback and responses over time. If a user clears their browser’s local storage, they will be treated as a new user.

Identify users

FeedbackSpark allows you to identify users by their email address, user ID, or any other unique identifier. It allows you to track user feedback and responses over time and gives your users a consistent experience across browsers.

spark('setUser', USER_ID);

Setting user attributes

User attributes are additional data points that you already have about your users. You can send this information to FeedbackSpark to show your survey to a specific segment of users, for e.g. users who purchased in last 60 days. User attributes can also be used to segment users and analyze feedback based on user attributes. For example, you can set user attributes like plan, role, company size, etc.

Acceptable data types for user attributes are:

  1. String,
  2. Number,
  3. Boolean and
  4. Date in ISO-8601 format.

User attributes starting with $ sign are reserved for special attributes like $email, $phone and $name.

spark('setAttributes', {
'<ATTRIBUTE_NAME>': '<ATTRIBUTE_VALUE>',
// '$email': 'john.dow@example.com' // Attribute starting with $ sign are to be used as such.
// 'created at': '2022-09-27 18:00:00.000',// Date in ISO-8601 format
// 'Total Visits': 10, // number
// 'AB Test Assigned': 'Version A' // string in quotes
});

Logging out users

Log out users from FeedbackSpark when they log out from your application. It will avoid associating incorrect user IDs on shared devices.

spark('logoutUser');