Skip to content

feat(analytics): implement analytics engine metrics (pageviews, visitors, sources, devices, countries)#60

Merged
ansabazys merged 7 commits intomainfrom
feature/analytics
Mar 15, 2026
Merged

feat(analytics): implement analytics engine metrics (pageviews, visitors, sources, devices, countries)#60
ansabazys merged 7 commits intomainfrom
feature/analytics

Conversation

@ansabazys
Copy link
Owner

Summary

This PR implements the core analytics engine for Tracpy by adding aggregation endpoints for website analytics metrics.

Features Implemented

  • Page view aggregation
  • Unique visitor tracking
  • Traffic source analytics
  • Device and browser analytics
  • Country analytics

Endpoints Added

  • GET /analytics/pageviews/:websiteId
  • GET /analytics/pages/:websiteId
  • GET /analytics/visitors/:websiteId
  • GET /analytics/sources/:websiteId
  • GET /analytics/devices/:websiteId
  • GET /analytics/browsers/:websiteId
  • GET /analytics/countries/:websiteId

Implementation Details

  • Aggregations are computed from the Event table.
  • Raw SQL queries are used for efficient grouping and counting.
  • Controllers handle request validation and response formatting.
  • Services encapsulate analytics aggregation logic.

Related Issues

Closes:

@ansabazys ansabazys merged commit cfa8351 into main Mar 15, 2026
1 check passed
@ansabazys ansabazys deleted the feature/analytics branch March 15, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant