User Attributes allow you to collect, store, and reuse specific information about users to create more personalized and meaningful interactions in your chatbot.
What are User Attributes?
When you ask a question in the bot and you want to save the answer, you have to store it in “User Attribute”.
Think of User Attributes like a user’s profile where you store information they provide during conversations. For example, their name, email address, or even preferences. This helps your chatbot remember details and use them later to deliver more personalized responses.
Why Do You Need User Attributes?
User Attributes are powerful because they allow your chatbot to:
- Personalize Conversations: Call users by their name or offer them tailored responses based on their past choices.
- Collect and Reuse Information: Gather important data like shipping addresses or order preferences, which you can easily recall later.
- Enhance User Experience: By remembering user preferences, you can ensure smoother interactions every time they engage with your chatbot.
Examples of User Attributes
- Order Placement
When users place orders, you can collect important details through input fields:
- Name: {{customer_name}}
- Shipping Address: {{shipping_address}}, {{shipping_city}}, {{shipping_postal_code}}
- Product Details: {{product_name}}, {{product_quantity}}, {{product_price}}
- Payment Method: {{payment_method}}
- Order Confirmation
Once you've gathered all the necessary information, use the stored details to confirm the order:
“Thank you, {{customer_name}}! Your order has been placed. Here’s a summary of your order”:
- Order ID: {{order_id}}
- Products: {{product_name}} (Quantity: {{product_quantity}}, Price: {{product_price}})
- Shipping Address: {{shipping_address}}, {{shipping_city}}, {{shipping_postal_code}}
- Billing Address: {{billing_address}}, {{billing_city}}, {{billing_postal_code}}
- Total Amount: {{order_total}}
- Payment Method: {{payment_method}}
- Delivery Instructions: {{delivery_instructions}}
- Order Tracking and Updates
Keep users informed about their order status using the {{order_status}} attribute.
How to Use User Attributes
User attributes are created by the bot designer and are automatically saved when users provide information. Here’s a step-by-step example of how to ask a question, save the answer in a User Attribute, and use it later:
- Ask a Question: The chatbot asks the user a question (e.g., “What’s your name?”).
- Store the Answer: The user’s response is stored in a User Attribute (e.g., {{customer_name}}).
- Use the Stored Data: Later in the conversation, you can call upon this stored data (e.g., “Nice to meet you, {{customer_name}}”).
Collecting Information: Types of User Input
-
Free Text with User Input:
- Users type their answers freely.
- Example: “Please enter your email.”
- Quick Replies or Buttons Options:
- Users pick from predefined options.
- Example: “Choose your preferred payment method: [Credit Card] [PayPal] [Cash on Delivery].”
Learn more about implementing Quick Replies or Buttons for enhanced functionality.
How to Create User Input Fields and Store Them as Attributes
- Display a message: Inform the user that you are collecting information from them.
- Add a "User Input": This will capture the user's response.
Remember, always add a question first and then place the "user input" right below it.
- Assign a unique user attribute name to each question for accurate tracking.
- Select the data format: Choose the appropriate data format based on the question type (text, phone number, email, number, location, date & time, URL).
- Add a condition (optional): Validate the user input using a condition if necessary.
- Add a retry message: Provide a message to be displayed if the user enters an invalid input multiple times.
- Set retry time: Set the number of allowed retries for invalid input.
- Select the next flow: Choose the next flow in the conversation after the user has entered invalid input.
Importance of Unique Attribute Names
Imagine you have a chatbot that asks users about their favorite foods and drinks. You might ask two questions:
- What is your favorite food?
- What is your favorite drink?
If you name both of these attributes simply as {{favorite}}, the chatbot would get confused because it doesn’t know whether {{favorite}} refers to the user’s favorite food or drink. This could lead to the bot giving incorrect or irrelevant responses in future interactions.
Example of What Could Go Wrong
Let’s say you ask the user:
-
Q1: “What is your favorite food?”
- User’s Answer: Pizza (stored in {{favorite}})
Later, you ask:
-
Q2: “What is your favorite drink?”
- User’s Answer: Coffee (also stored in {{favorite}})
If both answers are stored under the same attribute name ({{favorite}}), the bot will overwrite the first answer (Pizza) with the second one (Coffee). Now, when you try to recall the user’s favorite food, the bot will incorrectly say it’s Coffee instead of Pizza!
How to Fix This
Give each attribute a unique and descriptive name:
- For the food question, use {{favorite_food}}.
- For the drink question, use {{favorite_drink}}.
Handling Invalid Input
To ensure a smooth user experience, manage invalid input effectively:
- Show an error message if the input is wrong.
- Offer suggestions to correct it.
- Allow users a few retries to fix their input.
Managing your custom attributes
You can easily edit or archive (temporarily hide) your User Attributes:
- Go to: Settings > Attributes > User Attributes.
- Edit: Modify the details of an attribute.
- Archive: Hide an attribute if you don’t need it now (you can always restore it later).
Please, notice that archiving User Attributes allows you to restore them later.
Note: User Input Saves attributes in the "User Attributes" section
Integration with Google Sheets
You can seamlessly integrate User Input data with Google Sheets for comprehensive storage and easy tracking. Follow this guide to learn how to integrate your chatbot with Google Sheets. 🗃️