Skip to main content
Solved

Why doesn't the query metric aggregate endpoint work with custom metrics made in Klaviyo?


Forum|alt.badge.img+5

Basically title. I am trying to pull the sum value of revenue using Query Metric Aggregates but instead of using the standard Shopify placed order metric, we want to use a custom metric we made that excludes some orders. It has a very long metric ID (different format than the others) and it doesn’t show up in get_metrics endpoint. I am not able to make this work. When I use the reporting endpoints, it does work, however, I don’t have any way to see total revenue through the reporting endpoints. Is there any solution?

Best answer by Kim Strauch

Hey @MoneyJ2k, custom metric IDs aren’t supported yet on the Query Metric Aggregates endpoint. Tracking this as a feature request on our side 

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Forum|alt.badge.img+7
  • Klaviyo Employee
  • 168 replies
  • July 15, 2024

Hi, all metric IDs are six characters. It’s in the URL when you go to the metric in the metrics page.

EDIT: see Kim’s comment below, about custom metrics you can define.


Kim Strauch
Klaviyo Employee
Forum|alt.badge.img+9
  • Klaviyo Employee
  • 91 replies
  • Answer
  • July 15, 2024

Hey @MoneyJ2k, custom metric IDs aren’t supported yet on the Query Metric Aggregates endpoint. Tracking this as a feature request on our side 


Forum|alt.badge.img+5
  • Author
  • Contributor IV
  • 7 replies
  • July 15, 2024

Is there any other way to pull the revenue for a store via API then?


Kim Strauch
Klaviyo Employee
Forum|alt.badge.img+9
  • Klaviyo Employee
  • 91 replies
  • July 15, 2024

@MoneyJ2k, there isn’t a way to pull the aggregated value for a custom metric via the API at this time but it is an enhancement we’re considering for the future. I’m curious how you would plan to leverage this via API if it were available in the future.

This data should be retrieve-able via a custom report in the interim. Maybe scheduling a custom report can help you to accomplish your use case here — getting revenue data exported from Klaviyo on a regular cadence?