This repo contains a Greasemonkey/Tampermonkey userscript that records daily usage for only the websites you choose.
It tracks:
- how many distinct tab sessions a tracked website had
- the timestamp for each session start
- active time for each session
- total active time per tracked website per day
- Open your userscript manager.
- Create a new userscript.
- Paste in
website-usage-tracker.user.js. - Save the userscript.
The script runs broadly, but it only records sites saved in its local tracking config. This config is stored under websiteUsageTracker.config.v1, so it survives script updates.
Use your userscript manager menu:
Track this siteto add the current hostnameConfigure tracked sitesto edit the full stored list
Rules can be separated by commas or new lines:
app.posthog.com = PostHog
*.reddit.com
https://github.com/your-orgUse pattern = Label when you want a dashboard label instead of the default hostname or domain.
Use your userscript manager menu on any page:
Show website usage statsTrack this siteConfigure tracked sitesExport website usage JSONReset website usage data
The stats are stored locally in the userscript manager's storage under websiteUsageTracker.v1.
Time is counted while the page is visible. If the page has no activity for five minutes, it stops adding active time until activity resumes. The current session is saved every 15 seconds and when the page is hidden or closed.
Reloads in the same tab are merged into the same session when the page comes back within two minutes. This avoids counting single-page-app project switches or other full-tab refreshes as separate opens.