Chatbots generate and use a memory for each user. 

If you share your chatbot with a known user base (a Mailchimp newsletter for example), we can imagine that you want to pre-inforce certain values so that the user doesn't have to enter them in the chatbot.

This is possible and simple to implement, only for chatbots in mobile, web or widget mode (not on an instant messenger).

The concept is to pass attributes from your source database (e.g. Mailchimp) to the chatbot URL parameters.

Here are the 2 parameters you can enter:

uid: this will be the unique respondentID of the user. By default, we create a unique uid per user in the following form: 5dd425c4186006002378aace. 

In the majority of cases, you will want to replace it with the user's email address. Note: this uid must be unique for all Vizir users, so think of a special format.

ref: ref allows you to bring up in the chatbot attributes concerning your user, such as his first name or email for example.

Here is an example with a uid set as the user's email:

https://chat.vizir.co/monApplication?uid=michel.platini@fifa.com

Here is an example where we send back the uid, first name and email address

https://chat.vizir.co/monApplication?uid=michel.platini@fifa.com&ref=first_name:Michel,email:michel.platini@fifa.com

Here is a last example where we only report the first name and email address

https://chat.vizir.co/monApplication?ref=first_name:john,email:john@doe.fr

If you want to pass settings and the chatbot is accessible via the widget it is also possible.

In the code that you retrieve from the platform, you will have to make some changes:

You wil have to replace appID (line 2) appID = "id"  by something like:
appID= "id?rel=first_name:John,last_name:doe"

Here is an example of the code we can get:

  <script type="text/javascript">
  var appID = '5e41479e68667d002d87344f?ref=first_name:John,last_name:doe';
  var url = 'httts://chat.vizir.co'
  ! function() {
    var e, l, t, a, c = document,
    r = c.getElementById,
    s = c.createElement,
    i = c.getElementsByTagName,
    n = 'n',
    d = 'https://chat.vizir.co/static/widget/';
    r.call(c, n) || (l = s.call(c, 'script'), l.id = n, l.src = d + 'new.js', t = i.call(c, 'script')[0], t.parentNode.insertBefore(l, t)), n += '_', r.call(c, n) || (e = s.call(c, 'link'), e.rel = 'stylesheet', e.id = n, e.href = d + 'm.css', a = i.call(c, 'head')[0], a.appendChild(e, a))
  }();
  </script>

WARNING :

Whatever you want to do with this attribute passed as a parameter in the chatbot, you have to create it by hand in the bot's memory.

So go to Settings > Memory > Add attribute

Then, declare this attribute as a root => attribute so that it can be used everywhere!

You can now use this attribute by calling it with moustaches! For example: {{screenshot}} in my case!

To check that your attribute passed in parameter was well recorded in the memory of the chatbot it is very simple:

Launch a conversation with the chatbot then go to the dashboard, in the tab Conversations > settings and check that it is present.

It's up to you!

Did this answer your question?