Redirect from login page then track username

I setup a internal knowledge base(PHP+MYSQL) website which do not require login (easy for user), I’d like to know which article visited by which user, piwik only track ip address, but all users have dynamic ip (with DHCP server).

I can put knowledge base link inside a internal website(IIS+ASP) which require login, so is it possible to tract username if user login and click the link by custom variables, if possible, how to do it?

Yes see: Custom Variables Analytics - Analytics Platform - Matomo and Custom Variable Case Study: Divezone.net - Analytics Platform - Matomo