Tracking Individual Users With Piwik In Drupal?

So I’m trying to set up Piwik to track some specific user data. Namely, I’m interested in the pages that each user visits, how much time they spend there, and what actions they perform there. So if they make a forum post, I’d like to know how long it was. What would be the best way to approach this?

Piwik does most of this by default. Maybe you can use custom variable to track user name: Custom Variable Case Study: - Analytics Platform - Matomo

Where exactly is this data available to me? How could I access it through SQL queries?

When I made a custom variable to track usernames it didn’t always work, and I felt like it was still creating new sessions if the same username logged in from a different IP address.

Custom variables do not mean that a new session will be created or not. Custom variables track custom data for a given Visit (or page).