API Segmentation with multiple userIds

Hello Matomo !

I’m playing for some times already with the matomo API.
But today I came across a problem and can’t manage how to sort it out.

I start by retrieving the list of all tracked userIds. What I would like to do next is to merge these userIds with other datas associated with them. For exemple referrers, entry pages, events …
With one userId it’s pretty simple, I can simply add segment=userId==myid with the method I want to call to retrieve specific user information. But how can I do it with multiple users.

The first thing I tried obviously was to combine segments with an AND operation. But this only merge the different information from users togethers. What I want is to have separated info for each user.

Then I tried the bulk request method, to merge all requests in one (one request per user). But it’s waaaaay too heavy. I’m getting errors because my url call is too long.

I really don’t want to make one call per user per info. The user base is too heavy for this.

Then I was looking if there is a way to expand different info when I call my list of userId. It would be perfect if while retrieving my users I could expand refferers associated with it and all other info I need. But it looks like this thing is impossible.

Maybe I missed something.

any help would be greatly appreciated ! Thank you

1 Like

It’s been a while since you’ve posted this but I have the exact same problem. Can I ask if you’ve made any progress?

I don’t exactly understand the need…
Matomo is not designed for displaying data per user, it is used for cohorts of users. And the same for big data softwares… The goal is getting info on trends, not on one specific user.

But maybe you want to group the users by their profile. Eg, in a shop you want to have some statistics on professional users vs individual users. Or differentiate recurrent customers or occasional customers.

This can be done thanks to custom visit dimensions. When the user logs-in, you must valuate a visit dimension (eg. profile custom visit dimension). Then when you want to segment the data you just ask for data where profile is professional customer.