Author Topic: Chat statistics not working - SOLVED  (Read 1877 times)

Offline Jones

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 0
Chat statistics not working - SOLVED
« on: June 29, 2017, 12:59:28 AM »
Hi all,

We recently started using the new Genesys chat widget and obviously would like to see some stats.
In Pulse and stat server there are a bunch of pre-made chat stats, filters and templates, the standard things like accepted and offered, handle time, AHT all work.
However... some stats do not work and I don't know where to look for the issue, the stat widget just turns up empty, no error. Any clues anyone?
As the stats are pre-made, I think they should be correct so what are we doing wrong? The option attach-session-statistics is set to all.
I can't find anything about reply times, message count etc in Stat server or Interaction server logs.

According to docs:

After a chat session is finished, Chat Server attaches the following list of reporting statistics to the user data of the interaction in Interaction Server:

Chat session end reason codes always attached, no configuration required.
Chat session transcript statistics controlled by the attach-session-statistics option.


Two stat examples:

[Agent_csg_FirstReplyTime_FirstAgentTime_AverageCustomValue]
Category = AverageCustomValue
Formula = GetNumber("csg_SessionUntilFirstReplyTime",1)-GetNumber("csg_SessionUntilFirstAgentTime",1)
MainMask = InteractionHandling
MediaType = chat
Objects = Agent,Place,GroupAgents,GroupPlaces
Subject = DNAction

[Agent_csg_FirstReplyTime_FirstAgentTime_MaxCustomValue]
Category = MaxCustomValue
Formula = GetNumber("csg_SessionUntilFirstReplyTime",1)-GetNumber("csg_SessionUntilFirstAgentTime",1)
MainMask = InteractionHandling
MediaType = chat
Objects = Agent,Place,GroupAgents,GroupPlaces
Subject = DNAction

pre-made filters:

CH_SA_VQ_Segment = PairExist("UserDataKey", "UserDataValue")&~PairExist("DeliveredAt", "*")&(ThisQueue="ChatDefaultDistribution"|ThisQueue="ChatSkillBasedDistribution")
CH_SAS_VQ_Segment = PairExist("UserDataKey", "UserDataValue")&(ThisQueue="ChatInitialization"|ThisQueue="ChatDefaultDistribution"|ThisQueue="ChatSkillBasedDistribution")
CH_Start_VQ_Segment = PairExist("UserDataKey", "UserDataValue")&~PairExist("DeliveredAt", "*")&ThisQueue="ChatInitialization"
CHAT_MEDIA = MediaType=chat
ChatSession = MediaType=chat
cse_AgentReplyMaxTime = PairExists("cse_AgentReplyMaxTime","*")
cse_AgentReplyTotalCount = PairExists("cse_AgentReplyTotalCount","*")
cse_AgentReplyTotalTime = PairExists("cse_AgentReplyTotalTime","*")
csg_MessagesFromAgentsCount = PairExists("csg_MessagesFromAgentsCount","*")
csg_MessagesFromAgentsSize = PairExists("csg_MessagesFromAgentsSize","*")
csg_SessionUntilFirstAgentTime = PairExists("csg_SessionUntilFirstAgentTime","*")
csg_SessionUntilFirstReplyTime_csg_SessionUntilFirstAgentTime = PairExists("csg_SessionUntilFirstReplyTime","*")&PairExists("csg_SessionUntilFirstAgentTime","*")
csg_SessionWithCustomerTime_csg_SessionUntilFirstAgentTime = PairExists("csg_SessionWithCustomerTime","*")&PairExists("csg_SessionUntilFirstAgentTime","*")
« Last Edit: July 04, 2017, 02:34:24 PM by Jones »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7188
  • Karma: 56330
Re: Chat statistics not working
« Reply #1 on: June 29, 2017, 01:13:13 AM »
Check StatServer logs and also start up logs, that is quite important

Enviado de meu E6633 usando Tapatalk


Offline Jones

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 0
Re: Chat statistics not working
« Reply #2 on: July 03, 2017, 04:34:30 PM »
No errors and I see the data I want to show in Pulse... but Pulse just says "0"

   'ChatServerSessionClientLeftAt' [str] = "2017-07-03T07:05:32Z"
      'ChatServerSessionClosedAt' [str] = "2017-07-03T07:05:32Z"
      'csg_SessionEndedBy' [str] = "CLIENT"
      'csg_SessionEndedReason' [str] = "QUIT"
      'csg_MessagesFromAgentsCount' [int] = 3
      'csg_MessagesFromCustomersCount' [int] = 3
      'csg_MessagesFromAgentsSize' [int] = 68
      'csg_MessagesFromCustomersSize' [int] = 36
      'csg_SessionTotalTime' [int] = 46
      'csg_SessionWithCustomerTime' [int] = 46
      'csg_SessionUntilFirstAgentTime' [int] = 7
      'csg_SessionUntilFirstReplyTime' [int] = 19
      'csg_PartiesAsAgentCount' [int] = 1
      'csg_PartiesAsCoachCount' [int] = 0
      'csg_PartiesAsMonitorCount' [int] = 0
      'cse_AgentWaitMaxTime' [int] = 4
      'cse_AgentWaitTotalCount' [int] = 2
      'cse_AgentWaitTotalTime' [int] = 7
      'cse_AgentReplyMaxTime' [int] = 11
      'cse_AgentReplyTotalCount' [int] = 1
      'cse_AgentReplyTotalTime' [int] = 11
      'cse_CustomerWaitMaxTime' [int] = 11
      'cse_CustomerWaitTotalCount' [int] = 1
      'cse_CustomerWaitTotalTime' [int] = 11
      'cse_CustomerReplyMaxTime' [int] = 4
      'cse_CustomerReplyTotalCount' [int] = 2
      'cse_CustomerReplyTotalTime' [int] = 7
      'csg_UploadedFilesClientCount' [int] = 0
      'csg_UploadedFilesAgentCount' [int] = 0
      'csg_UploadedFilesClientSize' [int] = 0
      'csg_UploadedFilesAgentSize' [int] = 0
      'csg_UploadedFilesDownloads' [int] = 0
      'DispositionCode' [str] = "No-reply"

Offline Jones

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 0
Re: Chat statistics not working
« Reply #3 on: July 03, 2017, 05:17:44 PM »
Might have solved the issue...
« Last Edit: July 03, 2017, 05:21:29 PM by Jones »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7188
  • Karma: 56330
Re: Chat statistics not working
« Reply #4 on: July 03, 2017, 10:11:08 PM »
How...?

Enviado de meu E6633 usando Tapatalk


Offline Jones

  • Jr. Member
  • **
  • Posts: 67
  • Karma: 0
Re: Chat statistics not working
« Reply #5 on: July 03, 2017, 10:14:56 PM »
Remove filter from the Pulse widget and also change the stat. It now shows me numbers at least, in stead of 0.
And it seems to be correct. In bold the change, from 1 to -1

[Agent_csg_FirstReplyTime_FirstAgentTime_MaxCustomValue]
Category = MaxCustomValue
Formula = GetNumber("csg_SessionUntilFirstReplyTime",-1)-GetNumber("csg_SessionUntilFirstAgentTime",-1)
MainMask = InteractionHandling
MediaType = chat
Objects = Agent,Place,GroupAgents,GroupPlaces
Subject = DNAction

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7188
  • Karma: 56330
Re: Chat statistics not working
« Reply #6 on: July 04, 2017, 02:05:42 AM »
Thanks for sharing the solution for others

Offline abudwill

  • Full Member
  • ***
  • Posts: 148
  • Karma: 4
Re: Chat statistics not working - SOLVED
« Reply #7 on: February 14, 2020, 03:09:35 PM »
I know this is an old thread, but it is worth adding to.

Pulse has included new statistic definitions (in Pulse installation folder /scripts/pulse_statistics.cfg) that can be imported into Stat Server for quite some time now.  Among many of these statistics are ones named Agent_csg_* or Agent_cse_* and include the following:

Agent_csg_CustomerTime_FirstAgentTime_AverageCustomValue
Agent_csg_CustomerTime_FirstAgentTime_MinCustomValue
Agent_csg_CustomerTime_FirstAgentTime_MaxCustomValue
Agent_csg_CustomerTime_FirstAgentTime_TotalCustomValue
Agent_csg_SessionUntilFirstAgentTime_AverageCustomValue
Agent_csg_SessionUntilFirstAgentTime_MaxCustomValue
Agent_csg_FirstReplyTime_FirstAgentTime_AverageCustomValue
Agent_csg_FirstReplyTime_FirstAgentTime_MaxCustomValue
Agent_cse_AgentReplyTotalTime_by_TotalCount_TotalCustomValue
Agent_cse_AgentReplyMaxTime_TotalCustomValue
Agent_cse_AgentMessagesTotal_by_TotalCount_TotalCustomValue
Agent_cse_AgentReplyTotalCount_TotalCustomValue
Agent_cse_AgentReplyTotalTime_TotalCustomValue
Agent_csg_MessagesFromAgentsSize_TotalCustomValue
Agent_csg_MessagesFromAgentsCount_TotalCustomValue

I am not sure what "csg" or "cse" stands for.  There seem to be ICON/GIM implications here as well - this data can be made to flow into historical reports if configured.

Within Genesys support site somewhere there is an excel spreadsheet documenting the statistics defined in the packaged pulse_statistics.cfg which do include descriptions for what these stats are.  To give you an idea of some of what is available, here is a small snapshot of the descriptions for some of the stats:

Avg customer wait for agent while handling a chat session.
Max customer wait for agent while handling a chat session.
Avg duration before first agent greeting while handling a chat session.
Max duration before first agent greeting while handling a chat session.
Average time it takes for agent to reply to a customer while handling a chat session.
Maximum time it takes for agent to reply to a customer while handling a chat session.
Average size of the message sent by agent while handling a chat session.
Total number of repllies sent by the agent to the customer.
Total time an agent spent replying to a customer.
Total number of symbols agent typed in message.
Total number of messages sent by agent.

These statistics can give a very detailed view of agent chat activity in real time reporting tools.  As the original poster mentions in order for these statistics to be made available to stat server / interaction server the option settings.attach-sessions-statistics should be investigated which exists on your chat server application object.  Valid values are none, all, fired.  Also, the stats are not provided to stat server until the chat session is over/terminated.

In older versions of stat server the stats were defined with Formulas which didn't seem to work.  The original poster provides an example of this.  For example:
[Agent_csg_MessagesFromAgentsCount_TotalCustomValue]
Category=TotalCustomValue
Formula=GetNumber("csg_MessagesFromAgentsCount", 1)
MainMask=InteractionHandling
MediaType=chat
Objects=Agent,Place,GroupAgents,GroupPlaces
Subject=DNAction

This particular statistic data is provided by chat server.  When a chat interaction is over statistical data gets sent from chat server and part of UserData includes a whole bunch of keys I can't find documented very well anywhere (such as csg_MessagesFromAgentsCount).  This particular bit of data represents the number of total characters an agent sent to a customer.  So with this stat, you could use real time reporting to see how many total characters an agent has sent in chat messages to customers over the span of a day or time range.

However as the original poster mentioned, this doesn't seem to work immediately out of the box:

1. Original poster also mentions when Formula is set to, Formula=GetNumber("csg_MessagesFromAgentsCount", 1), which I believe means take the index occurrence 1 of csg_MessagesFromAgentsCount in the message - the data does not get collected properly.  I also found this to be true until I upgraded to the absolute latest version of Stat Server (8.5.112.14 at the time of writing this post) which clearly did not exist when the original poster shared the information.  At first, I had to change the formula to reflect -1 instead of 1.  I believe -1 means take the last occurrence of csg_MessagesFromAgentsCount.  With latest version of stat server "1" works.  I could not find any details regarding bug fixes in release notes.

2. If you use Pulse, the Widget Template "Chat Agent Activity" automatically applies a filter named csg_MessagesFromAgentsSize, which is defined as PairExists("csg_MessagesFromAgentsSize","*").  This filter seems to break collection of the data.  I am not sure why yet.  My experience has been you have to REMOVE this filter to have data collected

These general rules would seem to apply to all of the Agent_csg* and Agent_cse* statistics related to detailed chat handling which are included with Pulse.


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7188
  • Karma: 56330
Re: Chat statistics not working - SOLVED
« Reply #8 on: February 15, 2020, 03:04:59 AM »
Interesting! Thanks for sharing! Seems quite a lot of information to use


Enviado de meu SM-N9600 usando o Tapatalk


Offline abudwill

  • Full Member
  • ***
  • Posts: 148
  • Karma: 4
Re: Chat statistics not working - SOLVED
« Reply #9 on: February 16, 2020, 09:01:34 AM »
One last thing I will share.  It is actually not necessary to remove the filters for the stats in Pulse or other real time reporting tools.  However in order for the filters to work properly, stat server must have option statserver.subscribe-for-all-ixn-server-events set to yes (default it is no and does not exist in options).  Once this is set, stat server will listen to and parse all events from interaction server and as a result udata is parsed in a way which allows the filters to apply properly.