Skip to content

A lightweight, self-hosted web analytics dashboard that tracks pageviews, browsers, referrers, and visit times.

License

Notifications You must be signed in to change notification settings

dmx3377/openanalytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAnalytics

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.


Features

  • 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.

Demo


Installation

  1. Clone the repository:
git clone https://github.com/dmx3377/OpenAnalytics.git
cd OpenAnalytics
  1. Install backend dependencies:
pip install fastapi uvicorn

Optional: If you want a virtual environment:

python -m venv venv
source venv/bin/activate  # Linux
venv\Scripts\activate     # Windows
pip install fastapi uvicorn
  1. Run the backend server:
uvicorn backend.server:app --reload
  1. Open frontend/index.html in your browser to view the dashboard.

  2. Add track.js to any page you wish to track:

<script src="track.js"></script>

Usage

  • 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.

Folder Structure

OpenAnalytics/
├── backend/
│   └── server.py          # FastAPI backend
├── frontend/
│   ├── index.html         # Dashboard HTML
│   └── script.js          # Dashboard JS
├── track.js               # Tracking script for sites
├── LICENSE                
└── README.md

License

This project is licensed under the BSD 3-Clause license.

About

A lightweight, self-hosted web analytics dashboard that tracks pageviews, browsers, referrers, and visit times.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors