Easily count hits on a website by requesting a svg that displays a hit count.
If you want to get the hit count image for a page you can edit and you want to count, add this line:
<img src="/count/tag.svg" alt="Hits">
Image Tag
Markdown
Domain | Total Hits Counted |
---|---|
hits.directvoip.co.uk | 223 |
51.195.128.26 | 7 |
github.com | 3 |
ip26.ip-51-195-128.eu | 2 |
51.195.128.26:8080 | 2 |
hits.directvoip.co.uk:8080 | 1 |
This site allows you to request for a svg file that displays views for a url. This url can either be passed as a query parameter or the referrer (or referer) value in the header will be used.
These is also a small method to prevent the refresh count increase issue (if you want to call it an issue, I see it as annoying) which uses cookies.
This makes is very easy too keep track of views on static sites like Github Pages. (can also be uses on non-static sites as a general counter)
The source code of this server can be found at github.com/brentvollebregt/hit-counter.