How can I add visitor's info in Github Pages (Academic)?

195 Views Asked by At

I have a github.io page forked from https://github.com/academicpages/academicpages.github.io I want to add visitors log in my page (like flag or number of visitors or anything that can be shown in the page about the visitors). How should I do that?

1

There are 1 best solutions below

0
Raghav Kukreti On

You cannot have a visitor counter without a backend implementation/database. Since GitHub pages is purely serving a static website, any client-side Javascript will be re-run for every client.

What you can do is store the visitor number in Google Sheets and utilize the Google Sheets API to increment it everytime your website is hit and to fetch it to display it wherever you'd like.

Reference