Jeroen Kruis

freelance software engineer

.NET, Episerver, Azure, performance, code quality

KruisIT.Web.Analytics

Serverside analytics for ASP.NET MVC.

NuGet package

Install the package per the instructions found at https://www.nuget.org/packages/KruisIT.Web.Analytics/. A class RazorGeneratorMvcStart is added to your App_Start folder, but it is not needed.

Usage

To start analysing visits, add the Analytics attribute to your controller. The first param is the name of your connection string, the optional second is the name of your project, which is useful when running multiple projects on the same database.

[KruisIT.Web.Analytics.Attributes.Analytics("YourDb")] public class SomeController : Controller [KruisIT.Web.Analytics.Attributes.Analytics("YourDb", "Web")] public class SomeController : Controller

Reports

To view reports, create a controller that extends ReportController. The constructor needs the name of your connection string.

public class AnalyticsController : KruisIT.Web.Analytics.Controllers.ReportController { public AnalyticsController() : base("YourDb") { } }