I want to add analytics to my website but I do not want to use google analytics. My idea was to create an express server and expose a public analytics endpoint where I send my requests to.
This is more than enough for me as I do not need the tools Google Analytics provide. I will be using the analytics for page views to see how many views each page inside my website has.
The only problem I see is that someone can just send 1000s of request to my endpoint and either DDOS my server or give me false data. I can deal with DDOS by using aws services such as cloudfront but I dont know what to do with the false data. There are ways to make sure request is valid and is not just a bot but I constantly have to update the code.
Is there an easier way or better way to do it?