//Set all customer data with one call LiveAgent.setUserDetails(email, firstName, lastName, phone); //Clear customer data with one call (available since ver. 5.17) //Before ver. 5.17 such call left fields email, firstName, lastName, phone unchanged LiveAgent.setUserDetails(); //Using value = "" or not specified value will clear specified key (available since ver. 5.17) //Before ver. 5.17 such call left key field unchanged //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); //Clear all customer data and all Contact and Ticket fields with one call - should use before new customer any set/add //to remove all previous customer data (available since ver. 5.17) LiveAgent.clearAllUserDetails(); //Set customer's actual location on the website into the conversation thread LiveAgent.setVisitorLocation(URL);
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.