_onBeforeAjaxRequest function not invoked when using Custom widget
Once the customer clicks on submit button (chat lauch page has custom field product code), we need to get the chat Queue name from the custom object (product code and Queue mapping) and route the chat to the corresponding queue.
Approach we used:
We have a custom field "Product Code" on the chat launch page and also have a custom object with two fields Product Code and Queue.
Once the customer clicks on the "Submit" button, we have to access the custom object and retrieve the Queue based on the product code - queue mapping in custom object and then route the chat to the queue.