Thanks Matt, this is what I did. Actually it shows the field “User” in the Visitors Log (but not in the realtime visits on dashboard), but it’s empty.
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://mysite.com/intranet/piwik/" : "http://mysite.com/intranet/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.setCustomVariable(
1, // Index, the number from 1 to 5 where this Custom Variable name is stored
"User", // Name, the name of the variable, for example: Gender, VisitorType
"<?php echo $user->user_firstname . ' ' . $user->user_lastname; ?>", // Value, for example: "Male", "Female" or "new", "engaged", "customer"
"visit" // Scope of the Custom Variable, "visit" means the Custom Variable applies to the current visit
);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://mysite.com/intranet/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->