When using the Query Metric Aggregates API for fetching the “Placed Order Metrics”, we are getting “campaign-id” as dimension for the “Email Campaigns”, and “campaign-message-id” as the dimension for the “SMS Campaigns”.
This is blocking us from using the API output correctly.
As per another community ticket, the intended behaviour is that the dimensions are “campaign-ids”. We’re seeing a different behaviour from the Klaviyo APIs now.
Here is the payload we’re using for fetching the data:
{
"data": {
"type": "metric-aggregate",
"attributes": {
"metric_id": "<PLACED_ORDER_METRIC>",
"measurements": [
"count"
],
"filter":[
"greater-or-equal(datetime,2024-10-01T00:00:00)"
, "less-than(datetime,2025-01-24T00:00:00)"
, "not(equals($attributed_message,\"\"))"
],
"interval": "month",
"page_size": 500,
"by": [
"$attributed_message"
],
"timezone": "UTC"
}
}
}