The accepted answer about Firebase is a good, quick reply, but I want to write a longer and more comprehensive response for anyone who is investigating this topic, as Firebase is one of several ways to achieve this kind of functionality.
By way of background, databases/datastores like mysql, postgres, redis, mongodb, etc. are the most common way to store visitor data in the way that the next visitor and see or access it. Content management systems such as Django, Wordpress, and Drupal are built to read and write to a database. These services tend to be server-side technology, which is to say that a server admin sets them up, and blocks of code that the website's users cannot see communicate with the database. That server side code base also builds the rendered html that a user will see. So in general, Github Pages are not used with these kinds of technology because they support only static html, css, and javascript--that is, they allow client side code only.
For more on this topic, see
[To see links please register here]
If you want to set up a read only datastore, you have a lot of options on Github pages. You could put a json file in your repo, query a drive document, upload an sqlite.db file to your repo and query it, etc. In this imagined example, you would have to be ok with a website user seeing any data in your datastore, as the setup would not provide a way to make some data invisible to the user.
As soon as you're thinking about writing to your database, however, security is a concern. If you set up some kind of offsite database and put DB access credentials into your client-side code, any user could see those credentials and compromise your database (inject data, take it over, delete it, etc.) For this reason alone, you need a setup that passes data from the front end to the back end and vice versa without letting website traffic see under the hood. As I understand it, this is a level of functionality that Github Pages can't give you.
For more on client-side database security, see this thread:
[To see links please register here]
One potential workaround is to use your static side to link to a third party service. You can, for example, embed a Google form in an html page. That form can link to a Google sheet. That sheet can be published to the web and be set to update automatically. Your Github pages site can reference the public version of that page and update (on a delay) when changes are submitted. This type of setup is clunky (I assume Google sheets get slow if they get too big) and should be used with caution, as a poorly designed form of this kind could be a spam magnet. Not to mention that anyone who looks at your client side code will be able to find an view the public version of your Google sheet, which will include submission time and user data if you collect it. However, if used carefully, it could work for the use case mentioned above.