How to capture username as custom variable or otherwise?

I’m not a developer, but I’ve been trying to get a snippet together that I can use to track usernames on my LMS site running Blackboard Learn. Piwik works perfectly to consolidate all the data that was previously being thrown away. However, I’d like to report, not on IP addresses, but on actual usernames. I’ve read the documents regarding custom variables and JS as provided in other forum posts, but it (so far) doesn’t make much sense to me. Here is a “scrubbed” snippet that I’m using w/o success. I put this together based on other documents and posts:

</nosc ript>


Hi there,

To track username we recommend you use User ID feature: User ID - Analytics Platform - Matomo

yeah, I’ve read through that, and the visitors are already getting a unique ID which is reportable. However, I want to track by username, which is prompted for at logon…i.e., I don’t want to generate a new ID for them since they’ve already got a GUID within Piwik. I’m sure I could use the Javascript Tracking Client, but I’m not a programmer and a good bit of it doesn’t make sense to me. Thanks for your input!

Unsure where I’m going wrong. Every tracker that I add to this tracks each user logon as “user_id” (see screenshot). How do I pass the actual logon username to the tracker? The “ID” is a good place to start, and definitely provides us with usable info. But would be best with username.