Skip to content

waldencui/website-usage-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Website Usage Tracker

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

Install

  1. Open your userscript manager.
  2. Create a new userscript.
  3. Paste in website-usage-tracker.user.js.
  4. Save the userscript.

Configure Sites

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 site to add the current hostname
  • Configure tracked sites to edit the full stored list

Rules can be separated by commas or new lines:

app.posthog.com = PostHog
*.reddit.com
https://github.com/your-org

Use pattern = Label when you want a dashboard label instead of the default hostname or domain.

View Stats

Use your userscript manager menu on any page:

  • Show website usage stats
  • Track this site
  • Configure tracked sites
  • Export website usage JSON
  • Reset website usage data

The stats are stored locally in the userscript manager's storage under websiteUsageTracker.v1.

Timing Behavior

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.

About

This repo contains a Greasemonkey/Tampermonkey userscript that records daily usage for only the websites you choose.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors