Show HN: I built an opensource, privacy-first Google Analytics(swetrix.com)
swetrix.com
Show HN: I built an opensource, privacy-first Google Analytics
https://swetrix.com
24 comments
What I find missing from all the OSS analytics is log parsing agents that I can install on my servers for sites that I don't want to have JS on. The agent would parse the logs periodically (every hour from cron or whatever) and send the parsed/analyzed data to the server handling analytics. This could also augment data for sites that primarily use a JS tracker by adding information on users that have JS disabled (or users on such a bad connection that they leave before the load finishes) as well as bots, uptime checkers etc.
You might take a look at GoAccess [0].
> GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
[0]: https://goaccess.io/
> GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
[0]: https://goaccess.io/
Actually this sounds reasonable to add, I added this feature to my backlog, it won't be too hard to implement it.
By the way, as for now we also support no-JS tracking via 1x1 px GIF.
By the way, as for now we also support no-JS tracking via 1x1 px GIF.
How are MySQL, Redis and Clickhouse used? Which usecase each of them cover?
MySQL is used for data like user accounts and linked websites.
Clickhouse is used for the analytics data (which this DBMS is basically designed for).
Redis is used for caching (for example, I store there all the incoming analytics requests, and each minute the cron job takes them all and adds into the Clickhouse DB, as a big chunk), rate limiting, etc.
How does this compare to other projects with similar aims (such as Plausible)? Specifically I'd be interested to know if there are self-hosting instructions or if this is not really a supported configuration (not that it is supported as such by many projects, with any real promise of support, but it is at least assisted with install action instructions).
Asking mainly as I might be bringing some bits & bobs online in the coming months, and I'm considering a local install of Plausible for analytics.
Asking mainly as I might be bringing some bits & bobs online in the coming months, and I'm considering a local install of Plausible for analytics.
Compared to Plausible, we provide the same functionality + Swetrix browser extensions (soon the alerts will be added there), email reports, multiple languages and themes support and for sure a free tier.
Swetrix is fully open-source and you can selfhost it via Docker (Docker Compose is available too!). See the instructions at https://github.com/swetrix/swetrix-api
Swetrix is fully open-source and you can selfhost it via Docker (Docker Compose is available too!). See the instructions at https://github.com/swetrix/swetrix-api
Keep an eye on your commercial competitors (Plausible, Fathom) and adjust your paid plans to get an edge.
Sure, by the way the prices are roughly the same.
I also try to outcompete them by working on unique features
The 500k plan:
• You: 20 sites = $59.
• Plausible: 50 sites = $49 (2 months free if yearly).
• Fathom: 50 sites = $44 (2 months free if yearly).
As you can see, they keep eyes on each other. Hence my advice.
Startups are, in essence, lemonade stands wars. Must keep an eye on the tags and look cute.
Don't do 'roughly', research everything that matters. If you settle for 'roughly' — you'd miss, for example, that Plausible is giving back 5% of gross revenue to charitable causes, and Fathom is giving back 2%. Now — whose stand looks cuter?
I know the time is limited, but learning everything possible about the competition is a top priority — above the actual development.
• You: 20 sites = $59.
• Plausible: 50 sites = $49 (2 months free if yearly).
• Fathom: 50 sites = $44 (2 months free if yearly).
As you can see, they keep eyes on each other. Hence my advice.
Startups are, in essence, lemonade stands wars. Must keep an eye on the tags and look cute.
Don't do 'roughly', research everything that matters. If you settle for 'roughly' — you'd miss, for example, that Plausible is giving back 5% of gross revenue to charitable causes, and Fathom is giving back 2%. Now — whose stand looks cuter?
I know the time is limited, but learning everything possible about the competition is a top priority — above the actual development.
Thanks for sharing this advice
I'm parsing logs with awk https://s.mkws.sh.
Thanks for sharing it. I'll implement a similar log based tracking for Swetrix too.
After a quick look, I already loved that you offer a free band for up to 5k events. Many GA alternatives don't have free plans, and their first band is expensive for a hobby blog that gets like 100 views a month.
Yep, I also noticed that and that's why I decided to add free plan to my service:)
[deleted]
Amazing tool, btw. It's like a google analytics, but much better
signed up and trying this for my blog. I was looking for a solution which allows to understand which posts in my blog are more interesting, with a reasonable free plan and privacy focused
Happy to hear that you signed up and started using it! Contact me in case you have any questions regarding the service:)
are there any instructions for self-hosting?
Yes, you can selfhost it as a docker image (docter compose available too) or simply clone the Github repo.
The instructions for selfhosting are at https://github.com/swetrix/swetrix-api
One year ago, in April, I had an idea to create my own web analytics service, which would be much more private and provide alternative functionality of Google Analytics.
Meet Swetrix - a completely opensource, cookieless, self-hosted and privacy-focused web analytics platform.
This service allows you to track many different metrics such as user country, device type, browser, and more. Apply filters to the data, extensively customise your tracking options and your website settings. Feel free to check out our live demo! :)
The API is written in NestJS, as databases I use MySQL, Redis and Clickhouse. Frontend (and the browser extensions) are written in React.
I learnt a lot about analytics and coding while working on this project!