Detect chat button click event

Hi,
We currently execute a function after we load the chat widget to send customer's sessionid to Gensys cloud.

This works well on the page load when customer enter the chat.
However if the customer close the chat and re-open chat again, this function will not be executed so the the data won't be send to architect.

Is there a way to detect the chat button click event and execute our function so we can re-send the data again?

Here is what we have on the page
$(document).ready(function () {
SendSessionID();
});

function SendSessionID() {
   Genesys("command", "Database.set", {
      messaging: {
      customAttributes: {
      sessionid: {{sessionid}},
    }
    }
    });
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.