Skip to main content

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": 0"List"],

      "interval": "month",

      "page_size": 500,

      "timezone": "UTC"

    }

  }

}

Unfortunately this doesn’t group by segments or Lists, and instead has the following response

 

"data": o

                {

                    "dimensions": <

                        ""

                    ],

                    "measurements": {

                        "count": >

                            0.0,

                            0.0,


My question is: is there a way to get metrics for a particular segment?

Hi,

Have you considered utilizing the API to fetch metrics directly from the segments you’re interested in? It seems like the way you’re currently aggregating metrics may not group by segments effectively.

To solve this, I can help you refine your API calls to ensure you’re filtering and grouping the data correctly based on the specific segments. With 5+ years of experience in handling APIs and data aggregation, I’m confident I can assist you in pulling the metrics you need.

I suggest we discuss your current setup and any additional requirements you have to ensure I provide the best solution


Reply