Track user groups

I am trying to get piwik to track the activities of a set of user groups.
The site I am working on only allows logged in users and each user belongs to a user group. Users and user groups are added by an admin.
I can easily determine which group the user is from in my database and set it in a custom variable.

I have modified my tracking code and added :

    "<?php echo $userGroup?>",

I can now see the report under custom variables, and read the number of visits from each user group which is great.
But I would like to have more data for each user group and I am failing to find out how.

The main data I am seeking is :
[li] The number of viewed pages for each user group
[/li][li] The most viewed pages by user group
[/li][li] The number of unique visitors in each user group
[/li][li] The mean number of visits for each user group

Does this mean I need to add another custom variable with the page variable instead of “visit” to also track the viewed page?

Hi there.

to get all the stats for each custom variable, it’s recommended to create a Custom Segment for each of your user groups. Segmentation - Compare segments of visitors - Analytics Platform - Matomo