I need to be able to report on how well a particular segment is doing, ideally being able to pull aggregate metrics such as products purchased, email, etc.
I noticed that there is optional Engagement metrics that can be generated on Segments, but there is no way to pull that data in via the API from what I can tell.
So that let me to metric-aggregate, which has a by field, which had me attempting something like this:
{
"data": {
"type": "metric-aggregate",
"attributes": {
"metric_id": "abcdef",
"measurements": [
"count"
],
"filter": [
"greater-or-equal(datetime,2024-02-01T00:00:00)",
"less-than(datetime,2025-01-01T00:00:00)"
],
"by": ["List"],
"interval": "month",
"page_size": 500,
"timezone": "UTC"
}
}
}
Unfortunately this doesn’t group by segments or Lists, and instead has the following response
"data": [
{
"dimensions": [
""
],
"measurements": {
"count": [
0.0,
0.0,
My question is: is there a way to get metrics for a particular segment?