chat queue routing

abhinav_khanna
Kilo Expert

Hi all,

 

On the ess portal I want to give a custom link on the page which when clicked opens up the "chat" dialog box and the chat is routed to the correct assignment group based on the users country.
Any idea how to achieve that. I can not hard code the sys_id in the chatqueue function. I want something dynamic which pops up the end user chat on Click.

 

 

Regards
Abhinav Khanna

1 ACCEPTED SOLUTION

TrevorK
Kilo Sage

My initial thought would be that you want to create an "inbetween" piece that either accepts their country as input or takes one from their profile. This piece then redirects to the appropriate Chat Queue based on the result.



While I am not a CMS expert, my thoughts are that a simple way to do this would be through a dynamic content block. The user would enter their country (defaults to their profile country maybe?) and click Chat. The code in the background would then determine the appropriate Chat Queue to send it to and then just redirect to the chat queue link.



We only have one Chat Queue, and we fire it through our dynamic content block in this fashion:


      CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_WINDOW_JOIN_QUEUE_QUERY, 'CHAT_QUEUE_SYS_ID','CHAT_QUEUE_NAME');


I see no reason why there could not just be a little logic before to determine which Chat Queue to fire into.



On the surface, this does not seem too challenging to develop from a technical point of view, however what will be challenging is the UI/UX around this feature.



I am sorry I do not have the code developed for this, as we only use the one Chat Queue but I hope this helps. If you need anything else please post back.


View solution in original post

56 REPLIES 56

Hi Abhinav ,


I changed this aruments but still getting error as


find_real_file.png



Error :



find_real_file.png


Can you please help me with this



Thanks,


Neha


scotthal
Mega Expert

Great thread!  



I enhanced this a bit to automatically have the chat session started, thus eliminating a second click.   This was done by moving the start of the session from an onclick to an onload.


<body onload="CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_WINDOW_JOIN_QUEUE_QUERY, '80a3bb72e98c110038565600f569fab9', 'Service Desk'); return false;"/>


The next part we are trying to get working is to end the chat session when the tab closes.   Most users are not clicking on the little x in the top right corner of the glidebox that kills the chat session.   Thus throwing off metrics.



Here's the code that get's executed when the x is clicked.


CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_LEAVE_CHANNEL, this);


this.fire(LiveEvents.WINDOW_CLOSE);


Awesome, thanks for sharing, I am sure this will help a lot of other users enhance the Chat functionality.


This was done on a custom UI page -- not a Content Management page, right?   And did you have to make the ui page public?



I'm trying the same with no luck.   Its like the page does not understand the CustomEvent.fire() function...



Would it be possible to post the content of the whole page?


I would assume there are multiple ways to do this, so the above poster may have a different way. We use a Content Page that has a Dynamic Content block on it. Here is our code:



<script>


function startChat()


{


if(document.getElementsByClassName('gb_mw').length == 0)


{


CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_WINDOW_JOIN_QUEUE_QUERY, 'YOUR SYS ID','YOUR QUEUE NAME');


}


}


setTimeout(startChat,200);


</script>


<a href="#" onclick="startChat();"></a>




To achieve what the other poster mentioned, with queues, you just need to insert your logic and routing.



Our system is a little more unique than most because we use SAML SSO and in order to make the chat work with anonymous users end up modifying our SAML login script to create a user in the system so they can then authenticate.