Skip to main content

HI folks, I am trying to calculate Revenue for the Placed Order metric using metric aggregate endpoint but it seems that the results are not matching with klaviyo dashboard metrics.

For reference, I am using this request structure:
 

{
"data": {
"type": "metric-aggregate",
"attributes": {
"measurements":
"sum_value"
],
"filter":
"greater-or-equal(datetime,YYYY-MM-DDTHH:MM:SS),less-than(datetime,YYYY-MM-DDTHH:MM:SS)"
],
"by": "$attributed_message"],
"interval": "INTERVAL (hour,day,week,month)",
"timezone": "TIMEZONE",
"metric_id": "PLACED_ORDER_METRIC_ID"
}
}
}


I have looked into the Reporting API. The results are accurate to the decimal points but it has strict daily rate limits and data is not in an interval based breakdown (“day” based breakdown is desirable in my case). So is there any other way I can achieve this? Maybe manually aggregate data from events? but then I don’t see how I can relate the events data to campaigns.

Hi ​@awais-ahmad97,

The reason you’re seeing the discrepancy between the data in the Query Metric Aggregates API and in the Klaviyo UI is because the API shows you the dates that the event occurred, not the dates that the attributed message was sent. This differs from our UI, where the attributed placed order revenue you see is attached to the dates that the messages were sent. That’s why there’s always going to be a small difference between the numbers in this situation.

If you’re looking to avoid the low rate limits, using Query Metric Aggregates is the way to go, knowing that the numbers you see are still accurate in terms of the number of/revenue of Placed Order events, but it’ll be slightly different from what you see in the UI, for the reasons above. Let me know if this makes sense!

-Byrne


Reply


OSZAR »