Comment

Comment by victorbjorklund

The benefit with using JS instead of access logs are that scraping bots, security scanners etc usually don't call your JS analytics so for a small site the number % of bots can be 90% of the logs.

And you can use your analytics data to better understand your users because again most bots won't trigger your analytics script (because why would they execute it and waste their CPU cycles on that?). And yes, you can't trust the exact numbers (because adblockers, etc) but you can see the trends:

Page A has 1000 visitors per day. Page B has 10 visitors per day. We can conclude that A is more popular than B (why that is another question).

Or Page A had 100 visitors on average last month and now it has 1000 visitors on average. We can conclude it got more popular. Etc.

Do you need that for your personal blog? Probably not. Do you need that on your e-commerce shop to verify wether you 1 million dollar ad spend makes a difference or not? Probably.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton