DEV Community

How I removed google analytics and still have good data to analyze

Tobias Nickel on December 25, 2020

It was just recently, that I opened my google analytics account and added it to this website. I wanted to get some insights, about my website's vis...
Collapse
 
artis3n profile image
Ari Kalfus

Cloudflare recently released privacy-preserving analytics - essentially sacrificing a bit of accuracy by not individually identifying users, tracking them with cookies or local storage, etc. May be worth checking out

blog.cloudflare.com/privacy-first-...

Collapse
 
bias profile image
Tobias Nickel

looks like a good option. I was also interested to see if I could measure myself and with analytics in parallel and then compare if the numbers match up.

The cloudflare offer say it is free for everyone. maybe I give it a shot. Thanks

Collapse
 
christopher2k profile image
Christopher N. KATOYI

This is EXACTLY what I’ve been looking for ! Thanks for the recommendation

Collapse
 
prashanthr profile image
Prashanth R.

This looks like a great privacy focused option, thanks for the recommendation!

Collapse
 
cchana profile image
Charanjit Chana • Edited

Small correction, I’m not setting any cookies here. doNotTrack Is a browser feature and the checks is run on each page load otherwise I would have had to store something somewhere to identify the choice that was made which is exactly what I wanted to avoid.

I’m also not sure what is happening with cookie notices from 1st January, but I’m not at all interested in being a data controller when it comes to personal data so I’m happy to keep it as simple as possible!

Really appreciate the mention and I hope someone finds it useful!

Collapse
 
prashanthr profile image
Prashanth R. • Edited

Cool article! Great breakdown of how to move away from GA to be more privacy focused.

Based on my research and discussions in this thread, here's a list I've coined for analytics tools in no particular order:

Collapse
 
bias profile image
Tobias Nickel

thanks, yes, there are some very good options to chose from.

I am sure, self coding is not for everyone, but it is a great way to get some insights, not only to your visitors but also into the topic in general.

Collapse
 
mikenikles profile image
Mike

I developed my own solution, your-analytics.org.

It's open source and can be self-hosted. It's work in progress and a fun side project, hoping others find it useful too.

Collapse
 
feldev profile image
Félix Paradis

Looks neat!

Collapse
 
mikenikles profile image
Mike

Thanks Félix. It's a rough first version to test the infrastructure 🙂. The project will be my focus again starting next week. Lots to be added in terms of features and metrics that get captured.

Collapse
 
feldev profile image
Félix Paradis

I started using piratepx.com
It's a dead simple tracking pixel. It's 100% free and open source; a hobby project from a solo dev.
It's nowhere near as good as any other analytics solution, but it gives the ballpark estimate I'm after with 1 extra tiny network request and it's definitely legal everywhere.

inb4, but I think in the eyes of the law, Local Storage === Cookies

Collapse
 
okbrown profile image
Orlando Brown

At the moment it seems the focus is on the technical solutions. But let's think about something else. What is it that's really important to know?

For example it was mentioned that "screen size" was required to build mobile first optimisations. This is a great example of using data to make your site more accessible for a specific cohort of viewers.

Taking this a step further, consider what else can be used to give you insights. Simple stuff like location, gender, devices, where viewers drop off (heatmaps?) is all good but what do you really want to know that's going to aid in giving the best experience to your viewers/users.

This way round should drive your technical solution or decision on how best go about analytics.

Collapse
 
svitekpavel profile image
Pavel Svitek

Did you see Countly? count.ly/

Collapse
 
smaffulli profile image
Stefano Maffulli

I noticed just now that count.ly is blocked by my default installation of Pi-hole. I wonder why that is considered a bad domain

Collapse
 
bias profile image
Tobias Nickel • Edited

no, I didn't. But it looks very good. it also can be installed myself.

When I see all the alternatives in these comments, I get thinking to install them all at once on my blog.

Collapse
 
gsarig profile image
Giorgos Sarigiannidis

According to that popular WordPress plugin, you can use Google Analytics without a cookie warning, as long as you configure it in a certain way. The instructions are for Google Analytics, so despite the fact that it is a WordPress plugin, the platform seems irrelevant.

Collapse
 
joshcheek profile image
Josh Cheek

My first thought was to add a middleware to the server that logs this info. I guess there's some risk that it's overly granular and doesn't actually represent page loads. Probably also wouldn't work with single page apps that don't need to make requests across pages. But my app doesn't have sophisticated enough user interactions to need much JS, so I'm pretty sure I could just log all requests and get roughly the same thing without needing to make any additional HTTP requests.

Collapse
 
michaelcurrin profile image
Michael Currin

When I looked into Google Analytics and GDPR before, i found that there even though cookies are stored that the info is not personally identifying and therefore does not need consent.

That may have been inaccurate or things might have changed. I just found this guide which says in Sept 2020, Google launched a consent mode so you can integrate with CookieBot (or maybe OneTrust which we use at work). And if the user doesn't give consent, you still get user agent and some other fields covered in the article.

The article also talks about user ID and anonymous IP (the latter it says is necessary for compliance). So it seems like Google Analytics tracking is only compliant if you configure it a certain way.

cookiebot.com/en/google-analytics-...

BTW I've come across Adobe Analytics but haven't used it. And i heard of Monomo before in a forum but it looks like it is self hosted so thats a barrier for setting up unless you have the time and know-how.

Collapse
 
lamka02sk profile image
lamka02sk

Elastic APM is also a good solution

Collapse
 
rexthony profile image
Rex Anthony

This is a good article. But you might want to check out Page Insight Analytics. It is privacy friendly and GDPR compliant. I love the simplicity and UI design

Collapse
 
jkettmann profile image
Johannes Kettmann • Edited

I switched to plausible.io and am very happy with it. Simple to set up, cheap, and provides everything I need

Collapse
 
michalmxt profile image
Michael Lucht

I am no lawyer, but I am pretty sure that local storage, indexeddb, websql etc. are legally treated just like cookies, so you need to ask for consent on your page.

Collapse
 
bias profile image
Tobias Nickel

right, me neighter. and this article is likely not the end of the story.

guess with the records that i create, it is possible to show single journeys. if in future i add a feature that require authentication, in theory the user could be connected with a journey.

we can think of technical solutions to make it impossible, but you are right, the legal side more difficult. maybe an info banner is needed anyway.

Collapse
 
gdledsan profile image
Edmundo Sanchez

My hosting has matotomo as a one click install, I can onstall it on every domain I have individually, so that is the way for me.

Collapse
 
levirs565 profile image
Levi Rizki Saputra

Why you do not use Motomo?

Collapse
 
bias profile image
Tobias Nickel

My server is with node.js. Now there is no php+mysql. Just was to lazy setting this up. and did not want to maintain the updates.

When I was a student, I had a project using piwik(motomos old version). it already worked very good. as the development continued all the years, it can only have gotten better.

Collapse
 
levirs565 profile image
Levi Rizki Saputra

Where you host your server?

Thread Thread
 
bias profile image
Tobias Nickel

I use a v-server from 1and1 in germany.

I like the unlimited traffic on a 100mbit connection. The page might get slow(never got slow so far in 10 years), but the cost is predictable.

however, it seems impossible to use the free let's encrypt https certificates.

I can choose different OS, debian, ubuntu, fedora,... but the software install repos are directed to a internal mirror that contains quite outdated software versions. node.js I can install manual, but docker I can't install on that server.