Skip to main content
Solved

Incorrect Open Rate Calculation When Using Metric Aggregate API

  • December 24, 2025
  • 6 replies
  • 101 views

Forum|alt.badge.img+3

I am having an issue calculating the Open Rate using the Klaviyo API.

To calculate Open Rate, I divide Unique Email Opens by Received Emails. This usually works as expected, but in some cases it produces illogical results.

For example, when querying data for December (2025-12-01 to 2025-12-23):

  • Unique Opens returned: 2,787

  • Received Emails returned: 2

This results in an Open Rate greater than 100 percent, which is not possible.

Below are the request bodies and responses I am using.

 

Open (Unique) request body

{
"data": {
"type": "metric-aggregate",
"attributes": {
"measurements": [
"unique",
"sum_value",
"count"
],
"filter": [
"greater-or-equal(datetime,2025-12-01)",
"less-than(datetime,2025-12-23)"
],
"by": [
"$message"
],
"interval": "month",
"metric_id": "MzHMir",
"page_size": 500
}
}
}

Open (Unique) response

{
"dimensions": [
"01KA"
],
"measurements": {
"unique": [2787.0],
"sum_value": [0.0],
"count": [3378.0]
}
}

Received request body

{
"data": {
"type": "metric-aggregate",
"attributes": {
"measurements": [
"unique",
"sum_value",
"count"
],
"filter": [
"greater-or-equal(datetime,2025-12-01)",
"less-than(datetime,2025-12-23)"
],
"by": [
"$message"
],
"interval": "month",
"metric_id": "KMhTMW",
"page_size": 500
}
}
}

Received response

{
"dimensions": [
"01KA"
],
"measurements": {
"unique": [2.0],
"sum_value": [0.0],
"count": [2.0]
}
}

I would like to understand why the Received metric returns such a low value when grouped by $message and aggregated monthly, and which metric should be used to correctly calculate Open Rate in this scenario.

Please let me know if I am using the wrong metric, aggregation level, or grouping configuration.

Thanks.

Best answer by cadence

@ronen tak, I think to understand whether this is a bug or the actual behavior in your account, you would want to pull all the raw Received Email and Opened Email events via the API for this account. Check on the actual counts (unique or not) during this timeframe, particularly for the Received Email events, which look low. 

It’s hard to tell whether this is actually just what happened in your account over this timeframe (maybe unlikely but possible) or if there’s a bug in Klaviyo’s Query Metric Aggregates API. If the actuals don’t match the aggregates, then there is a bug here that the Klaviyo Team will need to investigate.

 

Cadence / Book a demo

6 replies

cadence
Expert Problem Solver III
Forum|alt.badge.img+12
  • Expert Problem Solver III
  • December 28, 2025

@ronen tak, it’s hard for me to tell whether you’re using the correct metrics here since the metric IDs are unique for each account. 

Can you confirm the name of the metric that corresponds to metric_id “KMhTMW” for your account? And can you confirm “MzHMir” is the “Opened Email” metric?

I’d generally recommend using the Flow & Campaign Reporting APIs to understand per-message open rates.  See https://developers.klaviyo.com/en/reference/reporting_api_overview for details.

 

Cadence / Book a demo


Forum|alt.badge.img+3
  • Author
  • Problem Solver I
  • December 31, 2025

Hi @cadence

I verify that MzHMir = Received Email.

and KMhTMW = Opened Email

I do not prefer to use the API you suggest due to the rate limit.

 

 


cadence
Expert Problem Solver III
Forum|alt.badge.img+12
  • Expert Problem Solver III
  • December 31, 2025

@ronen tak, it looks like you might have inverted the payloads for Received / Opened here in your original post, but it’s hard for me to tell for sure.

You say  “Received” request body for “KMhTMW” and then show the results, but you just confirmed “KMhTMW” is the metric id for “Opened Email”. Can you review your original post and confirm the payloads you posted are for the relevant metrics?  If you swapped these, it would mean you had a really low open rate vs. a nonsensical (>100%) one. 

Also it’s possible if you’re aggregating in this fashion that you’ll get weird results for open rate. Let’s imagine your account sends a big campaign EOD 11/31 (UTC) but then nothing in Dec. You might see a lot of emails received on 11/31 but then nothing in Dec, but many of your opens would be on Dec 1. 

 

The Reporting APIs account for this discrepancy and aggregate based on the send time; this allows for better results. I understand these APIs have lower rate limits, but typically you can optimize your call pattern for these to fit your use case, e.g. by not requesting for each campaign/flow one by one but getting this across all your flows/campaigns at once.

 

Cadence / Book a demo

 


Forum|alt.badge.img+3
  • Author
  • Problem Solver I
  • January 1, 2026

@cadence 

Sorry for the confusion in my previous reply.

To clarify:

  • MzHMir = Opened Email

  • KMhTMW = Received Email

What I was trying to ask is this:

Because I am grouping by $message when calculating the open rate and using a monthly aggregation, could it be that all received events are grouped under the same message ID and therefore collapsed into one or two records, while open events continue to be counted as unique across all sends?

If so, would this explain why I am seeing 2 received events but 2787 open events?

 

 

 


Forum|alt.badge.img+3
  • Author
  • Problem Solver I
  • January 4, 2026

I tried changing the interval instead of using monthly granularity. I switched to daily granularity and aggregated both metrics by "$message", but I am still seeing the same issue with the numbers.

This is the query I am using for received emails:

{
"data": {
"type": "metric-aggregate",
"attributes": {
"measurements": [
"unique",
"sum_value",
"count"
],
"filter": [
"greater-or-equal(datetime,2025-12-01)",
"less-than(datetime,2025-12-31)"
],
"by": [
"$message"
],
"interval": "day",
"metric_id": "KMhTMW",
"page_size": 500
}
}
}

Received response

 {
"dimensions": [
"01KAEY4DP1X7KSVHH8SSH6S770"
],
"measurements": {
"unique": [
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"sum_value": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"count": [
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
]
}
},

and this Open request body

{
"data": {
"type": "metric-aggregate",
"attributes": {
"measurements": [
"unique",
"sum_value",
"count"
],
"filter": [
"greater-or-equal(datetime,2025-12-01)",
"less-than(datetime,2025-12-31)"
],
"by": [
"$message"
],
"interval": "day",
"metric_id": "MzHMir",
"page_size": 500
}
}
}

Open response

{
"dimensions": [
"01KAEY4DP1X7KSVHH8SSH6S770"
],
"measurements": {
"unique": [
723.0,
362.0,
230.0,
171.0,
178.0,
111.0,
105.0,
139.0,
130.0,
133.0,
147.0,
129.0,
104.0,
83.0,
83.0,
75.0,
62.0,
92.0,
64.0,
49.0,
52.0,
66.0,
47.0,
33.0,
36.0,
50.0,
13.0,
10.0,
8.0,
10.0
],
"sum_value": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"count": [
761.0,
370.0,
238.0,
172.0,
182.0,
112.0,
110.0,
139.0,
130.0,
135.0,
151.0,
133.0,
109.0,
83.0,
84.0,
76.0,
64.0,
95.0,
66.0,
49.0,
52.0,
67.0,
48.0,
33.0,
38.0,
53.0,
13.0,
10.0,
8.0,
10.0
]
}
},

What could be the reason for that?


cadence
Expert Problem Solver III
Forum|alt.badge.img+12
  • Expert Problem Solver III
  • Answer
  • January 5, 2026

@ronen tak, I think to understand whether this is a bug or the actual behavior in your account, you would want to pull all the raw Received Email and Opened Email events via the API for this account. Check on the actual counts (unique or not) during this timeframe, particularly for the Received Email events, which look low. 

It’s hard to tell whether this is actually just what happened in your account over this timeframe (maybe unlikely but possible) or if there’s a bug in Klaviyo’s Query Metric Aggregates API. If the actuals don’t match the aggregates, then there is a bug here that the Klaviyo Team will need to investigate.

 

Cadence / Book a demo