Legacy Dev Forum Posts

 View Only

Sign Up

Metrics for participants in recording

  • 1.  Metrics for participants in recording

    Posted 06-05-2025 18:25

    Daigo | 2023-03-09 02:30:20 UTC | #1

    How can I get metrics for each participant in a recording?


    Eos_Rios | 2023-03-09 02:35:05 UTC | #2

    Using any of;


    Daigo | 2023-03-09 03:03:49 UTC | #3

    Hi @Eos_Rios!

    I can see the metrics are in the sessions for each participant in a conversation.

    Now I'm having trouble linking a session to a recording. Looking at the conversation and recording they seem to be related by session ID and peer ID. The session ID of the recording is equal to a peer ID in a session for the participant "customer" . Moreover, sessions for the participant "agent" have peer IDs equal to the customer's session. Do the metrics from these agent sessions correspond to the agents metrics for the recording?

    I've added an example to below

    # Recording
    { ...
    "sessionId": "3e8464db-aa31-4a8e-bf25-f3154926b1bd",
    }
    
    # Conversation
    {
      "participants": [
        {
          "purpose": "customer",
          "sessions": [
            {
              "sessionId": "912335c8-97bc-4425-a575-251d964ace28",
              "peerId": "3e8464db-aa31-4a8e-bf25-f3154926b1bd", // Equal to session ID of recording
              "metrics": ["Omitted"]
            }
          ]
        },
        {
          "purpose": "agent",
          "sessions": [
            {
              "peerId": "912335c8-97bc-4425-a575-251d964ace28",// Equal to session ID of "customer"
              "sessionId": "6f7c8c39-a99b-4092-9902-d28101aba9d6", 
              "metrics": ["Omitted"] // <- Are these the metrics for the recording?
            }
          ]
        }
      ]
    }

    Daigo | 2023-03-09 03:06:33 UTC | #4

    Or is there a more straight forward method to extract metrics for each participant in a recording?


    Eos_Rios | 2023-03-09 03:25:55 UTC | #5

    Or is there a more straight forward method to extract metrics for each participant in a recording?

    This does not appear to be a use case the developers considered typical, I am not aware of any easy way to do it.

    Both sessionId and peerId are SessionIds, the peer Id is a way of relating different facets of the conversation together, so in the example you gave that agent and that customer interacted. Recordings are by agent, not by customer, so the session ID you get in the recording is from the agent's perspective. Different Metrics emit for different participant types, so some metrics will only be present in the customer and some will only be present in the agent, and more painfully some will only be present in the ACD (like abandons) which will have no easy relation to a recording, so depending on what you're looking for your logic may get exponentially more complex.


    Daigo | 2023-03-09 03:37:46 UTC | #6

    Recordings are by agent, not by customer, so the session ID you get in the recording is from the agent's perspective.

    So this is kind of confusing. Why isn't the recording's session and agent's session the same? Why is the recording's session a peer of the customer's session? Is a recording a session and considered another facet of the conversation?

    Sorry in advance for bombarding you with questions.


    Eos_Rios | 2023-03-09 03:45:19 UTC | #7

    Depending on which recording API you're looking at and how you're configured the recording metadata may represent a single channel with both the agent and the customer in it, in which case I thought it was the agent's session that it uses but I could be wrong, or a separate recording and session each, in which case you may be looking at the customer's recording and there's another for the agent you're not also accounting for.

    You're in somewhat niche territory.


    Daigo | 2023-03-09 04:03:26 UTC | #8

    Ok. I've omitted an important detail. The recordings are of media type "message" so there shouldn't be any dual channels.

    You're in somewhat niche territory.

    Thanks for pointing this out. I've had trouble trying to figure this out and assumed I'm bad at reading documentation :grinningfacewithsmilingeyes:


    Daigo | 2023-03-09 04:06:45 UTC | #9

    Looking at the field sessionId in Recording type

    The session id represents an external resource id, such as email, call, chat, etc

    Any idea what "external resource id" corresponds to? Is that something I can fetch?


    Eos_Rios | 2023-03-09 04:20:48 UTC | #10

    Daigo, post:8, topic:18802
    Ok. I've omitted an important detail. The recordings are of media type "message" so there shouldn't be any dual channels.

    That is a bit a important, because in that context I don't even know what they've shoehorned into the recording concept.

    Daigo, post:9, topic:18802
    Any idea what "external resource id" corresponds to?

    It's not some discrete thing you haven't found, it's just telling you it's a unique identifier for that resource that you're already looking at; the session.

    Daigo, post:9, topic:18802
    Is that something I can fetch?

    Not any differently than you are already looking at.

    Assuming whatever metrics you're looking for are agent related I would say your easiest approach here may be using the ConversationId from the recording and pulling aggregates to get the metric you want, grouped by UserId


    Daigo | 2023-03-09 05:39:11 UTC | #11

    Thanks! I'll see what I can do with it.


    John_Carnell | 2023-03-27 15:40:05 UTC | #12


    This post was migrated from the old Developer Forum.

    ref: 18802