OpenAnalytics is a lightweight, self-hosted web analytics dashboard that tracks pageviews, browsers, referrers, and visit times. It’s easy to embed, complies with various privacy laws and provides visual insights via charts and tables.
- Track pageviews on any site using
track.js. - Collect URL, browser, referrer, and timestamp.
- Dashboard includes:
- Table view of pageviews.
- Bar chart of pageviews per URL.
- Pie chart of browser distribution.
- Pie chart of referrer distribution.
- Fully responsive and styled
- Auto-refreshing dashboard every 5 seconds.
- Clone the repository:
git clone https://github.com/dmx3377/OpenAnalytics.git
cd OpenAnalytics- Install backend dependencies:
pip install fastapi uvicornOptional: If you want a virtual environment:
python -m venv venv source venv/bin/activate # Linux venv\Scripts\activate # Windows pip install fastapi uvicorn
- Run the backend server:
uvicorn backend.server:app --reload-
Open
frontend/index.htmlin your browser to view the dashboard. -
Add
track.jsto any page you wish to track:
<script src="track.js"></script>- Visit your dashboard (
index.html) to see live analytics. - The table and charts auto-update every 5 seconds.
- The tracking script collects: URL, browser, referrer, and timestamp.
- Aggregated charts show browser distribution and referrer sources.
OpenAnalytics/
├── backend/
│ └── server.py # FastAPI backend
├── frontend/
│ ├── index.html # Dashboard HTML
│ └── script.js # Dashboard JS
├── track.js # Tracking script for sites
├── LICENSE
└── README.md
This project is licensed under the BSD 3-Clause license.
