Author Topic: Configuration Visitor name  (Read 8884 times)

0 Members and 1 Guest are viewing this topic.

Infoserv

  • Jr. Member
  • **
  • Posts: 3
Configuration Visitor name
« on: September 26, 2018, 12:59:05 PM »
Hello,

I need some help to configure the "visitor name"
 for it to be pre-registered at customer connexion.

thank you for you help
« Last Edit: September 26, 2018, 01:25:16 PM by Infoserv »

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Configuration Visitor name
« Reply #1 on: September 26, 2018, 04:19:03 PM »
What exactly are you trying to do?

Don't hesitate to provide maximum details. Only that way one could be able to understand your question.

stryker1

  • Full Member
  • ***
  • Posts: 10
Re: Configuration Visitor name
« Reply #2 on: October 13, 2018, 01:51:26 PM »
I guess he also wants the same as I:
I want to integrate Mibew in an existing web application where the user is logged in, so I already know is name.

I want to directly start the chat, without the first step that the user has to enter his name (again).

Is there a way to start the chat without asking for the username, or even better: start the chat with the name of the user? Maybe include the name as parameter in the event the chat button fires when opening the Mibew chat window?

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Configuration Visitor name
« Reply #3 on: October 13, 2018, 10:00:57 PM »
I guess he also wants the same as I:

Could you borrow me your crystal ball? Mine seems broken.  ;D

I want to integrate Mibew in an existing web application where the user is logged in, so I already know is name.

I want to directly start the chat, without the first step that the user has to enter his name (again).

Is there a way to start the chat without asking for the username, or even better: start the chat with the name of the user? Maybe include the name as parameter in the event the chat button fires when opening the Mibew chat window?

You can start the chat without asking for anything. Just disable the option "Pre-chat survey".

As of predefined visitor name, there are two possible ways:

1. The right (and complicated) one is to create a plugin that will make use of \Mibew\EventDispatcher\Events::VISITOR_TRACK and \Mibew\EventDispatcher\Events::THREAD_CREATE events. See docs here and here for more details.

 2. The tricky (and not recommended) one is to manually alter the code of the button.

 One have to replace:

Code: [Select]
Mibew.ChatPopup.init({"id":"<some unique id>","url":"\/mibew\/chat?locale=en"
with

Code: [Select]
Mibew.ChatPopup.init({"id":"<some unique id>","url":"\/mibew\/chat?locale=en&name=<the desired visitor name>"
In that case the default name in the form will be equal to the desired value. But it's a kind of hack, so use at your own risk.

stryker1

  • Full Member
  • ***
  • Posts: 10
Re: Configuration Visitor name
« Reply #4 on: October 14, 2018, 11:51:05 AM »
Quote
2. The tricky (and not recommended) one is to manually alter the code of the button.
This is working great :) Thank you!