How to create segments (filtering) based on list of User Ids?

Hello,

We have several groups of User IDs in the application we would like to track.

How can we create a segment based on a list of User Ids?
Is there a more efficient way than to manually list each User ID in a separate OR condition for every single filter? We want to re-use that list is several segments, and since it is not possible to select multiple filters at the same time, I will have to re-type users for every single segment. I’d like to avoid that.

Regars,
Iryna

1 Like

hi @Iryna_Tyshko I have the same question. Did you receive any solutions for this issue?

Best bet is to use the API to extract the data and filter it elsewhere.

If you really want it in Matomo I guess you could make a lookup table variable and then assign a custom dimension to the users in the list and then filter on the custom dimension instead of a list of UserIDs. Although I’d probably put the list server-side and push the custom dimension to the dataLayer.

1 Like

Hi Jimmy thank you for this. This goes a bit beyond my expertise :wink: Just a quick check, I am not even able to select the UserID value at the start of the segmenting process. Do you know why that is?

Not really, only a dev could answer the why. But I can say there is no good reason for it to exist. It makes as much sense to ask to have a car being able to turn with the turning indicator stick because you can’t figure out the steering wheel and the indicator makes sense (or removing the indicator and connect the indicators directly to the steering wheel).

Also you’re borderline breaking privacy laws by having a userID which holds so much information that you want to create a list of them to filter with. You have WAY to much data attached to the IDs.

But the solution remains:
If you want to see something based on historical data and you didn’t create the custom dimension you’ll need to extract the data into a powerful reporting tool and model it so you can get the information.
If this is something you want to track going forward as well then create the custom dimension. Either inside Matomo by doing a lookup list variable based on user ID (this is not recommended) or by having the extra information pushed at the same time as the user ID is pushed. Normally for me when working with a client tracking a intranet I setup what department or role the user has. So that I can analyze “people of this deparment doesn’t log in enough” or “the managers doesn’t read the complaints section and therefor they aren’t informed of things that need fixing.” etc. But never do I have a list of IDs where I know that information myself.

The userId is ALWAYS hashed so no one can look directly into Matomo and see “this person didn’t read this important message” or “this person generates a lot of errors by filling in the reports wrong” etc. However if someone took the time to re-create the hash:es and then looked things up they could (and sometimes when debugging and troubleshooting it is needed) but the extra step wipes away more or less all privacy issues.

1 Like