User attributes

Every user of your chatbot is unique, and you will definitely want to customize and personalize your conversations. With Activechat, it’s a breeze.

User attributes (some chatbot developers prefer to call it “variables”, as in programming languages) allow you to store specific data about every user and use this data in the conversation. Every attribute has a name (it’s the same for every user across the bot) and value (values are specific for every chatbot user).

Attribute names start with “$” sign and can contain only Latin letters, numbers and underscore (“_”) symbol. System attributes always start with an underscore (“_”), so it’s advised to avoid underscore as the first symbol in your custom attribute names. Here are some examples:

  • $_first_name (system attribute, contains the user’s first name from his/her Facebook profile)
  • $_hour (system attribute, contains current hour in UTC timezone)
  • $number_of_orders (custom attribute)
  • $user_email (custom attribute).

Try to be descriptive when giving names to your attributes – $user_email will work much better than $attr123.

There are three types of user attributes in Activechat:

  • system attributes – contain system-specific data like current time, user’s messenger ID, etc. Check the complete list of Activechat system attributes for more details. The values of these attributes cannot be changed from the conversation.
  • custom attributes – can contain any kind of data that your conversation needs, like user’s email or phone number, purchase price, number of visits, conversation source, various counters, etc. These are designed by you as a conversation designer, so plan what kind of data you need beforehand. These attributes can be set with DATA, SEND and TRIGGER blocks.
  • global attributes – these attributes’ values are the same for every user in the chatbot. Currently, these values can be set through Activechat API only, but we’ll add blocks to manipulate it from the conversation builder soon.

You can use attributes almost anywhere in your conversation – in text messages, quick replies, button names, URLs for images, etc. Here is an example of a TEXT block using $_first_name system attribute to greet the user by his/her name:

Example use of the $_first_name system attribute
Example use of the $_first_name system attribute
Was this article helpful to you? Yes 1 No 1

How can we help?