Privacy-first analytics for your website

Counter.dev - choosing privacy-first analytics tool for your website or blog


3 min read 08/09/21

There are many options

And most of them provide more than you actually need

So, you are thinking about adding analytics in your app but are not sure, what is going to be your best option. Some of the options are paid, some are free. Google doesn't seem to be attractive to you.

You should look into counter.dev, here's the github page.

It's an open source project, privacy focused solution, they do not collect any user data, but they do provide a hosted solution to see your analytics results. And it's totally possible to fork it and host it on your own.

Although I don't think it worth the trouble.

---------------8<-------------[ cut here ]-----------------

Counter.dev

What does it do?

They offer you a very simple tracking solution, which is able to do two things

  • You can see which other websites, social media, or blogs link to your website.

  • Also, it let you count your daily visitors, their languages and device types

Setting it up in NextJS is a breeze!

Well setting it up anywhere will be a breeze

Here's what you should insert into you custom _document.js inside Next Head.

You will get your own tracking script, right after you make an account.
<script
  dangerouslySetInnerHTML={{
    __html: `if(!sessionStorage.getItem("_swa")&&document.referrer.indexOf(location.protocol+"//"+location.host)!== 0){fetch("https://counter.dev/track?"+new URLSearchParams({referrer:document.referrer,screen:screen.width+"x"+screen.height,user:"vinclou",utcoffset:"-5"}))};sessionStorage.setItem("_swa","1");`
  }}
></script>

Just glimpse over their UI

dashboard-1
dashboard-1
dashboard-1
dashboard-1
---------------8<-------------[ cut here ]-----------------

Conclusion

Counter.dev is a nice tool, for someone who is looking to provide private and simple tracking

Proceed with caution as, Counter.dev wouldn't be a good solution for you if you need thorough analytics.

It can be easily blocked by an ad blocker, as it's privacy first solution and it's not going to change.

I still urge you to check it out, it's an open source project, you can always fork it, add the extras which will suit your needs. And what you really need to ask yourself, how much of analytics I really need? For the rest of us, a simple tool that is easily manageable is to-go option.

We are busy people after all. There's little time to waste on google's unwelcoming UI and privacy concerns or paid solutions which probably won't bring much to a hobby project.

This the end, my dear friend. Subscribe if you like what you're seeing. 🔨