The EQATEC Analytics Monitor (AM) is the library that you include within your application to assist in tracking the application. But how does this apply when your application is a web application and the user of the application seems to be all the users of your web site?

Is all about the application!

The main point for integrating the AM in your ASP.Net web application is to understand that the monitor is tracking the application rather than the user. For standard applications such as desktop applications, the relation between the application and the user is one-to-one, there is one user interacting with the application. This is different in ASP.Net where the application is being interacted with by many concurrent users. Using the AM server side in a web application therefor represents a slight mental shift, namely it is tracking of the application, not the users. 

This means that you'll have to start the monitor instance when the web application starts and you'll stop the instance when the application stops. Tracking features in your web application will not track the feature usage of each individual end user of the web application but rather the overall feature usage of the web application itself.

Can I still track valuable data?

Sure you can! There is tons of information to be tracked about your web application that is not focused on the individual usage patterns of a user:
  • Tracking the number of started session to understand the number of users you are serving.
  • Tracking the usage of individual modules within your web application to see which of the modules are seeing heavy usage
  • Hooking unhandled exceptions into the monitor to understand which exceptions are being raised in the wild.
  • Tracking the time spent performing potentially long running tasks on the server to see if e.g. generating that PDF report is actually as fast as you expect
  • Tracking usage of alternative approaches to the same functionality to see which ways your users are accomplishing their jobs.

And there is probably many more that applies to your specific web application. Just keep in mind that you'll be tracking the overall usage of the application on the server and not the individual usage of the application on the client. For client side tracking, you can take a look at our javascript library.

How do I use the monitor in an ASP.Net application

You need to create an instance of the monitor as part of the web application startup. You may have some initialization or bootstrapping modules where this fits right in but you can always hook up the creation right in the Global.asax file:

protected void Application_Start()
  //other stuff
  IAnalyticsMonitorSettings settings = AnalyticsMonitorFactory.CreateSettings("YOUR-PRODUCT_KEY");
  // modify settings as needed...
  IAnalyticsMonitor monitor = AnalyticsMonitorFactory.CreateMonitor(settings);

Dependent upon your specific architecture you can then make this instance accessible from the rest of your application either directly or through e.g. some dependency injection scheme. You can use the monitor instance by calling the various methods on it from within your application to track the various aspects of your web application.

In order to ensure that all data is tracked, we highly recommend that you call the Stop() method on the monitor instance when the web application stops or recycles. This can be done in the Application_End method of your Global.asax file:

protected void Application_End()

Once the monitor is stopped, all subsequent calls on the monitor instance are essentially no-ops so don't worry about calling the monitor instance concurrently. Similarly, any calls on the monitor before the Start() call are also no-ops.

What else do I need to know?

This information should be enough to get you started. You can go ahead and download the monitor, add the few lines above and you should be able to see data in your analytics dashboard within a few minutes.

Related Posts


Comments are disabled in preview mode.