DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,155 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Analytics Box - A simple privacy focused analytics in GO.
KetanIP
KetanIP

Posted on

Analytics Box - A simple privacy focused analytics in GO.

Repo: https://github.com/KetanIP/analytics.

Hello guys, today I am here to share with you a project that I've made recently, it is Analytics Box - A simple privacy focused analytics in Golang.

What is Analytics Box ?

Analytics box is analytics tool like google analytics but instead of ripping user's privacy off them like google it respects their privacy and doesn't collect any unnecessary information.

Features

  1. No Cookies.
  2. Forgets user in 24 hours so even if wish to know user's private info you can't.
  3. Can track unique page views effectively without hurting user's privacy.
  4. Custom events available.
  5. Super simple to setup. ( 1 go binary + 1 super small script on frontend ).
  6. Super low resource consumption.
  7. Dashboard is decoupled from the tool so you can use any tool ( like Metabase for visualization of data ).
  8. Supports multiple SQL database.

You may wish to ask some question here are some FAQ.

How do we uniquely identify users?

We identify users uniquely by creating a hash and storing it in a Redis database along with a UUID which automatically deletes itself in 24 hours.
hash = md5( raw_public_ip + browser_name + operating_system + date + secret)

It generates a 32 character long string with is stored in database along with a UUID and it is only valid for a day.

Parameters used in hash have the following reasons,

  1. IP - to identify user ( It may be a public IP like cafΓ© or a user's own IP )
  2. Browser - So if user changes his/her browser we forget it. Operating System - So if user changes its device we forget him.
  3. Date - So we forget user daily.
  4. Secret - Here comes the most important part we while production recommend to use a UUID that isn't logged anywhere so even if want to view user's private info you can't, but while development use a hardcoded string as you restart server many times and it will generate false unique visitors.

What makes it different ?

There are many privacy friendly analytics tool but here are some points that makes it special.

  1. It is written in go so you can but it on the same server as your app as it uses nearly to negligible amount of resource ( in large schema of things ).
  2. It is written in go fiber which can handle a by lot I mean around 35,000 requests per second ( as per their website).
  3. It currently supports PostgreSQL and in future I plan to add support for Clickhouse because of its amazing performance, and I will continue to keep postgres supported for as long as possible because of its low resource consumption it would be a great tool for small websites like blogs, like one that, I have though it hasn't been updated for a while now.
  4. I don't plan to convert it into a SaaS application ( at least in near future ) as I don't want to make another SaaS privacy focused analytics app as there are already many good in market. I'm making this in a way that you can get most insights from your data so it doesn't have a dashboard ( use something like Metabase for it here are some screenshots of dashboard that I build within 3-4 minutes while writing this readme and I'm no profession and it on par with what SaaS provides apps provides to you) with complete control over your data and it can run on simple commodity hardware for a long period of time without any manual Interventions.

1st image
2nd image
3rd image


Why don't it has a dashboard build in ?

There are many privacy friendly analytics tools and they have a dashboard built in as most of them are SaaS application but this isn't gonna be a SaaS app so in order to make most sense out of the data we recommend users to use something like Metabase as even a non-techie can make custom charts and if you are a techie then you can make even more sense of data by writing custom SQL Queries to obtain and visualize data.

The Images you saw above were made within 3-4 minutes while I was writing README for GitHub repo, and it was auto generated I just changed its sizes and names that's it. So we have made a conscious decision to decouple analytics tool and dashboard for it.

Top comments (4)

Collapse
 
karandpr profile image
Karan Gandhi

Hi Ketan.
These are the kind of posts which I like to read.

Good work !

Collapse
 
burneyhoel profile image
Burney Hoel

Same here, keep up the great work.

Collapse
 
ketanip profile image
KetanIP Author • Edited on

Thank you guys, it really motivates me to take such projects foreword.

Collapse
 
ketanip profile image
KetanIP Author

Any questions guys feel free to ask here πŸ™‚.

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›