Daily Archives

One Article

Visual Studio Tips

Tracking Page Views With Application insights

Posted by matteskolin on

See the first post on setting up application insights here.

After initially installing the Azure Application Inisights server SDK into my app, I noticed that my users metrics only showed a single user, even though I knew multiple users were using my application.

The Server side SDK alone is not sufficient to capture the session IDS and User IDS of users of the application.

https://docs.microsoft.com/en-us/azure/azure-monitor/app/website-monitoring

It appears Client Side monitoring must be installed before the user IDS are successfully handled. I am even getting user information without the server side SDK enabled, so it appears that the JavaScript SDK is able to handle lots of metrics on its own.

You can check to make sure that the Javascript SDK is working by examining network traffic in the browser debugger. See Screenshot from chrome below.

I think there is likely a way to have the server side count users of the app, but this is not enabled by default without the help of the javascript sdk. Examing the payload that the javascript sdk sends to azure, there is something called ai.user.id, ai.sesion.id, and ai.device.id.

These values are used to track and count users in the insights collected data.