//Set all customer data with one call LiveAgent.setUserDetails(email, firstName, lastName, phone); //Set just specific customer value - supported keys: email, firstname, lastname, phone LiveAgent.addUserDetail(key, value); //Add custom field value to Contact (customer field has to be defined in your LiveAgent>Configuration>System>Contact fields) LiveAgent.addContactField(key, value); //Add custom field value to Ticket (ticket field has to be defined in your LiveAgent>Configuration>System>Ticket fields) LiveAgent.addTicketField(key, value);
Typical use is to call the function in widget integration code before the widget is created:
Hint: You can use it as tracking code only i.e. without showing any contact widget if you omit the line LiveAgent.createButton(...) You will see all online visitors in the Chats > Chats overview screen and if you have any invitations set up, you'll be able to manually invite them to chat.
Before you can set custom ticket fields using function addTicketField, you need to have these fields defined in the LiveAgent menu Configuration -> System -> Ticket fields
Once the contact or chat is started by the visitor, these custom parameters will be passed to created ticket/chat and your agents will be able to see them in ticket details section.
If you are using fields for these custom parameters also directly in your contact or pre-chat form, values defined via addTicketField function will be pre-filled for the visitor and he can change them manually before submitting the form.
If you don't want the values passed in custom ticket fields to be visible by the visitor just don't use these fields directly in the contact or pre-chat forms(Ticket fields still needs to be defined in your LiveAgent). This way these ticket fields are still going to contain the passed value in the button code, but the actual value won't be visible to the visitor anywhere.