Capturing Usernames


If the web application you are monitoring requires a login and you would like to be able to track performance down to an individual user then you can have the webtuna.js capture the username by overriding the JavaScript function with your own function to get it from the application and return it to WebTuna.

The JavaScript function needs to be called wt.user and needs to be declared somewhere in the page so that it exists at the point where the onload handler is called.

If this function is not present then WebTuna will create its own ‘username’ which is based on the timestamp when the user first connects. This is set in a cookie and is useful to track unique visitors to the site.

Example for SharePoint

This example code will capture the SharePoint userid so it can be captured by WebTuna.

<script type="text/javascript">
wt.user = function ()
{
	return _spPageContextInfo.userId;
};
</script>

NOTE – This code must come after the line which calls webtuna.js