Skip to content

SNS Logger

ear-dev edited this page Nov 2, 2022 · 31 revisions

Payload

Subject: 'RC'
TopicArn: `<sns_arn_topic>` (attribute value in the df_config.json, one per DF.agent in the DF.app)
MessageGroupId: `<RC Site Url>`
Message: {
"dialogflowAgentId": "b5983b72-cac6-4f85-b9d0-be61e543dfe6", - added by the logger itself.

"roomId": "be61e543dfe6:wqbFXoeX2kdSZhSyi", 
"tabId": "xxxxx" - This will only be added to events sent from the widget, otherwise it will be empty string. 
"category": "Agent Transfer",
"action": "failed",
"properties": {"failure_reason": "no agent available"},
"eventType": "customerAction/session", # this label for actions taken by the visitor only.  Others are "session" (timeout, agent closes, anything the visitor did not touch)

"timestamp": "2022-09-26T17:50:47.225Z"
}

Events

// Key
// Each actual event has only one Category, one Action, and any number of Properties
{
	"Category": [
		{"Action1": [
			{"Property": "p1"},
			{"Property": "p2"}
		]},
		{"Action2": [
			{"Property": "p1"},
			{"Property": "p2"}
		]}
	]
}

---------------------------------------------

// Representation of all possible Rocketchat events
{
  "Chat Session": [
  	{"closed": [
  		{"close_method": "agent"},  <- SF.app
  		{"close_method": "chat window"},  <- Widget
  		{"close_method": "timeout"},  <- SF.app
                {"close_method": "visitor_abandonment"}  <- RC core?
                {"close_method": "df_bot"} <- ?? - maybe DF.app?
                {"close_method": "expired_session"} <- SF.app
                {"close_method": "liveagent_disconnected"} <- SF.app
                {"close_method": "escalation_failure"}  <- ??
  	]},
       {"started": [{}]} <- DF.app
  ],

  "Escalation": [
  	{"attempted": []}, <- DF.app
  	{"failed": [
  		{"failure_reason": "outside service hours"}, <- DF.app? - currently not available TODO later.
  		{"failure_reason": "no agents available"}, <- SF.app - currently represents service hours and any other reason.
  		{"failure_reason": "salesforce error"}, <- SF.app  InternalServer Error / Salesforce configuration error
  		{"failure_reason": "network/app error"}, <- SF.app - can we distinguish between this error from SF vs. DF?
  		{"failure_reason": "network/app error"} <- DF.app
                {"failure_reason": "invalid target department"} <- DF.app
  		{"failure_reason": "same target department"} <- DF.app
  		{"failure_reason": "liveagent bot offline or disabled"} <- DF.app
		{"failure_reason": “liveagent session id error"} <- SF.app
		{"failure_reason": “error in liveagent request"} <- SF.app
		{"failure_reason": “error in checking liveagent response”} <- SF.app
		{"failure_reason": “error in liveagent response”} <- SF.app
		{"failure_reason": “salesforce internal failure"} <- SF.app
		{"failure_reason": “invalid app configuration"} <- SF.app
		{"failure_reason": “salesforce chat API not found"} <- SF.app
	]},
  	{"successful": [
  		{"queue_time": "<seconds the visitor waited in queue before being paired with live agent>"} <- SF.app - RC has it's own timer
                {"sf_chat_key": "<sessionId from SF payload>"} <- SF.app this event actually has two properties
  	]}
  ],

  "Agent Transfer": [
  	{"successful": []} <- SF.app
  ],

  "Agent Disconnect": [
        {"triggered": []} <- SF.app
  ],

  "Transcript Download": [
  	{"selected": []} <- Widget
  ],
  
 "Survey": [
      {"link_clicked": []}  <- Widget
  ],

  "Window": [ <- re-name this "Tab"?  Not in Tracking Plan?
     {"opened": [
          {"session_id": "XXXXXXX"}  <- Widget 
      ]},
     {"closed": []} <- Widget??
  ]
 }
Clone this wiki locally