Use livewire and just increment a count in a table column in your database?
Aug 23, 2022
13
Level 1
Adding simple visitor counter to site
I'm about to implement some super-super-simple statistics for my site, without any use of tracking or cookies.
- Count the number of unique visitors to my site.
- Count the number of clicks on a Call-To-Action-button. It doesn't have to have any functionality other than counting the clicks.
I've been recommended three different methods so far:
- Create middleware: https://blog.dzarsky.eu/anonymized-website-visitor-counter-in-laravel
- Use Redis: https://laracasts.com/series/learn-laravel-and-redis-through-examples/episodes/1
- Use Laravel Nova in some way.
I've never used Redis and would like this to be as effortless as possible (without installing and learning too much new), but I'm also not sure if adding thousands of rows to a database-table is the best way. At most my site has had 30k+ unique visitors per week.
All help and input appreciated.
Please or to participate in this conversation.