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?
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.
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.
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);
monitor.Start();
}
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()
{
monitor.Stop();
}
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.
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.