Firebase website + Remote app + Analytics

Solution for Firebase website + Remote app + Analytics
is Given Below:

So, I’ve had an idea and for that I would need to host a website and would also need to get notified every time a user has entered the website. Basically, the website would be running (in this case, via Firebase hosting) and then every time someone would enter the website, I would have an app that would get the information, modify the website (a small html file) and deploy it later on. Its my first time trying something like this and Firebase looked like the best way to do it, I’ve been trying to work with Analytics but I’m getting nowhere and I’m not even sure this would be the best way to do it.

The app would be running in Java and later on I would try to put it on a server so it would run without me having to boot the app every time.

Has someone tried to do something like this, or am I just complicating something that should be simpler ?