Supposing we have a client-server architecture where the client is using javascript Live Agent APIs and the server is Salesforce, is it possible for the client to send arbitrary data in realtime towards the server and link those data to the current chat session after the chat has started?

For example, something like this timeline:

  • chat with operator starts
  • the user clicks button "A" so variable "button A pressed" is passed to the server (user is still chatting)
  • the user clicks button "B" so variable "button B pressed" is passed to the server (user is still chatting)

And so on.



  • I may be able to help, but I'm a bit unclear on what you're asking. Can you provide more details on what it is you're trying to accomplish? Commented Apr 10, 2015 at 16:16
  • I've integrated my question with a real use case, hope this makes it clearer.
    – friol
    Commented Apr 10, 2015 at 17:54

1 Answer 1


It sounds like you want the custom event API. It's documented as part of the service cloud console integration toolkit: http://www.salesforce.com/us/developer/docs/api_console/

To publish a custom event from the chat window indicating button A was pressed:

liveagent.chasitor.sendCustomEvent("buttonPress", "A");

In a service cloud console component (you can get chatKey via sforce.console.chat.getDetailsByPrimaryTabId):

sforce.console.chat.onCustomEvent(chatKey, "buttonPress", function(type) {
    alert("Button "+type+" pressed!");
  • Thanks. Can I do this externally from the chat window? And also, will those events be related to the chat in any way on the database?
    – friol
    Commented Apr 14, 2015 at 6:09
  • @GabrieleD'Antona Were you able to find a solution to this? I know this is an old thread, I am trying something similar, difference is we do not use button and using the addcustomdetail. I am not sure how can I access those information. Commented Mar 2, 2017 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .