Skip to main content
Question

Using Intercom's API to calculate conversation metrics


  • New Participant
  • 1 reply

I have been using the Intercom API to try to recreate the regular metrics in Metabase. I have tried using this resource but haven’t found it to be particularly helpful. 

For example, if I try this query, the response maps to the New Conversations Metric in the Intercom dashboard instead of the Assigned Conversations metric which is my intention. 
SELECT
  "Inbox Details - Team Assignee"."inbox_name" AS "Inbox Details - Team Assignee__inbox_name",
  COUNT(*) AS "count"
FROM
  "public"."conversations_data"
 
LEFT JOIN "public"."inbox_details" AS "Inbox Details - Team Assignee" ON "public"."conversations_data"."team_assignee_id" = "Inbox Details - Team Assignee"."inbox_id"
WHERE
  (
    (
      "Inbox Details - Team Assignee"."inbox_name" = 'VIP Support Inbox'
    )
   
    OR (
      "Inbox Details - Team Assignee"."inbox_name" = 'Support'
    )
    OR (
      "Inbox Details - Team Assignee"."inbox_name" = 'VIP Escalation Inbox'
    )
    OR (
      "Inbox Details - Team Assignee"."inbox_name" = 'Escalation Inbox'
    )
  )
 
   AND (
    "public"."conversations_data"."created_at" >= timestamp with time zone '2025-02-27 00:00:00.000 +00:00'
  )
  AND (
    "public"."conversations_data"."created_at" < timestamp with time zone '2025-03-06 00:00:00.000 +00:00'
  )
GROUP BY
  "Inbox Details - Team Assignee"."inbox_name"
ORDER BY
  "Inbox Details - Team Assignee"."inbox_name" ASC

I suspect that not getting the right Assigned Conversations metric is cascading to why my closed conversations, median response time, and others are also wrong. 

It would be super helpful to get the calculations for regular conversation metrics based on the exact fields provided in the API response. 

2 replies

Paul Byrne
Intercom Team
Forum|alt.badge.img
  • Intercom Team
  • 9 replies
  • March 9, 2025

Hey ​@Hugo 

Replicating Intercom’s metrics is about recreating the exact event-based logic Intercom uses, not just grouping by inbox_id or counting conversation rows by created_at. You need:

  • Conversation parts.
  • A time-based check on whether those events occurred in your desired range.
  • Careful filtering out system/bot updates from first response times.

Once you incorporate these event-based details, you’ll see your Metabase metrics align much closer to what Intercom’s native reports show.


  • Author
  • New Participant
  • 1 reply
  • March 10, 2025

Hey ​@Paul Byrne how do I access conversation parts?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings