...
As mentioned you will be able to save up to 10 different kinds of payloads this way.
Pre-fill user data for the web chat user
If you already have the user’s information like name or email, etc, you can pass that information directly to the web chat user.
Also you can pass extra parameters directly to the web chat user’s user custom field.
Passing user information
You can use add this script to pass the user information to the web chat user.
Code Block |
---|
<script>
window.addEventListener("chatbot:ready", function () {
window.$chatbot.setUser("XXXX", {
email: "YYYYYY",
name: "ZZZZ",
avatar_url: "https://res.cloudinary.com/gmdigital/image/upload/v1618453871/profile/3636079236501557.jpg"
});
});
</script> |
You will need to make sure the userID XXXX is unique for each user.
Passing extra parameters to web chat user
If you want to pass the extra parameters to the web chat user, you can using the code below
Code Block |
---|
<script>
window.addEventListener("chatbot:ready", function () {
window.$chatbot.setCustomAttributes({
user_fields: {
provider: "XXXX",
issue_title: "YYYY"
}
});
});
</script> |
Please make sure the name of the user custom field is the same name you have in your UChat Chatbot.
In the example above, the name “provider” & “issue_title”, we have the exact same name in our chatbot.
...
You can watch the video tutorial here to learn more
...
Frequently Asked Questions:
...