OpenAnalytics banner

OpenAnalytics

5 devlogs
8h 25m 46s

OpenAnalytics

OpenAnalytics is an open-source analytics API designed to help developers track and understand traffic on their websites or applications. The entire project is available on GitHub, allowing anyone to copy the code, modify i…

OpenAnalytics

OpenAnalytics is an open-source analytics API designed to help developers track and understand traffic on their websites or applications. The entire project is available on GitHub, allowing anyone to copy the code, modify it, and deploy it on their own infrastructure without relying on third-party analytics services.

The API returns structured analytics data that can be directly used to build dashboards and visualizations.

Core Metrics

  • Total visits
  • Unique visitors
  • Total sessions
  • Bounce rate
  • Average time spent on the site

Page Analytics

  • Most visited pages
  • Page visit counts

Visitor Insights

  • Country and city of visitors
  • Device type
  • Browser and operating system

Traffic Sources

  • Referrer information

Visualization Data

  • Preformatted datasets for libraries like Recharts and Chart.js for building charts and analytics dashboards.
This project uses AI

Used AI for debugging

Demo Repository

Loading README...

spj27

Shipped this project!

Hours: 8.43
Cookies: 🍪 99
Multiplier: 11.75 cookies/hr

Note: This project took significantly more than 9 hours. I originally started building OpenAnalytics about a year ago, before Flavortown, and spent more than 50 hours working on the core system at that time.


What did you make?
I built OpenAnalytics, an open-source analytics API that developers can run on their own infrastructure to track traffic on their websites or apps. It provides metrics like total visits, unique visitors, sessions, bounce rate, time spent, most visited pages, visitor location, device information, and referrer data. It also returns preformatted datasets that can be used directly with charting libraries like Recharts or Chart.js.

What was challenging?
The main challenge was designing the session tracking and data structure so metrics like sessions, bounce rate, and time spent could be calculated accurately. It also took effort to format the analytics data so it could easily be used in dashboards.

What are you proud of?
I’m proud that the project is fully open source and self-hostable, allowing developers to control their own analytics data instead of relying on third-party services. I’m also proud that the API outputs structured data that makes building analytics dashboards much easier.

spj27

Added user data fetching with option to choose from supabase auth, next auth and clerk. Also added a list of users below the main data

Attachment
0
spj27

Added a simple demo analytics page that shows the analytics of itself

Attachment
0
spj27

Built some amazing features using multiple kinds of API, improved the response time and increased scalability

Attachment
0
spj27

I have made some improvements to the location tracking of the user to get better analytics.
PS - I had started this project a long time ago, but I am making the github repo right now and I had easily worked on it for more than 50 hours back then.

Attachment
0