2

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?

11
  • Is privacy the reason for switching away from Google Analytics, or is there a bigger reason? And do you specifically want something self-hosted? Otherwise, there are commercial alternatives to Google Analytics. – Maximillian Laumeister Apr 30 '20 at 20:54
  • Not really, the only reason I dont want to use GA is because I do not have the complex analytics requirement. Another reason is the how much its gonna cost after traffic to my site increases @MaximillianLaumeister – Siyavash Apr 30 '20 at 20:57
  • Look into statcounter.com or clicky.com -- these are much more minimal than GA but you implement it the standard way, hopefully avoiding the problem you ran into. I can't vouch for either as I haven't used them, but there are options. – Henry Visotski Apr 30 '20 at 21:37
  • @Siyavash To clarify, you are worried that you may get more than 10 million hits per month and exceed the limit of the Google Analytics free plan? – Maximillian Laumeister Apr 30 '20 at 21:48
  • @HenryVisotski Thank you for the suggestions. I will look into them – Siyavash Apr 30 '20 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.