Ask AI
HomeFAQs & General InfoHow to send user's info (unique userID, email etc) and other attributes from your web/app to Bot9.

How to send user's info (unique userID, email etc) and other attributes from your web/app to Bot9.

Sending user information from your web or mobile application to Bot9 is essential for personalizing interactions and maintaining consistent user management. This guide will explain how to integrate Bot9 with your application to send unique user IDs, email addresses, names, and custom attributes.

Setting Up Your Bot9 Chat Widget

To start, you will need to include the Bot9 widget script in your application. This widget enables the real-time chat interface and user data transmission to Bot9.

You can find your script here: Integrations > Look for the option Integrate under Chat Widget integration.

By pasting the unique code snippet just before the closing </body> tag in your web or app, a chat widget will appear.

< script > BOT9_DATA = {
    bot9Id: "e542f20d-a4e6-4ce3-8a3a-2745b6a37ca2",
};
document.head.appendChild(document.createElement('script')).src = 'https://sdk.chatwidget.in/bot.js'; </script>

In the script, bot9Id is a unique identifier for your Bot9 application. Make sure to replace "e542f20d-a4e6-4ce3-8a3a-2745b6a37ca2" with the actual ID provided to you by Bot9.

Adding User Information

To enhance user experience and enable personalized interactions, you can send user-specific data such as a unique userID, email, name, and custom attributes. Here is how you can modify the script to include this information:

<script>
  BOT9_DATA = {
    bot9Id: "e542f20d-a4e6-4ce3-8a3a-2745b6a37ca2",
    // user: {
    //   userId: '<unique_user_id>',
    //   emailId: '<user_email>',
    //   name: '<user_name>',
    //   customAttributes: {
    //     Field1: '',
    //     Field2: '',
    //     Field3: '',
    //   }
    // }
  };
  document.head.appendChild(document.createElement('script')).src = 'https://sdk.chatwidget.in/bot.js';
</script>

Parameters Explained

  • userId: A unique identifier for each user. This could be a UUID or any other unique string that your system uses to identify users.

  • emailId: The user's email address. This is important for sending communications or for user identification if they use their email as a login.

  • name: The user's full name. This can be used for personalized greetings or support.

  • customAttributes: A set of key-value pairs that store additional information about the user. This could include user preferences, account settings, or other relevant data for personalized interactions. Just make sure that you have created the custom attribute, matching the exact name in Bot9.

Why Include User Information?

Including detailed user information in Bot9 interactions provides several benefits:

  1. Personalization: Personalized greetings and responses make the user experience more engaging and human-like.

  2. Consistency: Using a unique userID ensures that user data remains consistent across different sessions, even if their email address changes.

  3. Privacy: If you are concerned about user privacy, sending a userID instead of more sensitive details (like an email address) might be preferable.

  4. Enhanced Support: Access to detailed user information can help in providing more efficient support and quicker resolution of user issues.

Final Integration

After setting up the user information in the BOT9_DATA object, the Bot9 widget will automatically utilize this data to personalize and enhance user interactions in the chat widget. Ensure that the user data is dynamically replaced with actual user details when they log into your system to keep the information up to date.

By following these instructions, you can ensure a seamless integration of Bot9 with your web or mobile application, leading to a more personalized and effective user experience.

Copyright © 2024 Bot9. All rights reserved.