Whenever I search for doing user analytics in ASP.NET (counting site visitors, visitor location, time spent on pages, etc.) I always find articles that talk about embedding external analytics providers into your pages (Google Analytics, StatCounter, etc.) However, is it possible to just do these kinds of analytics without using an external provider and just within your own application? Are there any well-tested NuGet packages that will do this sort of thing by being added as middleware, logging request information, and then perhaps providing charts with information about usage stats and visitor info?

Or is there a particular reason why these stats always seem to be generated by external services, like is there something that can be done externally that couldn't just be done with a package on the web server itself?

1 Answer 1


One potential solution to your problem is to use EventFlow. This library allows you to define what kind of diagnostic data you want to collect, and where you want to output that data. This can include things like performance counters and application traces.

The great thing about EventFlow is that it runs in the same process as your application, which minimizes communication overhead. Additionally, it has an extensibility mechanism that allows you to create and plug in additional inputs and outputs as needed.

EventFlow is compatible with both .NET applications and .NET Core applications, and the core library, as well as inputs and outputs, are available as NuGet packages. It also supports Application Insights as input and outputs like ElasticSearch and any Http. This means that you could host ElasticSearch locally or on-premises, use the Application Insights SDK to collect data, send it to EventFlow, and have it sent to your local or on-premises ElasticSearch cluster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.