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?

Stephen Ostermiller
  • 98,758
  • 18
  • 137
  • 361
Siyavash
  • 121
  • 2
  • 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 https://statcounter.com/ or https://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
  • @MaximillianLaumeister yes and no. I didnt know its 10 mil but when have 10 million hits I definitely have enough money to pay for Google Analytics :D. The issue is the complexity, I dont really want to add a lot of dependencies to my project for something this basic – Siyavash Apr 30 '20 at 22:09
  • @Siyavash So if I get you right, you're looking specifically for a self-hosted solution then, something that removes your dependency on a third party analytics service? – Maximillian Laumeister Apr 30 '20 at 22:13
  • @MaximillianLaumeister yes that is correct – Siyavash Apr 30 '20 at 22:32
  • @Siyavash check out matomo or piwik – Maximillian Laumeister Apr 30 '20 at 22:33
  • Google Analyitcs doesn't deal with false data sent to it. Webmasters have to figure out how to add filters to their GA themselves. See How to fight off Google Analytics referrer spammers? – Stephen Ostermiller Apr 30 '20 at 23:48
  • @Siyavash You mentioned paying for Google Analytics above. Google Analytics is free, except for the Enterprise tier, which is for corporate entities that run huge paid search and display campaigns and need complex integrations. Analytics' free tier costs nothing, but yes, there is some complexity to the platform. – Henry Visotski May 01 '20 at 12:46

0 Answers0