ASP.NET Core 6.0 - Homegrown Analytics Project

The Analytics middleware collects and analyzes the properties of the HttpContext and Request. The middleware creates and stores a new Session if the SessionId cookie is not found. The middleware looks for a known UserAgent and creates and stores a new UserAgent if not found. The middleware creates and stores a new PageHit and updates the NotFound property on 404 Response status.

PageHit pageHit = new(method, path, queryString, refererHeader, userAgentId, sessionId, anonymizedIp, cookieConsent, screenSize, Convert.ToInt32(minutesOffset), userId);

The project is designed and organized to allow easy integration with existing projects. V2 simplifies the process with an Analytics area folder. The analytics schema can be implemented with SQL scripts or EF Core migration. Use the Package Manager Console to execute "update-database -Context AnalyticsDbContext" to apply the InitialSchema migration. SQL scripts are located in the Areas/ Analytics/ Data/ SqlScripts folder. The PurgeExpiredAnalytics script deletes expired related records. The RemoveAnalyticsSchema will remove all analytics and Hangfire data and schema. The EnsureAnalyticsDefaultData HostedService sets the AnalyticsSchema version and creates the required default UserAgent and Session.

V2.2.1 - MIT License - $10 Access Fee - - 8,950,943 bytes



Not accepting new comments.

Submit your comment. Comments are moderated.

User Image.
DisplayedName - Member Since ?

Change Log

v2.2.1 - 2022-12-18
-- Updated MS NuGet Packages@6.0.12
-- Updated Bootstrap@5.2.3
-- Updated BootstrapIcons@1.10.2
v2.2.0 - 2022-10-14
-- Implemented Dashboard Ip/Request filter
-- Implemented TagHelpers Intellisense
-- Implemented StartWeekOnMonday setting
-- Renamed PageHit entity to Request
-- Updated AnalyticsSchema@2.2.0
-- Updated AnalyticsUI@2.2.0
-- Updated SqlScripts@2.2.0
-- Updated dbip-country-lite-2022-10.mmdb
-- Updated MS NuGet Package@6.0.10
-- Updated Bootstrap@5.2.2
-- Continuity and bug fixes
v2.1.2 - 2022-09-15
-- Implemented SignalR CDN link w/ fallback
-- Updated MS NuGet Package@6.0.9
-- Updated Bootstrap@5.2.1
-- Updated World Heat Map
-- Continuity and bug fixes
v2.1.1 - 2022-08-28
-- Implemented IpToCountryDataPath Setting
-- Implemented MaxUserAgentTextLength Setting
-- Updated UserAgent drop downs and pages
-- Updated AnalyticsUI@2.1.1
-- Continuity and bug fixes
v2.1.0 - 2022-08-12
-- Implemented ViewDateTime
-- Implemented MaliciousIp entity
-- Implemented MaliciousIp pages
-- Implemented Custom TagHelpers
-- Updated MS NuGet Package@6.0.8
-- Updated AnalyticsSchema@2.1.0
-- Updated AnalyticsUI@2.1.0
-- Updated Chart.js@3.9.1
-- Continuity and bug fixes
v2.0.0 - 2022-08-01
-- Implemented Chart.js@3.8.2
-- Implemented Bootstrap Icons@1.9.1
-- Updated Twitter-Bootstrap@5.2.0
-- Updated dynamic-modals.js@2.0.0
-- Updated AnalyticsSchema@2.0.0
-- Updated MS NuGet Package@6.0.7
-- Updated Hangfire NuGet Package@1.8.0-rc1
-- Updated favicon.ico
-- Added chart pages
-- Continuity and bug fixes
v1.1.0 - 2022-06-12
-- Implemented API filter
-- Updated PageHit
-- Updated MS NuGet Packages@6.0.5
-- Updated Bootstrap-Native@4.2.0
-- Updated AnalyticsSchema@1.3.0
-- Continuity and bug fixes
v1.0.0 - 2021-12-15
-- Migrated From .NET 5.0@1.3.2
-- Implemented Top-Level Statements
-- Implemented Global Usings
-- Implemented File Scoped Namespaces
-- Implemented Analytics Settings
-- Implemented Global DateTime Formats
-- Implemented Global EnableCookieConsent
-- Implemented Revoke Cookie Consent
-- Implemented dynamic-modals.js
-- Updated MS NuGet Packages@6.0.1
-- Updated Bootstrap-Native@4.0.7
-- Updated AnalyticsSchema@1.1.0
-- Updated Must Accept Cookies
-- Updated CheckForUpdate
-- Continuity and bug fixes