Track Users

To enable Live User Monitoring you will need to add user tracking to your web pages. The following shows you how to do that.

Tracking will only work properly with authenticated users of your app. More specifically you'll need the username and email address for it to work properly.

Include the Javascript

Include the Loggr API script in your web page's HEAD tag

<script src="{logkey}&a={apikey}"></script>

Make sure you replace the {logkey} and {apikey} value in the Javascript URL above with the values from your log.

Call the Tracking Method

Insert the following code before the closing BODY tag for each web page of your app.

<script type="text/javascript">
    var username = "USERNAME";
    var emailAddress = "EMAILADDRESS";
    Loggr.Log.trackUser(username, emailAddress);

Make sure you set the 'username' and 'emailAddress' variables to the current user's actual values.

You can also send a 3rd argument to the trackUser() method which would be the "page" the user is viewing. If you don't specify it, the current page's URL will automatically be used.