Skip to content

Track web page views and display stats via GitHub badges

License

Notifications You must be signed in to change notification settings

hexarc-software/hexarc-counter

Repository files navigation

GitHub Views Counter

License Custom badge

Idea

Originally this application was developed for tracking the views of a GitHub user profile page and displaying the view count via badges from the shields project. In general the tracker can be set up either in one or many location and the badge settings can be customized to convey a sensible message.

Usage

All you need is to set up a tracking pixel in a web page and generate a badge for displaying the collected stats.

Setup tracker

Create a tracking image <img src="TRACKER_SERVER/tracker?name=YOUR_TRACKER_NAME">, where YOUR_TRACKER_NAME is a unique name for you tracker. Embed this image into a web page which views you want to track.

View tracker stats

Create the view stats url for your tracker TRACKER_SERVER/views?name=YOUR_TRACKER_NAME. Generate a badge at shields using this view stats url. If you need a custom label for your tracker stats url you can specify it via CUSTOM_LABEL TRACKER_SERVER/views?name=YOUR_TRACKER_NAME&label=CUSTOM_LABEL

Example

Example how to collect and display the views of a GitHub profile. You can use the demo server https://hexarc-counter.onrender.com/ for experiments.

License

MIT © Hexarc Software and its contributors