I am using API revision 2024-02-15.
If I do a post to https://a.klaviyo.com/api/metric-aggregates/ and I pass it the following json object in the body, it behaves as if I did not include the “by” command and does not aggregate by campaign but just gives it as if I did not specify the by.
{
"data": {
"type": "metric-aggregate",
"attributes": {
"measurements": [
"count", "unique"
],
"filter": [
"greater-or-equal(datetime,2024-01-01),less-than(datetime,2024-12-31)"
],
"by": ["$attributed_message"],
"interval": "month",
"timezone": "US/Eastern",
"metric_id": "WhateverMetric_IdUsed"
}
}
}
Similarly, if in the filter I indicate the campaign I wish to see, it returns nothing at all.
"filter": [
"greater-or-equal(datetime,2024-01-01),less-than(datetime,2024-12-31)",
"equals($attributed_message,\"SOME_CAMPAIGN_ID\")"
],
isn’t $attributed_message the property to use for CampaignIds?