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 or display it in the customer profile in your live chat CRM. Every attribute has a name (it’s the same for every user across the bot) and a value (values are specific for every chatbot user).
Attribute names start with the “$” sign and can contain only Latin letters, numbers, and underscore (“_”) symbols. 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.
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:
Using customer attributes to personalize a chatbot conversation
There are some pre-defined attribute names that you can use to display data in the profile of your customer in the live chat CRM. These are:
- $_first_name - customer's first name
- $_last_name - customer's last name
- $_name - customer's full name
- $_email - customer's email address
- $_phone - customer's phone number
Displaying customer data through pre-defined attribute names